Pppnp4nagios graph customization

Jim Avery jim at jimavery.me.uk
Thu Apr 9 17:29:23 CEST 2009


2009/4/9  <mohandas.k at tcs.com>:
>
> Hi All,
>
> We have installed nagios (3.0.5) on Solaris sparc box and configured rrdtool
> (1.2.19) along with pnp4nagios- npcd (0.4.13) for dashboard/graph.
>
> By default we are getting following graph for locolhost free swap. I want to
> configure  following requirements :
>
> (1) can we add more variable (i.e say "Total Swap" ) in graph ?
>
> (2) Can we create different-different color in graph for different-different
> status critical-> RED,OK->Green,Warnijng->Yellow     ?
>
> (3) last question how can we change graph updation time interval (here it's
> showing as 20 Minutes) however in our service definition,it's 10 Minutes
>
> Following is default graph for your better understanding :


I believe there's a typo in the default.php template which means
default graphs don't show the maximum value.  Copy the file
"default.php" from /usr/local/nagios/share/pnp/templates.dist/ to the
../templates folder, giving it the name "check_local_swap.php".  Then
edit this file to correct the problem.

The erroneous section is:

        if ($WARN[$i] != "") {
                $warning = $WARN[$i];
        }
        if ($CRIT[$i] != "") {
                $critical = $CRIT[$i];
        }
        if ($MIN[$i] != "") {
                $lower = " --lower=" . $MIN[$i];
                $minimum = $MIN[$i];
        }
        if ($CRIT[$i] != "") {        <<----THIS LINE IS WRONG!!
                $upper = " --upper=" . $MAX[$i];
                $maximum = $MAX[$i];
        }
        if ($UNIT[$i] == "%%") {
                $vlabel = "%";
        }

In the line I've pointed out here, it should read $MAX not $CRIT.

Whether that fixes your problem will depend also on whether your
plugin returns the performance data in the correct format.

You can also edit the template to change colours and so on.

As for the time interval, I'm not too sure.  If you want to tinker
with the template, you'll need to read up on how it all works, for
example at http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html and edit
the template accordingly.

For in-depth discussion of PNP, I recommend you subscribe to their
email list https://lists.sourceforge.net/lists/listinfo/pnp4nagios-users

hth,

Jim

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list