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