[solved] Nagios3 not passing everything to Nagiographer

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jakkul
Posts: 5
Joined: Mon Jun 30, 2014 5:46 am

[solved] Nagios3 not passing everything to Nagiographer

Post by jakkul »

Hi !

I've been successfully using Nagios with Nagiosgrapher for some time and wanted to add some more graphs to my checks. I use debian 7 and nagios version from debian apt repository.

The problem I face is that not everything that I've put into nagiosgrapher definitions gets drawn on the graphs. I've narrowed the thing down to passing stuff from nagios to nagiosgrapher. I've enabled debug output from nagiosgrapher to the file /var/log/nagiosgrapher/ngraph.log.

Service definition for something that works and gets drawn:

Code: Select all

define service {
        hostgroup_name          gpmv-nrpe
        use                     generic-service
        service_description     NRPE Load
        notification_interval           0 ; set > 0 if you want to be renotified
        check_command           check_nrpe_1arg!check_load
}
How it gets passed to nagiosgrapher:

Code: Select all

2014-06-30 11:36:42 PIPE: masterf       NRPE Load       OK - load average: 0.05, 0.03, 0.00     load1=0.050;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.000;5.000;20.000;0;
2014-06-30 11:36:42 VALUES: [masterf][NRPE Load]: load_average_1m=0.05
2014-06-30 11:36:42 RRD: rrdtool update /var/lib/nagiosgrapher/rrd/masterf/e65e1d4e20eddad6508ccbcb5d41136e.rrd --template=load_average_1m N:0.05
Service definition for something that does not show up in ngraph.log, but still works properly in nagios.

Code: Select all

define service {
        hostgroup_name          gpmv-nrpe-smart-sdab
        use                     generic-service
        service_description     NRPE smart sda
        notification_interval           0 ; set > 0 if you want to be renotified
        check_command           check_nrpe_1arg!check_smart_sda
}
this returns something like:

Code: Select all

OK: device is functional and stable (temperature: 22)
and does not leave any trace in ngraph.log

part of nagios.cfg that I find relevant:

Code: Select all

# PROCESS PERFORMANCE DATA OPTION
# This determines whether or not Nagios will process performance
# data returned from service and host checks.  If this option is
# enabled, host performance data will be processed using the
# host_perfdata_command (defined below) and service performance
# data will be processed using the service_perfdata_command (also
# defined below).  Read the HTML docs for more information on
# performance data.
# Values: 1 = process performance data, 0 = do not process performance data

process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=ngraph-process-service-perfdata-pipe


# HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
# These commands are run after every host and service check is
# performed.  These commands are executed only if the
# enable_performance_data option (above) is set to 1.  The command
# argument is the short name of a command definition that you
# define in your host configuration file.  Read the HTML docs for
# more information on performance data.

#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata



# HOST AND SERVICE PERFORMANCE DATA FILES
# These files are used to store host and service performance data.
# Performance data is only written to these files if the
# enable_performance_data option (above) is set to 1.

#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
Apart from this everything sort-of works. Checks are carried out, I can see the results, notifications are getting sent out.

What should I look into?
Last edited by jakkul on Wed Jul 02, 2014 5:13 am, edited 1 time in total.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios3 not passing everything to Nagiographer

Post by abrist »

Can you post the two following commands?

Code: Select all

process-host-perfdata
ngraph-process-service-perfdata-pipe
Are these brand new checks, or did you alter pre-existing ones?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jakkul
Posts: 5
Joined: Mon Jun 30, 2014 5:46 am

Re: Nagios3 not passing everything to Nagiographer

Post by jakkul »

Code: Select all

define command{
        command_name    process-host-perfdata
        command_line    /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios3/host-perfdata.out
        }


define command{
        command_name ngraph-process-service-perfdata-pipe
        command_line /usr/lib/nagiosgrapher/fifo_write /var/lib/nagiosgrapher/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n' 3
}
taken from a few different files, but both get run as needed apart from the case mentioned before. The file host-perfdata.out gets filled up, ngraph.log shows data travelling through the pipe. It looks like for some reason "NRPE smart sda" does not get passed to nagiosgrapher.

I've configured it basing on some debian generic tutorials. The command definitions come from debian packages.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios3 not passing everything to Nagiographer

Post by abrist »

Just a heads up - Nagiosgrapher has been mostly dead for years. The website has been gone for quite sometime, including the mailing lists and forums - all that remains is the sourceforge page. Most people these days are using pnp4nagios.

Is nagiosgrapher a requirement? Is changing to pnp4nagios a possibility?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jakkul
Posts: 5
Joined: Mon Jun 30, 2014 5:46 am

Re: Nagios3 not passing everything to Nagiographer

Post by jakkul »

Hey, I'll try pnp4nagios. It seems quite easy to set up, if my first glance at the docs does not deceive me.

I think I know what the cause of my problem is. It looks like that if a service does not provide performance data - as MDADM checks or SMART HDD checks - these checks will not be passed to nagiosgrapher. The difference is visible in Nagios itself in the "performance data" field on the service extended info screen.

Now I know where to look, thanks for the help!
jakkul
Posts: 5
Joined: Mon Jun 30, 2014 5:46 am

[solved] Re: Nagios3 not passing everything to Nagiographer

Post by jakkul »

ok, solved.

I went with Nagiosgrapher. I've chaged the smart monitoring plugin to http://exchange.nagios.org/directory/Pl ... ed/details . Now I get necessary perf data, adapted Nagiosgraper config and voila. Done.
Locked