Hi Everyone,
Need your assistance to write a custom pnp template to draw a graph in nagios :
Scenario :
Just want to draw a line for a service.
1 means service is UP
0 means service is down.
I don't want any average or anything.
Please assist me how can I achieve this ?
Regards
PNP4nagios Template for a service
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: PNP4nagios Template for a service
I don't believe a custom template is necessary, isn't this what the default template writes out?
Or something like this
Or something like this
Code: Select all
<?php
$opt[1] = "--lower=$MIN[1] --vertical-label \"State\" --title \"State\" ";
$def[1] = "DEF:var1=$rrdfile:$DS[1]:MAX " ;
$def[1] .= "LINE1:var1#000000:\"\" " ;
if ($WARN[1] != "") {
$def[1] .= "HRULE:$WARN[1]#FFFF00 ";
}
if ($CRIT[1] != "") {
$def[1] .= "HRULE:$CRIT[1]#FF0000 ";
}
$def[1] .= "GPRINT:var1:LAST:\"%.0lf $UNIT[1] LAST \" ";
$def[1] .= "GPRINT:var1:MAX:\"%.0lf $UNIT[1] MAX \" ";
?>