Nagios.cmd file not able to be accessed

Robert Bowman rhbowman at gmail.com
Fri Jul 6 14:45:33 CEST 2007


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 with the wrong permissions and the file gets
locked because I cannot even "tail" or "nano" the file. (vi does not work
either)

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. *

**

** *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# 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#*
*
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*
**
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*<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*<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*<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*<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.
**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070706/072ae204/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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/
-------------- next part --------------
_______________________________________________
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