Page 1 of 1

Macros not being translated with service perf data

Posted: Wed Jul 28, 2010 3:52 pm
by jmichalicek
I have just installed Nagios 3 and NagiosGrapher from the Ubuntu 10.04 LTS repository. So far everything is working except for the macros in the nagios grapher specific commands. The command definition is as follows:

Code: Select all

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
}
The above command is used for my service_perfdata_file_processing_command. It reads the performance data and sends it to a named pipe that nagiosgrapher uses.

Code: Select all

service_perfdata_file_processing_command=ngraph-process-service-perfdata-pipe
This command executes, but for some reason the macros are not being translated into the actual values by Nagios. I have not been able to find any reason for this to not work. I have verified that these macros are available for service performance data, I've completely retyped it multiple times, I've tried single quotes, double quotes, and unquoted (single quotes are how it comes from the repository).

If I put literal values in rather than the macros then it works and they get processed appropriately.

I'm all out of ideas here. Any suggestions?

Re: Macros not being translated with service perf data

Posted: Wed Jul 28, 2010 6:08 pm
by jmichalicek
Nevermind, I figured it out. I'll leave the solution here in case someone else runs into the same issue since there doesn't seem to be any official documentation for this.

It turns out that the command needs to be used for the service_perfdata_command value and not the service_perfdata_file_processing_command if you are using the Nagios and NagiosGrapher installs from the Ubuntu 10.04 LTS repository.

Code: Select all

service_perfdata_command=ngraph-process-service-perfdata-pipe