Home Directory Utilities rrd_change

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

rrd_change

Rating
6 votes
Favoured:
1
Current Version
0.2
Last Release Date
2013-08-24
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
Owner
License
GPL
Hits
36887
Files:
FileDescription
rrd_change.plrrd_change.pl
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This script is used to manipulate RRD files. It can "append" or "insert" new datasources to the file and rearrange (and / or delete) the datasources within the file.
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.

Reviews (3)
bywhutest, December 18, 2018
Very useful script. Thank you very very much!
byPeer, October 25, 2016
Just make sure you do that with the user that owns the RRD files, or recall to chown it after the change.

Great utility!
byCheng, August 22, 2013
1 of 1 people found this review helpful
Can you provide some examples of use ?
Owner's reply

Hope these examples will help