/usr/local/nagios/var/rw/nagios.cmd

Fernando Gomes Lima flima at slb.com
Wed Jun 18 16:30:24 CEST 2003


Guys,

I note that has a lot of people having some issues with nagios.cmd

Here is the link of documentation (nagios site) with step by step of how to!

http://nagios.sourceforge.net/docs/1_0/commandfile.html

Here is an little script that we create to restart nagios when it's
necessary

[root at host bin]# more nagios-restart
rm -f /usr/local/nagios/var/rw/nagios.cmd
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

For those that can't access Internet, follow the instructions bellow

I hope that helps!

Fernando Gomes
SchlumbergerSema
Network & Infrastructure Solutions
Security Engineer
flima at slb.com

Trab: +55 21 3824 6954
Cel. : +55 21 9888 9046
(GMT: -03:00)

"Share knowledge is the best way to increase your own..."

Users and Groups

First, find the user that your web server process is running as. On many
systems this is the user nobody, although it will vary depending on what
OS/distribution you are running. You'll also need to know what user Nagios
is effectively running as - this is specified with the nagios_user variable
in the main config file.

Next we're going to create a new group whose members include the user the
web server is running as and the user Nagios is running as. Let's say we
call this new group 'nagiocmd' (you can name it differently if you wish). On
RedHat Linux you can use the following command to add a new group (other
systems may differ):

/usr/sbin/groupadd nagiocmd

Next, add the web server user (nobody or apache, etc) and the Nagios user
(nagios) to the newly created group with the following commands:

/usr/sbin/usermod -G nagiocmd nagios
/usr/sbin/usermod -G nagiocmd nobody

Creating the directory

Next, create the directory where the command file should be stored. By
default, this is /usr/local/nagios/var/rw, although it can be changed by
modifying the path specified in thecommand_file directory.

mkdir /usr/local/nagios/var/rw

Setting directory permissions

Next, change the ownership of the directory that will be used to hold the
command file...

chown nagios.nagiocmd /usr/local/nagios/var/rw

Make sure the Nagios user has full permissions on the directory...

chmod u+rwx /usr/local/nagios/var/rw

Make sure the group we created has full permissions on the directory.

chmod g+rwx /usr/local/nagios/var/rw

In order to force newly created files in the directory to inherit the group
permissions from the directory, we need to enable the group sticky bit on
the directory...

chmod g+s /usr/local/nagios/var/rw

Verifying the permissions

Check the permissions on the rw/ subdirectory by running 'ls -al
/usr/local/nagios/var'. You should see something similiar to the following:


drwxrws---   2 nagios nagiocmd     1024 Aug 11 16:30 rw


Note that the user nagios is the owner of the directory and the group
nagiocmd is the group owner of the directory. The nagios user has rwx
permissions and group nagiocmd has rw permissions on the directory. Also,
note that the group sticky bit is enabled. That's what we want...

Restart your web server

Once you set the proper permission on the directory containing the external
command file, make sure to restart your web server. If you fail to do this,
Apache will not be able to write to the external command file, even though
the user it runs as is a member of the nagiocmd group.







-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of Kreig
Dubose
Sent: quarta-feira, 18 de junho de 2003 10:04
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] /usr/local/nagios/var/rw/nagios.cmd


I'm having some considerable difficulties with this file.  Basically
everytime I restart nagios it's permissions get reset and host comments and
passive info quit working.   The only way I've found to make it work is by
changing perms to 777 (Which I don't like doing anyways).  Am I missing
something here ?

prwxrwxrwt    1 nagios   nagios          0 Jun 18 12:59 nagios.cmd

Nagios 1.0
2.4.7-10smp #1 SMP


TIA,
Kreig



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
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



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
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