Nagios.cmd file not able to be accessed

Arno Lehmann al at its-lehmann.de
Fri Jul 6 15:25:27 CEST 2007


Hello,

06.07.2007 14:45,, Robert Bowman wrote::
> Weird problem but I will do my best to explain it and the different 
> scenarios I created to try to use it. Essentially my belief is nagios 
> creates this file on startup

Right.

> with the wrong permissions

It's up to you to set the permission (in the configuration).

> and the file 
> gets locked because I cannot even "tail" or "nano" the file. (vi does 
> not work either)

This is not a regular file but a FIFO.

> System:
>  
> Ubuntu Dapper LTS Server
> Nagios 2.9
>  
>  
> The nagios.cmd file cannot be written to and I always get the error 
> through the nagios web interface as:
> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> *Error: Could not open command file 
> '/usr/local/nagios/var/rw/nagios.cmd' for update!*
> 
> **
> 
> **
> 
> *The permissions on the external command file and/or directory may be 
> incorrect. Read the FAQs on how to setup proper permissions. *

I can only recommend that line. In the manual is clearly described how 
to set up the command file.

> **
> 
> **
> 
> *An error occurred while attempting to commit your command for processing.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
>  
> So I check the file permissions and I show:
>  
> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> ** 
> *root at maverick:/usr/local/nagios/var/rw 
> <mailto:root at maverick:/usr/local/nagios/var/rw># ls -al
> total 0
> drwxrwsrwx 2 nagios nagios  80 2007-07-03 16:18 .
> drwxrwxrwx 4 nagios nagios 384 2007-07-06 08:35 ..
> prwxrws--- 1 nagios nagios   0 2007-07-03 16:18 nagios.cmd
> root at maverick:/usr/local/nagios/var/rw 
> <mailto:root at maverick:/usr/local/nagios/var/rw>#*

The file needs to be writably by whoever submits commands. Commonly 
this would be the group nagioscmd or something.

It's rather simple if you compile nagios yourself as the necessary 
settings are done with the configure script.

Arno


> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> ** 
> Those permissions are incorrect! Then to save ourselves any trouble I 
> just change the permissions to 777 and worry about the consequences 
> after I solve this problem.
>  
> Now I get this message issuing an external command:
> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> *Your command request was successfully submitted to Nagios for processing.
> 
> Note: It may take a while before the command is actually processed.*
> **-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> **
> ** 
> Now to show you where I run into the actual trouble. I restarted nagios 
> and it changed the permissions on the file.
>  
> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> *root at maverick:/usr/local/nagios/var/rw* 
> <mailto:root at maverick:/usr/local/nagios/var/rw>*# ls -al
> total 0
> drwxrwsrwx 2 nagios nagios  80 2007-07-03 16:18 .
> drwxrwxrwx 4 nagios nagios 384 2007-07-06 08:40 ..
> prwxrwxrwx 1 nagios nagios   0 2007-07-06 08:38 nagios.cmd
> **root at maverick:/usr/local/nagios/var/rw * 
> <mailto:root at maverick:/usr/local/nagios/var/rw>*# /etc/init.d/nagios restart
> Running configuration check...done
> Stopping nagios: done.
> Starting nagios: done.
> **root at maverick:/usr/local/nagios/var/rw * 
> <mailto:root at maverick:/usr/local/nagios/var/rw>*# ls -al
> total 0
> drwxrwsrwx 2 nagios nagios  80 2007-07-06 08:40 .
> drwxrwxrwx 4 nagios nagios 384 2007-07-06 08:40 ..
> prw-rw---- 1 nagios nagios   0 2007-07-06 08:40 nagios.cmd
> * *root at maverick:/usr/local/nagios/var/rw* 
> <mailto:root at maverick:/usr/local/nagios/var/rw>*#*
> *-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
> *
> ** 
> The file permissions are incorrect and seemingly nagios caused the 
> problem. Notice that the new file does not even have the same 
> permissions as the file it created before.
> ** 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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

-- 
Arno Lehmann
IT-Service Lehmann
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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