You can always follow this method to remove a datasource from the RRD as well and keep your existing data:
The reason why this is not working is because you changed the command which changed the perfdata information.
This the RRD file is expecting two parameters (called datasources) because that is what it was originally built with:
Code: Select all
cpu_usagemhz=1160.00Mhz;; cpu_usage=3.62%;;
When you modified the check command it removed the cpu_usagemhz datasource so it's only trying to insert one datasource value now when the RRD is expecting two, which causes an error and will not insert the data.
You can remove the RRD and XML files for this service in
/usr/local/nagios/share/perfdata/HOSTNAME/ so that it can rebuild them if you don't care about the historical data.
Note: You will lose all historical performance graph information for this service if you delete those files.
The only ways to get it graphing again WITHOUT losing the historical data would be to change the command back to what it was before OR follow this sweet guide that I wrote:
How to delete a datasource from an RRD
Here is how I did it:
First, open up the
/usr/local/nagios/share/perfdata/HOSTNAME/SERVICE.xml file and find the
<DS>NUMBER</DS> entry (this means data source number) for the one you want to remove.
Code: Select all
<DATASOURCE>
<TEMPLATE>check_isis</TEMPLATE>
<RRDFILE>/usr/local/nagios/share/perfdata/UVN-DCD-SD02/Performance_Data.rrd</RRDFILE>
<RRD_STORAGE_TYPE>SINGLE</RRD_STORAGE_TYPE>
<RRD_HEARTBEAT>8460</RRD_HEARTBEAT>
<IS_MULTI>0</IS_MULTI>
<DS>4</DS>
<NAME>MESSAGESPS</NAME>
<LABEL>MESSAGESPS</LABEL>
<UNIT></UNIT>
<ACT>2324</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></MIN>
<MAX></MAX>
</DATASOURCE>
Since you want to remove MESSAGESPS we can see that the DS number is 4.
Then remove the MESSAGEPS from the script/plugin/perfdata output.
Run these commands to install the tool that we will use to delete the data source:
Code: Select all
cd /tmp
wget "http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.25.tar.gz?r=&ts=1452788875&use_mirror=iweb" -O /tmp/pnp4nagios-0.6.25.tar.gz
tar zxf /tmp/pnp4nagios-0.6.25.tar.gz
cd /tmp/pnp4nagios-0.6.25
./configure
make all
cp /tmp/pnp4nagios-0.6.25/scripts/rrd_modify.pl /root/scripts/
chmod +x /root/scripts/rrd_modify.pl
Run these commands to delete the data source:
*** NOTE: Make sure to change DATASOURCENUM, HOSTNAME, and SERVICENAME to the proper values.
*** NOTE: SERVICENAME should be changed to the actual service name from the filename (validate what it should be, it may differ from what you have set in Nagios)
Code: Select all
/root/scripts/rrd_modify.pl /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd delete DATASOURCENUM
mv /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd.bak
mv /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd.chg /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd
chown nagios.nagios /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd
chmod 775 /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd
Now it should start graphing properly when the new checks come in (may take 15 to 20 minutes).