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 particu

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 conf

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: nagios ALL=(root) NOPASSWD: NAGIOS_

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 configur

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: > nagios ALL=(root) NOPASS

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 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) precise

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 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 w

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

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 > su

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

Re: FreeBSD and Nagios - permissions

2008-10-16 Thread Ivailo Tanusheff
I think the problem is with the permisions of the specific user. The way to get over it is to use sudo and configure it to allow the nagios user execute camcontrol. This way the line should be : sudo camcontrol inquiry da0 Regards, Ivailo Tanusheff Deputy Head of IT Department ProCredit Bank (B

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