NSCA and Nagios
Braun Brelin
bbrelin at openapp.biz
Fri Mar 18 15:26:32 CET 2005
I'm not sure the documentation is clear on this point. From my
investigation, the command file is a named pipe. At least, on my system it
appears so:
[nagios at nagios rw]$ pwd
/usr/local/nagios/var/rw
[nagios at nagios rw]$ ls -l
total 0
prw-rw---- 1 nagios nagcmd 0 Mar 16 15:28 nagios.cmd
Also, according to the source code, in base/utils.c, there's a routine
called "open_command_file()" that will automatically perform a mkfifo()
(i.e. create a named pipe). This function gets called from the main
nagios.c routine on startup.
Therefore, I'm not sure I believe the documentation when it says it
"deletes" the file every time something gets written to it. Perhaps it's
the documentation that's obsolete.
Do you have permissions set correctly on the <nagios_base>/var/rw directory?
Braun Brelin
> I'm having a few problems with passive service monitoring with Nagios 2.0.
>
> First, NSCA and Nagios don't seem to work together. NSCA won't create the
> "command_file" if it doesn't exist and according to the Nagios
> documentation,
> Nagios will delete it every time it processes it (and I have seen it
> deleted
> before). This makes NSCA pretty much useless, since it writes all its
> logs to
> a "dump" file which nothing uses.
>
> Relevant notes related to this:
>
>>From the NSCA 2.4 source:
>
> /* command file doesn't exist - monitoring app probably isn't
> running...
> */
> if(stat(command_file,&statbuf)){
> ...
> return ERROR
> ...
> return OK
> }
>
>>From the Nagios 2.0 documentation:
> # EXTERNAL COMMAND FILE
> # This is the file that Nagios checks for external command requests.
> # It is also where the command CGI will write commands that are submitted
> # by users, so it must be writeable by the user that the web server
> # is running as (usually 'nobody'). Permissions should be set at the
> # directory level instead of on the file, as the file is deleted every
> # time its contents are processed.
>
> command_file=/data/monitor/nagios/var/rw/nagios.cmd
>
>
>
>
>
> So I modified the NSCA source to create the file if it doesn't exist (and
> not
> care whether or not it existed before, as well). It is now writing data
> to the
> command file, but nothing seems to reap it. The file has yet to be
> deleted and
> my passive service (which has updates in the command file) has not been
> processed by Nagios.
>
>
> Any ideas on what is wrong ?
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> 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
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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