<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.60">
<TITLE>RE : [Nagios-users] Logged in as ? or Sorry, but you are not authorized to commit the specified command.</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Your problem is not related to the file permissions. As Mr Gosh told you, you must be a declared contact in order to issue a command against a given object. Or you must be listed in the authorized_for_all_*_commands parameter in cgi.cfg.</FONT></P>

<P><FONT SIZE=2>If you really want nagios to issue any command, put the following lines in your cgi.cfg :</FONT>
</P>

<P><FONT SIZE=2>authorized_for_all_service_commands=nagios</FONT>
<BR><FONT SIZE=2>authorized_for_all_host_commands=nagios</FONT>
<BR><FONT SIZE=2>authorized_for_system_commands=nagios</FONT>
</P>

<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: alexus [<A HREF="mailto:tmda@alexus.org">mailto:tmda@alexus.org</A>] </FONT>
<BR><FONT SIZE=2>> Sent: Tuesday, May 31, 2005 2:47 PM</FONT>
<BR><FONT SIZE=2>> To: 'Subhendu Ghosh'</FONT>
<BR><FONT SIZE=2>> Cc: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> Subject: RE: [Nagios-users] Logged in as ? or Sorry, but you </FONT>
<BR><FONT SIZE=2>> are not authorized to commit the specified command.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> My nagios.cmd have enough permition to be read and written by nobody</FONT>
<BR><FONT SIZE=2>> (apache) and nagios itself</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> # ls -ld ~nagios/var/rw/nagios.cmd </FONT>
<BR><FONT SIZE=2>> -rw-rw----  1 nagios  nobody  0 May 30 23:33 </FONT>
<BR><FONT SIZE=2>> /usr/local/nagios/var/rw/nagios.cmd</FONT>
<BR><FONT SIZE=2>> # ls -ld ~nagios/var/rw/</FONT>
<BR><FONT SIZE=2>> drwsr-sr-x  2 nobody  nagios  512 May 30 23:33 </FONT>
<BR><FONT SIZE=2>> /usr/local/nagios/var/rw/ #</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I loged in as "nagios"</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> It is only when I confirm an actual manual commmand it </FONT>
<BR><FONT SIZE=2>> changes myself as "Logged in as ?" and "Logged in as ? or </FONT>
<BR><FONT SIZE=2>> Sorry, but you are not authorized to commit the specified command."</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> at all other time it shows me "Logged in as nagios"</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>>  </FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Subhendu Ghosh [<A HREF="mailto:sghosh@sghosh.org">mailto:sghosh@sghosh.org</A>] </FONT>
<BR><FONT SIZE=2>> Sent: Monday, May 30, 2005 11:56 PM</FONT>
<BR><FONT SIZE=2>> To: alexus</FONT>
<BR><FONT SIZE=2>> Cc: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> Subject: RE: [Nagios-users] Logged in as ? or Sorry, but you </FONT>
<BR><FONT SIZE=2>> are not authorized to commit the specified command.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> file permissions should allow the web server process to write </FONT>
<BR><FONT SIZE=2>> and nagios </FONT>
<BR><FONT SIZE=2>> process to read.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> But before the data i actually written to the cmd file, the </FONT>
<BR><FONT SIZE=2>> authentication </FONT>
<BR><FONT SIZE=2>> code checks to see if you are allowed to do so.  If you are </FONT>
<BR><FONT SIZE=2>> logged in as </FONT>
<BR><FONT SIZE=2>> "?" then by default you are not allowed to send commands.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> If you want non-contacts to send commands, edit cgi.cfg and updated </FONT>
<BR><FONT SIZE=2>> "authorized_for_*_commands"</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> You have to login and authenticate in the web interface </FONT>
<BR><FONT SIZE=2>> before sending </FONT>
<BR><FONT SIZE=2>> commands.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> On Mon, 30 May 2005, alexus wrote:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > Once again..</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > My ~nagios/var/rw/nagios.cmd</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I even tried with 777. didn't help.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > What else I can try to get it to work? Is there a way to </FONT>
<BR><FONT SIZE=2>> run nagios in</FONT>
<BR><FONT SIZE=2>> debug</FONT>
<BR><FONT SIZE=2>> > mode where I can see what is happening and where the problem is?</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I even tried to use user nobody to write and read from/to </FONT>
<BR><FONT SIZE=2>> that file..</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> >  _____</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > From: Dan Davis [<A HREF="mailto:hokie99cpe@gmail.com">mailto:hokie99cpe@gmail.com</A>]</FONT>
<BR><FONT SIZE=2>> > Sent: Sunday, May 29, 2005 9:44 PM</FONT>
<BR><FONT SIZE=2>> > To: alexus</FONT>
<BR><FONT SIZE=2>> > Cc: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> > Subject: Re: [Nagios-users] Logged in as ? or Sorry, but </FONT>
<BR><FONT SIZE=2>> you are not </FONT>
<BR><FONT SIZE=2>> > authorized to commit the specified command.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > all files have nagios:nagios as their ownership/group..</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > ~nagios have 755 nagios:nobody</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Maybe that?</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Everything else looks ok... and the nagios home directory is not the</FONT>
<BR><FONT SIZE=2>> problem</FONT>
<BR><FONT SIZE=2>> > in and of itself... but the nagios.cmd file needs to be writable by </FONT>
<BR><FONT SIZE=2>> > your</FONT>
<BR><FONT SIZE=2>> web</FONT>
<BR><FONT SIZE=2>> > server user. Be sure of that and you should be good to go.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > -Dan</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -- </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> This SF.Net email is sponsored by Yahoo.</FONT>
<BR><FONT SIZE=2>> Introducing Yahoo! Search Developer Network - Create apps </FONT>
<BR><FONT SIZE=2>> using Yahoo! Search APIs Find out how you can build Yahoo! </FONT>
<BR><FONT SIZE=2>> directly into your own Applications - visit </FONT>
<BR><FONT SIZE=2>> <A HREF="http://developer.yahoo.net/?fr=offad-ysdn-" TARGET="_blank">http://developer.yahoo.net/?fr=offad-ysdn-</A>> ostg-q22005</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Nagios-users mailing list</FONT>
<BR><FONT SIZE=2>> Nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> <A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users" TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</A></FONT>
<BR><FONT SIZE=2>> ::: Please include Nagios version, plugin version (-v) and OS </FONT>
<BR><FONT SIZE=2>> when reporting any issue. </FONT>
<BR><FONT SIZE=2>> ::: Messages without supporting info will risk being sent to /dev/null</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

</BODY>
</HTML>