how to setup nagiosgrapher correctly

Harald Friessnegger harald at webmeisterei.com
Tue Oct 7 22:34:15 CEST 2008


hi nagios users

i'm having problems getting nagiosgrapher to work with my Nagios Version
3.0.2 on my debian etch box.


the graphs are not shown.
instead i get an image with the following error message::

  RRD Error: No DS called ´mailq´ in ´...nagios/var/rdd/<host>/2514.rrd´
  Options:
    -cBACK#ffffff
  ...
  Values:
    DEF:mailq=...nagios/var/rdd/<host>/2514.rrd:mailq:AVERAGE
  ...


in ngraph.log i can see that the servicedata can't be extracted correctly:

  2008-10-05 14:17:53 collect2.pl: Got signal: Use of uninitialized value in
regexp compilation at /usr/local/nagios/contrib/perl/NagiosGrapher.pm line
780, <FIFO> line 1.
  ...
  2008-10-05 14:17:53 PRG: error, Inappropriate ioctl for device
  2008-10-05 14:17:53 collect2.pl: Got signal: Use of uninitialized value in
substitution (s///) at /usr/local/nagios/contrib/collect2.pl line 383,
<FIFO> line 1.


looks like the  service_name variable is not set so the regex can't be
compiled.
(this is line 780 in NagiosGrapher.pm)::

  @out = grep $service =~ m/$_->{service_name}/i, @out
    if ( defined($service) );


any hints what's wrong with my setup?

i'd also appreciate any hint on how to use a self-compiled version of
rrdtool (eg under /opt/rddtool/bin/rrdtool)
since ngrapher should be used with the most recent version available (1.3.4)
and my systems version is 1.2.15.
i tried "rddtool /opt/rrdtool-1.3.4/bin/rrdtool" in ngraph.ncfg. but i guess
this should be defined when calling autoconf or configure in step 2 below
so the correct binary is used in rrd2-graph.cgi



here are the steps i followed for setting up ngrapher:

1) download NagiosGrapher-1.6.1-rc5-0.5.tar.gz from
https://www.nagiosforge.org/gf/project/nagiosgrapher/

2) untar and follow doc/INSTALL (autoconf, configure, make testdeps, make
install)

3) added cfg_dir=/usr/local/nagios/etc/serviceext to nagios.cfg
since i want a separate config file for each host (Serviceexttype, MULTIPLE)

4) changed the following variables in nagios.cfg::

  process_performance_data=1
  service_perfdata_command=process-service-perfdata

and added the new command to etc/objects/commands.cfg::

  define command{
    command_name process-service-perfdata
   
command_line /usr/local/nagios/contrib/fifo_write /usr/local/nagios/var/rw/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n'
3
  }

5) uncomment out step  and set it to 300 in ngraph.ncfg

(suggested in
http://www.nagios-portal.org/wbb/index.php?page=Thread&threadID=9523 at the
bottom)



6) start nagios_grapher and restart nagios.

i can see that ngrapher starts to collect data, and hands it over to rrd in
`/usr/local/nagios/var/ngraph.log`

ngrapher also writes serviceextensions for my hosts
to /usr/local/nagios/etc/serviceext/
and there is data for each host in /usr/local/nagios/var/rrd/

7) restarting nagios to make the graph icons appear in the webinterface


regards, fRiSi

-- 
Webmeisterei GmbH - Büro für Netzfragen
Tel: +43 5572 908877,  Fax: +43 5572 908877-66
Schmelzhütterstraße 26a, A-6850 Dornbirn
http://www.webmeisterei.com


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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