Re: FreeBSD and Nagios - permissions

2008-10-17 Thread Per olof Ljungmark
Jeremy Chadwick wrote: You get the point now, I'm sure. Hi, just to say a big thank you to the people on the list for keeping up with my dumb questions on sudo, this morning I re-read the manual and got it working within minutes. I'm still not convinced that sudo is the way to go in our

FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Hi, I'm implementing a shell script as a Nagios plugin to check the status of the ciss(4) driver. However, there is a permission problem that I am not sure about the best way to get around in FreeBSD (7-STABLE). The nrpe daemon that handles the script runs as the nagios user and the command

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Jeremy Chadwick
On Thu, Oct 16, 2008 at 09:32:02AM +0200, Per olof Ljungmark wrote: Hi, I'm implementing a shell script as a Nagios plugin to check the status of the ciss(4) driver. However, there is a permission problem that I am not sure about the best way to get around in FreeBSD (7-STABLE). The nrpe

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Ivailo Tanusheff
(Bulgaria) AD Per olof Ljungmark [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 16.10.2008 10:52 To freebsd-questions@freebsd.org cc Subject FreeBSD and Nagios - permissions Hi, I'm implementing a shell script as a Nagios plugin to check the status of the ciss(4) driver. However

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Daniel Bye
On Thu, Oct 16, 2008 at 01:04:52AM -0700, Jeremy Chadwick wrote: On Thu, Oct 16, 2008 at 09:32:02AM +0200, Per olof Ljungmark wrote: The nrpe daemon that handles the script runs as the nagios user and the command needed is camcontrol: camcontrol inquiry da0 The nagios user does not

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Jeremy Chadwick
On Thu, Oct 16, 2008 at 09:17:58PM +1100, Edwin Groothuis wrote: The nrpe daemon that handles the script runs as the nagios user and the command needed is camcontrol: First lines of the check_ciss.sh command: #!/bin/sh if [ $(whoami) != root ]; then sudo $* fi

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Daniel Bye
On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only exactly the required command (including arguments) precisely to guard against this type of abuse - I use it extensively in my own nagios setup. This Cmnd_Alias in sudoers will do the

FreeBSD and Nagios - permissions

2008-10-16 Thread Edwin Groothuis
The nrpe daemon that handles the script runs as the nagios user and the command needed is camcontrol: First lines of the check_ciss.sh command: #!/bin/sh if [ $(whoami) != root ]; then sudo $* fi And allow in sudoerrs.conf the nagios user to run the check_ciss.sh

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only exactly the required command (including arguments) precisely to guard against this type of abuse - I use it extensively in my own nagios setup. This Cmnd_Alias in sudoers

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only exactly the required command (including arguments) precisely to guard against this type of abuse - I use it extensively in my own nagios setup.

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Mel
On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only exactly the required command (including arguments) precisely to guard

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Mel wrote: On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only exactly the required command (including arguments) precisely to guard

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Mel
On Thursday 16 October 2008 23:36:51 Per olof Ljungmark wrote: Mel wrote: On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: snip nagios ALL=(root) NOPASSWD:

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Jeremy Chadwick
On Thu, Oct 16, 2008 at 11:36:51PM +0200, Per olof Ljungmark wrote: Mel wrote: On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to configure sudo to run only

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Mel wrote: On Thursday 16 October 2008 23:36:51 Per olof Ljungmark wrote: Mel wrote: On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: snip nagios ALL=(root) NOPASSWD:

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Per olof Ljungmark
Jeremy Chadwick wrote: On Thu, Oct 16, 2008 at 11:36:51PM +0200, Per olof Ljungmark wrote: Mel wrote: On Thursday 16 October 2008 22:07:43 Per olof Ljungmark wrote: Per olof Ljungmark wrote: Daniel Bye wrote: On Thu, Oct 16, 2008 at 12:05:01PM +0100, Daniel Bye wrote: It is possible to