How-to debug corrupted xml file of pnp4nagios
This article explains how to identify and troubleshoot corrupted PNP4Nagios XML files in Checkmk using xmllint.
LAST TESTED ON CHECKMK 2.5.0P14
Table of Contents
Troubleshooting corrupted XML files
First, check whether
xmllintis already installed on your Checkmk server:root@linux~$ command -v xmllintIf the command returns a path, such as
/usr/bin/xmllint, the utility is already installed.
If no path is returned, installxmllintusing the appropriate command for your Linux distribution.
Debian/Ubuntusudo apt install libxml2-utilsRed Hat Enterprise Linux (RHEL) and binary compatible distributions such as Rocky Linux
sudo dnf install libxml2Note: On older RHEL-based distributions that use
yum, runsudo yum install libxml2instead.Switch to your Checkmk site user and execute the following command to check the PNP4Nagios XML files. The command saves the output to
xmllint.logfor further analysis.root@linux~$ su - mysite OMD[mysite]:~$ for i in $(find ~/var/pnp4nagios/perfdata/ -name "*xml"); do echo "#####$i####"; xmllint --debug --format $i; echo "#####" ;done &> xmllint.logTIP: With the parameter
--noout, xmllint will show you only the errors and not the whole structure of the xml files.root@linux~$ su - mysite OMD[mysite]:~$ for i in $(find ~/var/pnp4nagios/perfdata/ -name "*xml"); do echo "#####$i####"; xmllint --noout --debug --format $i; echo "#####" ;done &> xmllint_only_debug.logVisit the Checkmk forum to search for similar PNP4Nagios issues and possible solutions. If you cannot find a resolution, consider creating a new forum post with the relevant error messages and debugging logs.
If the issue persists, check whether your issue is addressed in Troubleshooting errors during the RRD conversion.