NagiosGrapher: How do the links work?

Arno Lehmann al at its-lehmann.de
Thu Jan 26 22:10:04 CET 2006


Hi,

On 1/26/2006 9:13 PM, Hugo van der Kooij wrote:
> On Thu, 26 Jan 2006, Arno Lehmann wrote:
> 
> 
>>If you posted one of the entries not working and the corresponding
>>output from the check plugin someone, perhaps even I, might help you more.
> 
> 
> I may be a bit rusty on RRDtool and regex but I miss the load issue here.
> 
> The plugin output:
> 	OK - load average: 2.01, 1.67, 1.55
> 
> 3 gauges defined:
> 
> 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
>         }

I recognize that one... IIRC that's one of the samples I could use 
almost without modification...

>         graph_log_regex         , (\d+\.\d+),
>         graph_value             5min
>         rrd_plottype            STACK
> 
>         graph_log_regex         : (\d+\.\d+),
>         graph_value             1min
>         rrd_plottype            STACK
> 
> To me this should match just fine. I suspect there is nothing wrong with
> that.

No, the log you posted shows that it captures the values.

> But in the sample there is a section which has me puzzled:
> 
> define ngraph{
>         service_name            LOAD
>         type                    CDEF
>         graph_value             cdef_load
>         graph_units
>         graph_legend
>         graph_calc              15min,5min,+,1min,+
>         rrd_plottype            LINE1
>         rrd_color               000000
>         hide                    no
>         }
> 
> Why would one try to add these lines together anyway?

Because it makes a nice image :-)

> I would expect to see multiple lines in the design. These values just
> don't make sense to add up.

Right... but it's nice for a customer... and you can overlay that image 
with a line graph for the actual load value.

> But that is for later to worry about. I can
> fix the graphs when I want to later.
> 
> The log tells me:
> 
> 2006-01-26 20:49:46 PIPE: aragorn       Current Load    OK - load average:
> 1.58, 1.59, 1.56     load1=1.580;5.000;10.000;0;
> load5=1.590;4.000;6.000;0; load15=1.560;3.000;4.000;0;
> 2006-01-26 20:49:46 RRD: rrdtool create
> /var/spool/nagios/rrd/aragorn/50651c20531d52e9c5eaa48a204e53c4.rrd --step=
> RRA:AVERAGE:0.5:5: RRA:MAX:0.5:5: RRA:MIN:0.5:5: RRA:AVERAGE:0.5:30:
> RRA:MAX:0.5:30: RRA:MIN:0.5:30: RRA:AVERAGE:0.5:120: RRA:MAX:0.5:120:
> RRA:MIN:0.5:120: RRA:AVERAGE:0.5:1440: RRA:MAX:0.5:1440: RRA:MIN:0.5:1440:
> 2006-01-26 20:49:46 RRD: [aragorn][Current Load]:step size should be no
> less than one second
> 2006-01-26 20:49:46 VALUES: [aragorn][Current Load]: 1min=1.58 5min=1.59
> 15min=1.56
> 2006-01-26 20:49:46 RRD: rrdtool update
> /var/spool/nagios/rrd/aragorn/50651c20531d52e9c5eaa48a204e53c4.rrd
> --template=1min:5min:15min N:1.58:1.59:1.56
> 2006-01-26 20:49:46 RRD: [aragorn][Current Load]:opening
> '/var/spool/nagios/rrd/aragorn/50651c20531d52e9c5eaa48a204e53c4.rrd': No
> such file or directory
> 
> I just don't see where the step size gets defined (besides the default
> values).

That's something I encountered, too. For some reason I don't understand 
- and I dug around in collect2.pl, too - the script simply omits 
important stuff when creating the rrds. In the rrdtool create command 
above, you notice the RRAs ending with a : . There's some stuff missing.

(Coincidentially, I was just setting up another service which should be 
graphed. Problem occured :-( What's missing is the last part of the RRA 
definition, 600 is what I use, and the data source itself - somethng 
like DS:temp:GAUGE:600:U:U in my case.)

As I noticed that only after I already had some rrds created without any 
problems, I simply copied the relevant stuff from the log to the shell, 
added the missing elements from an earlier log entry, and thus created 
the rrd by hand. Afterwards, data collection worked fine.

> And digging a bit around in collect2.pl is puzling as I can't
> find how $step is filled there either. But I noticed that $step is being
> undefined between the actual creation of the RRD's and the log lines which
> makes the logging less acurate:
> 
>                 # Create the RRD
>                 # $step = $default_step;
> 
>                 RRDs::create( $file, "--step", $step, @system );
>                 $step = undef;

Looks like some nonsense to me... Have you tried commenting that away?

>                 if($opt_verbose & $LOG_RRD_STATUS) {
>                         $dummy="";
>                         foreach (@system) {
>                                 $dummy.=$_. ' ';
>                         }
>                         print_log("RRD: rrdtool create $file --step=$step $dummy");
>                 }
> 
>                 $rrd_err = RRDs::error;
> 
> collect2.pl filestamp:
> # $Id: collect2.pl 885 2005-07-12 13:54:36Z gmueller $

Mine is identical, but I modified it a little... mostly cosmetic stuff, 
but IIRC I fixed some other stuff, too.

If you're interested, I could mail it to you. Unfortunately, it seems 
that I managed to delete the original version, so I'll have to restore 
it from a backup... once I recall where I'll have to look for the file.

Arno

> Hugo.
> 

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