Page 1 of 1

Nagios status information

Posted: Fri Jul 19, 2013 2:54 am
by y.h
I am working on a project that has my computer communicating with an arduino board that reads the sensor output and test it in a C plugin ( http://stackoverflow.com/questions/1767 ... on-it?lq=1) for nagios. My problem is that the status information is always null. My plugin is in the lib"/usr/local/nagios/libexec" In commands.cfg I added the following:

Code: Select all

define command{
    command_name    arduino_temp_sensor
    command_line    /usr/local/nagios/libexec/essai.c
    }
And in the localhost.cfg I added the following:

Code: Select all

define service{
        use                             generic-service         
        host_name                       localhost
        service_description             Temp
        check_command                   arduino_temp_sensor
        }
I'm confused if the output of the printf should appear in the status information or not. Thanks in advance:D.

Re: Nagios status information

Posted: Fri Jul 19, 2013 1:24 pm
by abrist
Does it run from the cli?

Code: Select all

/usr/local/nagios/libexec/essai.c
I doubt it will run as it is an uncompiled c program (at least that is what *.c usually implies).

Re: Nagios status information

Posted: Sat Jul 20, 2013 6:33 am
by y.h
Yes it runs normally.

Re: Nagios status information

Posted: Mon Jul 22, 2013 9:27 am
by slansing
Can you show us example output of the plugin? And a copy of it so we can look at it's format? I don't believe what you linked above is the actual plugin correct?

Re: Nagios status information

Posted: Tue Jul 23, 2013 2:49 am
by y.h
It works when I removed .c.

Re: Nagios status information

Posted: Tue Jul 23, 2013 2:57 pm
by lmiltchev
Great, I am glad your issue has been resolved!