NagiosGrapher: How do the links work?

Arno Lehmann al at its-lehmann.de
Tue Jan 31 22:38:42 CET 2006


Hi,

On 1/31/2006 9:49 PM, Alastair Sheppard wrote:
> On 02/01/2006 at 8:01 AM, Hugo van der Kooij wrote:

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

Ok, that sounds reasonable.


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

Well, that might be a problem, too, but it's definitely not the problem 
we observed. First, if collect2.pl doesn't recognize that values as 
belonging to a service it has to graph it will not even try to create a 
rrd. Thus, the simple fact that rrd creation was invoked tells us that 
the RE worked.

Then, in my setup, I hand-crafted the definitions in ngraph.cfg and I am 
sure that they don't stumble over case-sensitive matching. For example, 
the exact same service definition, matched by the exact same graph 
definition, has resulted in severl rrds being created and one not. (some 
time ago, but I guess I could still find the log files in some backup...)

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

Hmm. Even if I would neither want nor need that modification in my copy 
of collect2.pl, there might be many cases where it's helpful.

Arno

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

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


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