NagiosGrapher: How do the links work?

Alastair Sheppard sheppaap at lincoln.ac.nz
Tue Jan 31 21:49:35 CET 2006


On 02/01/2006 at 8:01 AM, 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 ) ) {
> 
> 
> 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} ) );
> 
> 
> 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.
> 
>> Had the same problem a while back and it related to the case of
>>  my service_description, as in uppercase or lowercase. I had
defined
>> my normal service check for http and it included the following:

>I'm not sure it is the same issue. For all pracical puposes you have
>killed a thread a started a loose one by removing ALL of the content.
So
>There is no indication to what you are referring.

>If you want to use a thread then quote the relevant parts.

>Hugo.

Hi,				

Righto, thanks for the advice. I admit, I was using the nagiosexchange
website to post that and I stuffed it up by not quoting your post.
Anyhow, did some more digging and while this should probably go to the
NagiosGrapher forum, I'll post it here for others who might be having
the same problems.

With the problem example here, the service in nagios is defined rougly
with a host_name of "aragon" and a service_description of "Current
Load". In the NagiosGrapher config, the definition for the service_name
is  "LOAD". So, the problem is the comparison check  line in collect.pl
which reads 

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

The $service at this point will be "Current Load" and the $service_name
is "LOAD", which with the above pattern match will fail and then not
define the step and heartbeat.

To solve, either make the comparison case insensitive or change the
$service_description or the $service definition to match each other. The
first one will stop any proper regex matching I think (not too sure how
that all works), but as a temp fix you could change the if line to
read:

if ( $service =~ /$_->{service_name}/i ) {

Cheers

Alastair







-------------------------------------------------------
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