okay so here is my output:<br>
<br>
in my httpd.conf file I have:<br>
<br>
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"<br>
<br>
<Directory "/usr/local/nagios/sbin"><br>
# SSLRequireSSL<br>
Options ExecCGI<br>
AllowOverride AuthConfig<br>
Order allow,deny<br>
Allow from all<br>
# Order deny,allow<br>
# Deny from all<br>
# Allow from <a href="http://127.0.0.1">127.0.0.1</a><br>
AuthName "Nagios Access"<br>
AuthType Basic<br>
AuthUserFile /usr/local/nagios/etc/htpasswd.users<br>
Require valid-user<br>
</Directory><br>
<br>
Alias /nagios "/usr/local/nagios/share"<br>
<br>
<Directory "/usr/local/nagios/share"><br>
# SSLRequireSSL<br>
Options None<br>
AllowOverride AuthConfig<br>
Order allow,deny<br>
Allow from all<br>
# Order deny,allow<br>
# Deny from all<br>
# Allow from <a href="http://127.0.0.1">127.0.0.1</a><br>
AuthName "Nagios Access"<br>
AuthType Basic<br>
AuthUserFile /usr/local/nagios/etc/htpasswd.users<br>
Require valid-user<br>
</Directory><br>
#<br>
<br>
Where is my problem for not being able to execute external commands or schedule downtime for a host?<br><br><div><span class="gmail_quote">On 8/1/06, <b class="gmail_sendername">Deborah Martin</b> <<a href="mailto:Deborah.Martin@kognitio.com">
Deborah.Martin@kognitio.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<div vlink="blue" link="blue" lang="EN-GB">
<div><span><font color="#0000ff" face="Arial" size="2">actually you can use .htaccess or the httpd.conf file it doesn't matter.
If you put in the httpd.conf you have to restart apache - not always convenient
to </font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2">do
that. But using .htaccess means you don't have to do that and can simply add
this file into the locations required with immediate effect.
</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">Also,
htpasswd(2) does as you say come with apache but it has been known to be
included with Nagios! </font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<blockquote style="margin-right: 0px;" dir="ltr"></blockquote></div><div><span class="q">
<div align="left" dir="ltr"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> Martin J. Green
[mailto:<a href="mailto:mgreen@altien.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mgreen@altien.com</a>]<br><b>Sent:</b> 01 August 2006 15:36<br><b>To:</b>
Deborah Martin; Justin Craig<br><b>Cc:</b> Hari Sekhon;
<a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net</a><br><b>Subject:</b> RE: [Nagios-users]
Externals Commands<br><br></font></div>
</span></div><div><div></div><div><span class="q">
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">The .htaccess is only
required if you don't have root access to the server & thus can't add it
to the main httpd.conf. If you have root access, its almost always better to
add it there. In that case you would have no .htaccess file, it would all be
in the server config.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">M</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;"> </span></font></p>
</span></div><div><div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US">
<hr align="center" size="2" width="100%">
</span></font></div></div><div><span class="q">
<p><b><font face="Tahoma" size="2"><span style="font-weight: bold; font-size: 10pt; font-family: Tahoma;" lang="EN-US">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
Deborah Martin
[mailto:<a href="mailto:Deborah.Martin@kognitio.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Deborah.Martin@kognitio.com</a>] <br><b><span style="font-weight: bold;">Sent:</span></b> 01 August 2006 15:32
<br><b><span style="font-weight: bold;">To:</span></b> 'Justin Craig'<br><b><span style="font-weight: bold;">Cc:</span></b> Hari Sekhon; Martin J. Green;
<a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net</a><br><b><span style="font-weight: bold;">Subject:</span></b>
RE: [Nagios-users] Externals
Commands</span></font><span lang="EN-US"></span></p></span></div><div></div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<div>
</div><div><span class="q"><p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">ok - somewhere in the
nagios docs are the details with regard to setting up .htaccess but
</span></font></p></span></div><div></div></div><div><span class="q">
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">I think there is a
utility in the nagios install directory under bin called htpasswd or htpasswd2
and you run this util to generate a htpasswd.users file
where</span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">all the users that
have web interface access are stored including nagiosadmin. I store mine in
the etc install directory. </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">Then in my .htaccess
file i have the following </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">AuthName "Nagios
Access"<br>AuthType Basic<br>AuthUserFile
/usr/local/nagios/etc/htpasswd.users<br>require
valid-user</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
</span></div><div><div>
</div><div><span class="q"><p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">This file resides in
the sbin directory (which is also cgi-bin). Note though - change the
AuthUserFile path to wherever you are storing the htpasswd.users file.
</span></font></p></span></div><div></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
</div><div><span class="q"><p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">When i was getting
the 'return from whence you came error', this was exactly my problem - i
hadn't set up authorisation correctly and the above was how i fixed it.
</span></font></p></span></div><div></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">hope this helps.
</span></font></p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<p style="margin-bottom: 12pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">-----Original
Message-----<br><b><span style="font-weight: bold;">From:</span></b> Justin
Craig [mailto:<a href="mailto:jrcraig.email@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jrcraig.email@gmail.com</a>]<br><b><span style="font-weight: bold;">Sent:</span></b> 01 August 2006 15:07
<br><b><span style="font-weight: bold;">To:</span></b> Deborah Martin</span></font></p></blockquote></div><div><span class="q"><font face="Tahoma" size="2"><br><b><span style="font-weight: bold;">Cc:</span></b> Hari Sekhon; Martin J. Green;
<a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net</a><br></font></span></div><div><span class="q"><font face="Tahoma" size="2">
<b><span style="font-weight: bold;">Subject:</span></b> Re: [Nagios-users] Externals
Commands</font></span></div><div><p></p></div><div><span class="q">
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">so obviously I RTFM or I wouldn't have got this
far. One part that I did have questions of was the .htaccess creation,
as the documentation I read only provided information for setting up
users via htpasswd -c and changing your authorization functionality in the
CGI's to 1. </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">So I did a find / -name *.htaccess* and that file
doesn't exist. Sounds like I need
one?</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Sorry, there isn't anything in my /var/www/cgi-bin
directory </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Is there something missed
here?<br><br> </span></font></p></div>
</span></div><div><div></div><div><span class="q">
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">On 8/1/06, <b><span style="font-weight: bold;">Deborah Martin</span></b> <<a href="mailto:Deborah.Martin@kognitio.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Deborah.Martin@kognitio.com</a>>
wrote:</span></font></span> </p>
</span></div><div><div></div><div><span class="q">
<div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">can you forward the
contents of the .htaccess file that resides in the cgi-bin directory ?
and a listing of the rest of the directory including the
permissions</span></font> </p></div></div>
</span></div><div><div><span>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<p style="margin-bottom: 12pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"></span></font></p></blockquote></span></div><div><span class="q"><font face="Tahoma" size="2">-----Original
Message-----<br><b><span style="font-weight: bold;">From:</span></b> Justin
Craig [mailto:<a href="mailto:jrcraig.email@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jrcraig.email@gmail.com</a>]<br><b><span style="font-weight: bold;">Sent:</span></b> 01 August 2006
14:46<br><b><span style="font-weight: bold;">To:</span></b> Deborah
Martin<br></font></span></div><div><span class="q"><font face="Tahoma" size="2"><b><span style="font-weight: bold;">Cc:</span></b> Hari Sekhon;
Martin J. Green; <a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net</a><br></font></span></div><div><span class="e" id="q_10cca3651415215e_26">
<font face="Tahoma" size="2"><b><span style="font-weight: bold;">Subject:</span></b> Re: [Nagios-users] Externals
Commands</font></span></div><div><p></p></div><div><span class="e" id="q_10cca3651415215e_28">
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">i'm logged in as nagiosadmin and i have that
username in all my cgi's. I have the sameissue, can't schedule
downtime or issue external commands with the same error. I'm running
nagios 2.4<br><br> </span></font></p></div>
</span></div><div><div></div><div><span class="e" id="q_10cca3651415215e_30">
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">On 8/1/06, <b><span style="font-weight: bold;">Deborah Martin</span></b> <<a href="mailto:Deborah.Martin@kognitio.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Deborah.Martin@kognitio.com </a>>
wrote:</span></font></span> </p>
<div>
<div text="#000000" bgcolor="#ffffff">
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">look at your
/usr/local/nagios/sbin directory and check a) file permissions are correct
and also whether your .htaccess authrization file is present.
</span></font></p></div>
<div>
<p><font color="blue" face="Arial" size="2"><span style="font-size: 10pt; color: blue; font-family: Arial;">This error is
generally caused by not correctly using .htaccess and also not configuring
apache properly - check your httpd.conf is correctly
configured</span></font> </p></div></div>
<div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<p style="margin-bottom: 12pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">-----Original
Message-----<br><b><span style="font-weight: bold;">From:</span></b> Hari
Sekhon [mailto:<a href="mailto:hpsekhon@googlemail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
hpsekhon@googlemail.com</a>]<br><b><span style="font-weight: bold;">Sent:</span></b> 01 August 2006
14:14<br><b><span style="font-weight: bold;">To:</span></b> Martin J.
Green<br><b><span style="font-weight: bold;">Cc:</span></b> <a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net
</a><br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Nagios-users]
Externals Commands</span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Martin J. Green wrote:
</span></font></p>
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">I can't get
external commands to work either (appears it can't write to the file for
some reason), but its so low on my list of priorities I haven't gotten
to it yet. </span></font></p>
<div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US">
<hr align="center" size="2" width="100%">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="font-weight: bold; font-size: 10pt; font-family: Tahoma;" lang="EN-US">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
<a href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users-bounces@lists.sourceforge.net</a> [<a href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
mailto:nagios-users-bounces@lists.sourceforge.net</a>] <b><span style="font-weight: bold;">On Behalf Of </span></b>Hari
Sekhon<br><b><span style="font-weight: bold;">Sent:</span></b> 01 August
2006 13:48<br><b><span style="font-weight: bold;">To:</span></b> <a href="mailto:nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nagios-users@lists.sourceforge.net
</a><br><b><span style="font-weight: bold;">Subject: </span></b>[Nagios-users] Externals
Commands</span></font></p></div>
<p style="margin-bottom: 12pt;"><font color="black" face="Times New Roman" size="3"><span style="font-size: 12pt; color: black;">I am having real
difficulty getting external commands to work and don't full understand
what's going wrong, despite having RTFMing several times. <br><br>As an
example, I log in to the web interface as nagiosadmin via basic apache
auth successfully as usual. I go to "comments" in the left hand pane and
enter one for a host but when I click submit, I get the error:
</span></font></p>
<div>
<p><font color="black" face="Times New Roman" size="3"><span style="font-size: 12pt; color: black;">"Sorry, but you are not authorized
to commit the specified command.</span></font></p></div>
<div>
<p style="margin-bottom: 12pt;"><font color="black" face="Times New Roman" size="3"><span style="font-size: 12pt; color: black;">Read the section of
the documentation that deals with authentication and authorization in
the CGIs for more information. <br><br>Return from whence you
came"<br><br>As far as I can tell, I have all the perms set right
according to the
docs:<br><br>cgi.cfg<br><br>use_authentication=1<br>authorized_for_system_information=nagiosadmin
<br>authorized_for_configuration_information=nagiosadmin<br>authorized_for_system_commands=nagiosadmin<br>authorized_for_all_services=nagiosadmin<br>authorized_for_all_hosts=nagiosadmin<br>authorized_for_all_service_commands=nagiosadmin
<br>authorized_for_all_host_commands=nagiosadmin<br><br>nagios.cfg<br><br>command_file=/var/nagios/rw/nagios.cmd<br>check_external_commands=1<br>#
NOTE: Setting this value to -1 causes Nagios to check the external<br>#
command file as often as possible.
<br>command_check_interval=-1<br><br>ll /var/nagios/ | grep
rw/<br>drwxrws--- 2 nagios apache 4096 Aug 1 13:28
rw/<br><br>ll /var/nagios/rw/nagios.cmd<br>prw-rw---- 1 nagios apache 0
Aug 1 13:28 /var/nagios/rw/nagios.cmd| <br><br>The apache process
is run by the apache user, a member of the apache group, so has full
perms to the directory and the pipe file nagios.cmd. Nagios is run by
nagios who is also a member of the apache group.<br><br>This all looks
as it should be according to the docs as far as I can
see.</span></font></p></div>
<p style="margin-bottom: 12pt;"><font color="black" face="Times New Roman" size="3"><span style="font-size: 12pt; color: black;">What am I
missing?<br><br><br>Hari</span></font></p></div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>I think quite a lot of people have trouble
with this but a lot give up or are satisfied that the main bit is
working and don't bother with this... <br><br>does anybody have this
working and if so could you post your configs so I can see anything you
have different to me?<br><br>are external commands generally broken or
is there something missing in the docs/our configs/our brains?
<br><br>I'm using Version
1.4.1<br><br>Hari</span></font></p></blockquote></div>
<div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">************************************************************************
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
Any unauthorised distribution or copying is strictly prohibited. Whilst
Kognitio Limited takes steps to prevent the transmission of viruses via
e-mail, we can not guarantee that any email or attachment is free from
computer viruses and you are strongly advised to undertake your own
anti-virus precautions. Kognitio grants no warranties regarding
performance, use or quality of any e-mail or attachment and undertakes no
liability for loss or damage, howsoever caused.
***********************************************************************
</span></font></p></div></div>
</span></div><div><p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>-------------------------------------------------------------------------</span></font></p>
</div><div><span class="q"><font face="Times New Roman" size="3"><br>Take
Surveys. Earn Cash. Influence the Future of IT<br>Join SourceForge.net's
Techsay panel and you'll get the chance to share your <br>opinions on IT
& business topics through brief surveys -- and earn cash<br><a href="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV</a><br><br>_______________________________________________<br>Nagios-users
mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.sourceforge.net/lists/listinfo/nagios-users
</a><br>::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.<br>::: Messages without supporting info will risk
being sent to /dev/null</font></span></div><div><p></p></div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br><br clear="all"><br>-- <br>- Justin
</span></font></p></div></div></div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br><br clear="all"><br>-- <br>- Justin
</span></font></p></div></div>
</div></blockquote></div><br><br clear="all"><br>-- <br> - Justin