How to recreate the PNP4NAGIOS RRD files from XML file


My 2.0.0p27 site does not create the RRD files in ~/var/pnp4nagios/perfdata/HOST subdirectory.
I unmonitored the service and monitored back with no luck.

How can they be create from the .XML file?

I guess it is using rrdtool comand but I have no details.

Best regards

Hi @JDamian

do you get any error message or something like this?


With 2.0 the new graphing system replaces PNP4Nagios also in the RAW edition.

Are there RRD files below $OMD_ROOT/var/check_mk/rrd?

Yes, the are RRD files under ~/var/pnp4nagios/perfdata and under ~/var/check_mk/rrd.

The error messages are similar to

2023-05-26 10:58:27 [4] [main] [RRD helper 1643] [log] Error creating RRD for pnp_multiple;XXX;Interface port-channel434;outdisc;0: Tried to create /opt/omd/sites/mysite/var/pnp4nagios/perfdata/XXX/Interface_port-channel434_outdisc.rrd, but this RRD exists.

And yes, that RRD exists and its timestamp is about 2 months ago

-rw-r--r--. 1 mysite mysite 384952 Mar 21 03:28 Interface_port-channel434_outnucast.rrd

This site was updated from 1.6.0.p28 to 2.0.0p27.

From this


How to create the RRD file fs_C__DiskLibrary_MP_MON_NG_046__trend.rrd ?

AFAIK - the perfdata remains under ~/var/pnp4nagios/perfdata for CRE editions.

Sometimes the .rrd creation is interrupted and the pnp4nagios logic doesn’t try again if the .xml is already there.
The easy solution: delete the .xml file, it doesn’t hold any information that won’t be recreated automatically.

If that affects more then a few services, we use this little automation

cd ~/var/pnp4nagios/perfdata
omd stop nagios && omd stop rrdached
# walk through all xml files and check if the .rrd files they are configured to use exist
for file in */*.xml; do grep -Po "(/.*omd/.*.rrd)" $file | while read rrd ; do test -f $rrd || echo $file >> /tmp/xmls_to_delete; done; done 
# make sure each xml is only listed once, if you don't have "sponge" from the moreutils, redirect to a temp file instead
sort -u /tmp/xmls_to_delete | sponge /tmp/xmls_to_delete
# if you want to be extra careful, make a backup of all the xml files, but to be honest, I've never needed them. 
tar cjf ~/custom/perfdata_xml_backup.tar.bz2 -T /tmp/xmls_to_delete
# now delete the xml files
for file in $(cat /tmp/xmls_to_delete); do rm "$file"; done
omd start nagios
omd start rrdached

If this is the case you don’t use the RAW edition. It must be enterprise or free edition with CMC core.

1 Like

Yes @andreas-doehler, it is the CME edition.

And that is the outcome from using the cmk --convert-rrds tool — when it finds a “problem”, it stops and leaves you some RRD files in ~/var/pnp4nagios/perfdata and some RRD files in ~/check_mk/rrd for the same host.