Re: [Nagios-users] Could not opencommandfile '/usr/local/nagios/var/rw/nagios.cmd'

2008-05-26 Thread Daniel Bareiro
On Thursday, 22 May 2008 07:47:46 -0500,
Marc Powell wrote:

> > > ... or just set nagios_group in nagios.cfg to be nagcmd...

> > I liked this simpleness. But after restarting the Nagios server, this
> > doesn't work :-(

> Interesting... smells buglish.

> # grep nagios_group nagios.cfg
> nagios_group=nagios

> # ps -eo pid,user,rgroup,command | grep nagios

> 27347 nagios   nagios /usr/local/nagios/bin/nagios -d
> /usr/local/nagios/etc/nagios.cfg

> # vi nagios.cfg

> # grep nagios_group nagios.cfg
> nagios_group=nagcmd

> # /etc/init.d/nagios restart
> Running configuration check...done
> Stopping network monitor: nagios
> Waiting for nagios to exit . . done.
> Starting network monitor: nagios

> # ps -eo pid,user,rgroup,command | grep nagios

> 32016 nagios   nagcmd /usr/local/nagios/bin/nagios -d
> /usr/local/nagios/etc/nagios.cfg

> I see the change here -
> -rw-rw-r--1 nagios   nagcmd 829161 May 22 07:25 status.dat

> But not here -
> prw-rw1 nagios   nagios  0 May 22 07:26 nagios.cmd

I obtain a different result slightly:

sparky:/usr/local/nagios/var# ps -eo pid,user,rgroup,command | grep nagios
16830 nagios   nagcmd   /usr/local/nagios/bin/nagios -d 
/usr/local/nagios/etc/nagios.cfg
16831 nagios   nagcmd   /usr/local/nagios/bin/nagios -d 
/usr/local/nagios/etc/nagios.cfg
16832 nagios   nagcmd   /usr/local/nagios/bin/nagios -d 
/usr/local/nagios/etc/nagios.cfg

sparky:/usr/local/nagios/var# ll status.dat
-rw-rw-r-- 1 nagios nagios 286639 2008-05-26 11:08 status.dat

sparky:/usr/local/nagios/var/rw# ll nagios.cmd
prw-rw 1 nagios nagios 0 2008-05-26 10:58 nagios.cmd

Thanks for your reply.

Regards,
Daniel
-- 
Daniel Bareiro - System Administrator
Fingerprint: BFB3 08D6 B4D1 31B2 72B9  29CE 6696 BF1B 14E6 1D37
Powered by Debian GNU/Linux Lenny - Linux user #188.598


signature.asc
Description: Digital signature
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Nagios-users mailing list
[email protected]
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

Re: [Nagios-users] Could not opencommandfile '/usr/local/nagios/var/rw/nagios.cmd'

2008-05-22 Thread Marc Powell


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:nagios-users-
> [EMAIL PROTECTED] On Behalf Of Daniel Bareiro
> Sent: Wednesday, May 21, 2008 8:16 PM
> To: [email protected]
> Subject: Re: [Nagios-users] Could not opencommandfile
> '/usr/local/nagios/var/rw/nagios.cmd'
> 
> On Sunday, 18 May 2008 22:53:03 -0500,
> Marc Powell wrote:


> > ... or just set nagios_group in nagios.cfg to be nagcmd...
> 
> I liked this simpleness. But after restarting the Nagios server, this
> doesn't work :-(

Interesting... smells buglish.

# grep nagios_group nagios.cfg
nagios_group=nagios

# ps -eo pid,user,rgroup,command | grep nagios

27347 nagios   nagios /usr/local/nagios/bin/nagios -d
/usr/local/nagios/etc/nagios.cfg

# vi nagios.cfg

# grep nagios_group nagios.cfg
nagios_group=nagcmd

# /etc/init.d/nagios restart
Running configuration check...done
Stopping network monitor: nagios
Waiting for nagios to exit . . done.
Starting network monitor: nagios

# ps -eo pid,user,rgroup,command | grep nagios

32016 nagios   nagcmd /usr/local/nagios/bin/nagios -d
/usr/local/nagios/etc/nagios.cfg

I see the change here -
-rw-rw-r--1 nagios   nagcmd 829161 May 22 07:25 status.dat

But not here -
prw-rw1 nagios   nagios  0 May 22 07:26 nagios.cmd

I also see that in base/nagios.c that nagios drops privs to nagios_user
and nagios_group before calling open_command_file (which doesn't seem to
specify a specific group) so I would expect it to be group nagcmd.
Clearly I'm missing something. It's unintuitive behavior at the least
but it seems more than that IMHO. Can anyone test with a 3.x install?

--
Marc

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Nagios-users mailing list
[email protected]
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