Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
rrd_change
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
This script has been written because sometimes (not often) a nagios plugin changes and outputs more (or less) performance data values than before (or in different order), resulting in a failure to update the corresponding RRD file.
So to keep the existing data, I wrote this script to "insert", "append" or even rearrange ("select") datasources within the RRD file.
The script is inspired by the "rrd_convert.pl" script delivered with PNP4Nagios.
NOTE! For now, this tool should only be used on RRD files created by PNP4Nagios! Here, the datasource names are just numbers starting from 1. Then inserting or selecting datasources, I change these numbers!
Note for heartbeat: You should use the same heartbeat value for new datasources. Use
rrdtool info | grep -i 'heartbeat'
to list the heartbeat values within the RRD file.
Examples 1:
rrd_change.pl -a -t GAUGE:300 -t COUNTER:300 -f file.rrd
Appends 2 new datasources to the RRD file. One of type GAUGE with a heartbeat of 300 seconds an a COUNTER datasource with 300 seconds heartbeat.
Example 2:
You have a RRD file with 4 datasources. The plugin outputs:
1. virtual memory
2. physical memory
3. buffers
4. swap
The plugin changed. It also outputs "cache memory" on position 3
1. virtual memory
2. physical memory
3. cache memory
4. buffers
5. swap
Add 1 new (empty) datasource on position 3
rrd_change.pl -i -p 3 -t GAUGE:300 -f file.rrd
Example 3:
The plugin in example 2 changed again! Now, the output order differs. You would write wrong values into the datasources. You have to reorder the datasources. The new order is:
1. swap
2. physical mem
3. virtual mem
4. buffer
5. cache
rrd_change.pl -s 5,2,1,4,3 -f file.rrd
This command reorders the datasources. The order in which the datasources are specified with parameter "-s" is the new order within the RRD file, starting from number 1.
Note: Every datasource *not* specified with paramter "-s" will be removed from the RRD file! So this command can also be used to delete datasources.
So to keep the existing data, I wrote this script to "insert", "append" or even rearrange ("select") datasources within the RRD file.
The script is inspired by the "rrd_convert.pl" script delivered with PNP4Nagios.
NOTE! For now, this tool should only be used on RRD files created by PNP4Nagios! Here, the datasource names are just numbers starting from 1. Then inserting or selecting datasources, I change these numbers!
Note for heartbeat: You should use the same heartbeat value for new datasources. Use
rrdtool info
to list the heartbeat values within the RRD file.
Examples 1:
rrd_change.pl -a -t GAUGE:300 -t COUNTER:300 -f file.rrd
Appends 2 new datasources to the RRD file. One of type GAUGE with a heartbeat of 300 seconds an a COUNTER datasource with 300 seconds heartbeat.
Example 2:
You have a RRD file with 4 datasources. The plugin outputs:
1. virtual memory
2. physical memory
3. buffers
4. swap
The plugin changed. It also outputs "cache memory" on position 3
1. virtual memory
2. physical memory
3. cache memory
4. buffers
5. swap
Add 1 new (empty) datasource on position 3
rrd_change.pl -i -p 3 -t GAUGE:300 -f file.rrd
Example 3:
The plugin in example 2 changed again! Now, the output order differs. You would write wrong values into the datasources. You have to reorder the datasources. The new order is:
1. swap
2. physical mem
3. virtual mem
4. buffer
5. cache
rrd_change.pl -s 5,2,1,4,3 -f file.rrd
This command reorders the datasources. The order in which the datasources are specified with parameter "-s" is the new order within the RRD file, starting from number 1.
Note: Every datasource *not* specified with paramter "-s" will be removed from the RRD file! So this command can also be used to delete datasources.