[Nagiosplug-devel] [ nagiosplug-Feature Requests-800634 ] rrdtool support in mrtg

SourceForge.net noreply at sourceforge.net
Mon Sep 22 08:26:19 CEST 2003


Feature Requests item #800634, was opened at 2003-09-04 18:34
Message generated for change (Comment added) made by stevehan
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=800634&group_id=29880

Category: None
Group: None
Status: Open
Priority: 5
Submitted By: Steve Hanselman (stevehan)
Assigned to: Nobody/Anonymous (nobody)
Summary: rrdtool support in mrtg

Initial Comment:
Has anybody looked at creating a check_mrtg that uses 

the rrdtool database?



----------------------------------------------------------------------

>Comment By: Steve Hanselman (stevehan)
Date: 2003-09-22 15:25

Message:
Logged In: YES 
user_id=521347

Ok, I've written a replacement for the code supplied in the 

contrib directory, it's attached, but wait, you'll need to patch 

nagios as you need to switch off semicolon comments in lines 

as the checking doesn't care whether they are in quotes or 

not :(



Here are a couple of config entris to get you started:

define service {

  use			servicetemplate1

  host_name             linux3

  service_description   5 volt rail

  check_command         

check_rrd_range!/var/www/html/cacti/rra/linux3_value_45.rrd!

4.7!5.2!4.4!5.5

}



define service {

  use			servicetemplate1

  host_name             linux3

  service_description   Processor Temperature

  check_command         

check_rrd_max!/var/www/html/cacti/rra/linux3_value_48.rrd!

30!35

}



#

# check_rrd_min, generates errors if the value falls below a 

level, e.g. free disk space

# check_rrd_max, generates errors if the value goes above a 

level, e.g. swap usage

# check_rrd_range, generates errors if the value goes outside 

a range, e.g. voltage

#

# check_rrd_min!myfreespace.rrd!100!50

# check_rrd_max!mycpuload.rrd!5!10

# check_rrd_range!myvoltage.rrd!4.8!5.2!4.5!5.5



define command{

	command_name	check_rrd_max

	command_line	$USER1$/check_rrd.pl -

file=$ARG1$ -warning='return(sprintf("Warning Value=%

f\n",$$value)) if ($$value>$ARG2$);' -critical='return(sprintf

("Critical Value=%f\n",$$value)) if ($$value > $ARG3$);' -

default='printf "OK Value=%f\n", $$value; return 0;' -

dataset=0 -cf=MAX

}

define command{

	command_name	check_rrd_min

	command_line	$USER1$/check_rrd.pl -

file=$ARG1$ -warning='return(sprintf("Warning Value=%

f\n",$$value)) if ($$value<$ARG2$);' -critical='return(sprintf

("Critical Value=%f\n",$$value)) if ($$value < $ARG3$);' -

default='printf "OK Value=%f\n", $$value; return 0;' -

dataset=0 -cf=MIN

}

define command{

	command_name	check_rrd_range

	command_line	$USER1$/check_rrd.pl -

file=$ARG1$ -warning='return(sprintf("Warning Value %

f\n",$$value)) if ($$value<$ARG2$||$$value>$ARG3$ );' -

critical='return(sprintf("Critical Value=%f\n",$$value)) if 

($$value< $ARG4$ || $$value> $ARG5$ );' -default='printf "OK 

Value=%f\n", $$value; return 0;' -dataset=0 -cf=MAX

}





You'll also need to patch the source in two places and 

remove the checks for ; comments: 



xdata/xedtemplate.c:            /* grab data before comment 

delimiter - faster than a strtok() and strncpy()... */

xdata/xodtemplate.c:            /* grab data before comment 

delimiter - faster than a strtok() and strncpy()... */





----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=800634&group_id=29880




More information about the Devel mailing list