Stumper? bug? nsca daemon & ext. cmd. file -- not a permission issue?
Giedrius Astrauskas
gastrauskas at burrelles.com
Wed Jan 15 18:44:31 CET 2003
Re: [Nagios-users] Stumper? bug? nsca daemon & ext. cmd. file -- not a permission issue?I have found comments in nsca.c code that nsca started with option -d is running as "multi process daemon" and started with option -s as "single process daemon".
Further in the comments in code there are references to multi process daemon as being "older style".
So I am running nsca with option -s
Can anybody explain what is really a difference between the two options?
Thanks.
Giedrius
----- Original Message -----
From: Marc Powell
To: kehr02 at yahoo.com ; nagios-users at lists.sourceforge.net
Sent: Wednesday, January 15, 2003 7:48 AM
Subject: Re: [Nagios-users] Stumper? bug? nsca daemon & ext. cmd. file -- not a permission issue?
According to your ps output below, nsca is running as user nsca, not the user nagios and therefor does not have permission to write to the command file. Either start nsca as the nagios user or add nsca to the nagios group in /etc/group and restart nsca.
--
Marc
Sent from a very tiny wireless device with a very tiny unlit keyboard.
-----Original Message-----
From: Karl Ehr <kehr02 at yahoo.com>
To: Marc Powell <mpowell at ena.com>; nagios <nagios-users at lists.sourceforge.net>
Sent: Wed Jan 15 02:13:42 2003
Subject: RE: [Nagios-users] Stumper? bug? nsca daemon & ext. cmd. file -- not a permission issue?
Sorry -- had to put this project down for a few
days... Well it's not an issue with the trailing space
(I wish it had been that easy!)
I'm still stuck, but you're question about whether
nsca is running out of inetd or a daemon made me
realize I was running in -s (single) rather than -d
(daemon) mode. I 've fixed that:
nsca 24583 0.0 0.1 1596 668 ? S
02:56 0:00 /usr/local/nagios/bin/nsca -d -c
/usr/local/nagios/etc/nsca.cfg
...But now I get this error in syslog:
Jan 15 03:09:31 sf1nmc1 nsca[24645]: Handling the
connection...
Jan 15 03:09:32 sf1nmc1 nsca[24645]: SERVICE CHECK ->
Host Name: 'laptop', Service Description: 'BOGUS',
Return Code: '2', Output: 'Error Message goes here'
Jan 15 03:09:32 sf1nmc1 nsca[24645]: Could not open
command file '/scale8/nagios/var/rw/nagios.cmd' for
writing
Jan 15 03:09:32 sf1nmc1 nsca[24645]: End of
connection...
Notice the "Could not open" -- This would make it
*seem* more like a permission issue... but honestly,
everyting with the CGI's and echoing directly to the
command file works just fine (as the nagios user, and
as the apache user). Here is my "rw" directory:
[root at XXXX root]# ls -la /usr/local/nagios/var/rw/
total 8
drwxrwsr-x 2 nagios nagios 4096 Jan 15
02:57 .
drwxrwxr-x 4 nagios nagios 4096 Jan 15
03:11 ..
prw-rw---- 1 nagios nagios 0 Jan 15
02:57 nagios.cmd
-rw-r--r-- 1 nagios nagios 0 Jan 7
10:26 nsca.dump
Any other ideas?
Thanks for you help.
--- Marc Powell <mpowell at ena.com> wrote:
> I don't know if it's just a display issue or not but
> this line caught my
> eye:
>
> Jan 7 08:27:38 XXXX nsca[8827]: Command file
> '/usr/local/nagios/var/rw/nagios.cmd '
>
> Note the '<space>' after nagios.cmd. Just seems kind
> of odd to me that
> that would be there. Other than that, does nsca run
> out of (x)inetd or
> as a daemon? For our sake could you do the following
> and resend to the
> list?
>
> ls -la /usr/local/nagios/var/rw
> ps -efwww | grep nsca
>
> Thanks,
>
> Marc
>
> > -----Original Message-----
> > From: Karl Ehr [mailto:kehr02 at yahoo.com]
> > Sent: Tuesday, January 07, 2003 9:03 AM
> > To: nagios
> > Subject: [Nagios-users] Stumper? bug? nsca daemon
> & ext. cmd. file --
> not
> > a permission issue?
> >
> > I have a hacker challenge -- maybe...
> >
> > I've read the phobic posts about Red Hat 8.0, but
> I
> > haven't seen anything that looks like my problem,
> RH
> > 8.0 or otherwise:
> >
> > My problem is that the nsca daemon, when handling
> a
> > remote network request from send_nsca, gives the
> > following error:
> >
> >
> > Jan 7 08:27:38 XXXX nsca[8827]: Handling the
> > connection...
> > Jan 7 08:27:38 XXXX nsca[8827]: SERVICE CHECK ->
> Host
> > Name: 'laptop', Service Description: 'BOGUS',
> Return
> > Code: '2', Output: 'Error Message goes here'
> > Jan 7 08:27:38 XXXX nsca[8827]: Command file
> > '/usr/local/nagios/var/rw/nagios.cmd ' does not
> exist,
> > attempting to use alternate dump file
> > '/usr/local/nagios/var/rw/nsca.dump' for output
> > Jan 7 08:27:38 XXXX nsca[8827]: Could not open
> > alternate dump file
> > '/usr/local/nagios/var/rw/nsca.dump' for appending
> > Jan 7 08:27:38 XXXX nsca[8827]: End of
> connection...
> >
> > I've configured the user/group for both nagios and
> the
> > nsca daemons to be 'nagios/nagios'. All of
> > /usr/local/nagios is user/group nagios.nagios.
> The
> > permissions are correct (I'm 99%) sure, because
> all of
> > the external command CGI's work perfectly; also,
> su-ed
> > to the nagios user, I can echo commands >> to the
> > /usr/local/nagios/var/rw/nagios.cmd file and they
> show
> > up fine both in the log and in the web
> interface....
> >
> > I have tried compiling the 1.06b and 1.0 versions
> of
> > nagios, the 2.1 and latest CVS build of nsca,
> > mix-matching them in all combinations. I have
> set
> > the permissions on the "rw" directory both by hand
> > (setting the group, the S bit on the group level,
> > etc...) and with the "install-commandmode" make
> > option; I've also tried chmoding the file with
> "chmod
> > 777" after it gets created when nagios starts and
> > there is the same error.
> >
> > The fact that I can echo commands in locally as
> the
> > "nagios" user and get good results seems to
> probably
> > show that its neither a permissions issue or
> anything
> > with the passive/external command interface.
> Maybe
> > this is a bug with nsca itself?
> >
> > As an aside, I cannot get the alternate dump file
> to
> > work either. Touching the nagios.dump file ahead
> of
> > time, and setting wide open permissions makes no
> > difference. (I'm assuming that the dump file is
> > supposed to be a regular text file -- not a FIFO
> named
> > pipe like the command file, right??)
> >
> > I'm stumped... but I'm also surprised that I'm
> seeing
> > something that hasn't popped up for someone else
> > already. Any help will bring you praise, beer,
> pizza,
> > cookies or whatever tithe you demand. TIA,
> >
> > Karl
> >
> > __________________________________________________
> > Do you Yahoo!?
> > New DSL Internet Access from SBC & Yahoo!
> > http://sbc.yahoo.com
> >
> >
> >
>
-------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld
> = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/nagios-users
>
>
>
-------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld =
> Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/nagios-users
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030115/ce59af1f/attachment.html>
More information about the Users
mailing list