Problem is about using PNP graph templates. For instance:
There are 2 services under localhost:
Code: Select all
define service {
host_name localhost
service_description FS1 Used
use template1
check_command check_disks! -p / -p /store!!!!!!!
register 1
}
define service {
host_name localhost
service_description FS2 Used
use template1
check_command check_disks! -p / -p /store -p /boot!!!!!!!
register 1
}
The PNP template file looks like this:
Code: Select all
<?php
if(isset($DS[1])) {
$opt[1] = "--vertical-label \"MB\" -l0 --title \"$hostname - 1\" ";
$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "AREA:var1#FF0000:\"Space used \" " ;
$def[1] .= "GPRINT:var1:LAST:\"%6.2lf last\" " ;
$def[1] .= "GPRINT:var1:AVERAGE:\"%6.2lf avg\" " ;
$def[1] .= "GPRINT:var1:MAX:\"%6.2lf max\\n\" " ;
}
if(isset($DS[2])) {
$opt[2] = "--vertical-label \"MB\" -l0 --title \"$hostname - 2\" ";
$def[2] = "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
$def[2] .= "AREA:var2#00AA00:\"Space used \" " ;
$def[2] .= "GPRINT:var2:LAST:\"%6.2lf last\" " ;
$def[2] .= "GPRINT:var2:AVERAGE:\"%6.2lf avg\" " ;
$def[2] .= "GPRINT:var2:MAX:\"%6.2lf max\\n\" " ;
}
if(isset($DS[3])) {
$opt[3] = "--vertical-label \"MB\" -l0 --title \"$hostname - 3\" ";
$def[3] = "DEF:var3=$rrdfile:$DS[3]:AVERAGE " ;
$def[3] .= "AREA:var3#0000BB:\"Space used \" " ;
$def[3] .= "GPRINT:var3:LAST:\"%6.2lf last\" " ;
$def[3] .= "GPRINT:var3:AVERAGE:\"%6.2lf avg\" " ;
$def[3] .= "GPRINT:var3:MAX:\"%6.2lf max\\n\" " ;
}
?>
So the problem is this third empty placeholder for the first service - it shouldn't appear since there is no DS[3] defined.
Any ideas ?
Michalux