How to recreate the PNP4NAGIOS RRD files from XML file

Hi

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?

Regards,
Petra

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

   <DATASOURCE>
     <TEMPLATE>check_mk-df</TEMPLATE>
     <RRDFILE>/opt/omd/sites/mysite/var/pnp4nagios/perfdata/XXX/fs_C__DiskLibrary_MP_MON_NG_046__trend.rrd</RRDFILE>
     <RRD_STORAGE_TYPE>MULTIPLE</RRD_STORAGE_TYPE>
     <RRD_HEARTBEAT>8460</RRD_HEARTBEAT>
     <IS_MULTI>0</IS_MULTI>
     <DS>1</DS>
     <NAME>trend</NAME>
     <LABEL>trend</LABEL>
     <UNIT></UNIT>
     <ACT>1334.391368</ACT>
     <WARN></WARN>
     <WARN_MIN></WARN_MIN>
     <WARN_MAX></WARN_MAX>
     <WARN_RANGE_TYPE></WARN_RANGE_TYPE>
     <CRIT></CRIT>
     <CRIT_MIN></CRIT_MIN>
     <CRIT_MAX></CRIT_MAX>
     <CRIT_RANGE_TYPE></CRIT_RANGE_TYPE>
     <MIN>0</MIN>
     <MAX>1048575.229167</MAX>
   </DATASOURCE>

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.

@JDamian
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
2 Likes

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.

Hi, related with this topic… Do you know if it is possible to change de RRD_STOARGE_TYPE to SINGLE instead of using the MULTIPLE?

I need to migrate from nagios and I would lime to mantain that type.