NagiosGrapher: How do the links work?

Hugo van der Kooij hvdkooij at vanderkooij.org
Sat Jan 28 00:14:38 CET 2006


On Fri, 27 Jan 2006, Arno Lehmann wrote:

> you're quite busy :-)

Yeah. Anything that does not work right is annoying to me. And as this was
getting real itchy I started to scratch real hard.

>
> On 1/27/2006 9:58 PM, Hugo van der Kooij wrote:
> > Did some more debugging: The section below seems to be having a bit of a
> > problem:
> >
> >             # If the RRD not exists:
> >             if ( !( -e $file ) ) {

<quote
src="http://www.cclabs.missouri.edu/things/instruction/perl/perlcourse.html">
The variable "$_" Perl presumes when needed variables are not specified.
Thus:

    <STDIN>;          assigns a record from filehandle STDIN to $_
    print;            prints the curent value of $_
    chop;             removes the last character from $_
    @things = split;  parses $_ into white-space delimited
                      words, which become successive
                      elements of list @things.
</quote>

Now we all know what children spawn from assumptions. So I think this is
one of those assumptions which do not hold true. (Perhaps it did with
another perl version.)

As perl is not quite my native language I may make my own share of
(equally wrong) assumptions. (Not to mention the pointer thing I never
quite seem to get right.)

> >                 # Adding Graph Value Key's
> >                 foreach (@blocks) {
> >                     if ( $service =~ /$_->{service_name}/ ) {

I would guess (at least I tell you ;-) that with the following block:

define ngraph{
        service_name            LOAD
        graph_log_regex         , (\d+\.\d+)($| critical| warning)
        graph_value             15min
        graph_units             load
        graph_legend            15min avg load
        rrd_plottype            AREA
        rrd_color               EACC00
        }

$_->{service_name} would result in LOAD and would match $service if the
service send to the pipe is in fact a LOAD type of check result.

> >                         # change the default rrdtype if a different is defined
> >                         my $rrd_type = "GAUGE";
> >                         $rrd_type = $_->{rrd_type} if ( exists( $_->{rrd_type} ) );

I did not define rrd_type so the default GAUGE is just fine by me.

> >                          # setting the heartbeat#
> >                         if (!defined($heartbeat)) {
> >                                 $heartbeat = $default_heartbeat;
> >                                 $heartbeat = $_->{heartbeat} if ( exists( $_->{heartbeat} ));
> >                         }
> >
> >                         # setting the step
> >                         if (!defined($step)) {
> >                             $step = $default_step;
> >                             $step = $_->{step} if ( exists( $_->{step} ));
> >                         }

Neither of them got there explicitly so nothing exiting here.

> >                         push @system,
> >                           "DS:"
> >                           . $_->{graph_value} . ":"
> >                           . $rrd_type
> >                           . ":". $heartbeat. ":U:U";

This should result in DS:15min:GAUGE:600:U:U (600 being the default
heartbeat). But it did not.

I just got them added manually and the graphs now build fine. But it still
feel itchy about the script but I is just like that itch on your back. I
would like to scratch it but just can't reach it.

Hugo.

-- 
	I hate duplicates. Just reply to the relevant mailinglist.
	hvdkooij at vanderkooij.org		http://hvdkooij.xs4all.nl/
		Don't meddle in the affairs of magicians,
		for they are subtle and quick to anger.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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