LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   nagios check_http with authorization? (https://www.linuxquestions.org/questions/linux-software-2/nagios-check_http-with-authorization-675343/)

ncsuapex 10-09-2008 12:17 PM

nagios check_http with authorization?
 
Im trying to stop these messages in my nagios log:

SERVICE ALERT: servername;HTTP_AUTH;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 401 Authorization Required


in the commands.cfg I added this definition

# 'check_http' command definition
define command{
command_name check_http_auth
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ -a username:password
}


restarted nagios and keep getting that error. The username:password are valid for the login credentials for logging into the webpage. The website is a forum with a forum login, not a .htaccess pop up box type authorization. I put the password as plain text.

In my host definition file I have this:

define service{
use local-service ; Name of service template to use
host_name hostname
service_description HTTP_AUTH
check_command check_http_auth
notifications_enabled 0
}



Its in the section I have for the server "hostname"


Any advice? Thanks

unSpawn 10-09-2008 12:59 PM

As far as I know the "-a" argument to check_http will only work where you have HTTP auth, not forms, so if the front page asks for auth maybe you could use "-u" and supply some address that can be accessed without restrictions like a help page or something?

ncsuapex 10-09-2008 01:32 PM

Well thats the weird thing. The forums can be access and read without authorization. Meaning.. If you do not have an account you can still read the forums but can't reply to a ny threads. I had this monitoring in place and recently we did some server consolidation and that's when this error started appearing in the nagios logs. In reality all I need nagios to do is to go: Is the website up(are their http processes running on the server)? It shouldn't really need to authenticate to anything...


I may try a -u and the main page to see if that works.

ncsuapex 10-09-2008 02:00 PM

ahhh ok I figured it out. We had 2 forums we merged. One forum had a popup HTTP authentication box, the 2nd was authenticated at the database level. When the 2 forums were merged for some reason it still has in place the old popup box. They each had their own authentication. When I used the -a with the authentication I used with the popup box it worked.


thanks.

Is there still away around that? Just to have nagios check to see if the site is running? And not have it use authentication?

unSpawn 10-09-2008 05:10 PM

How about just "check_tcp -H hostname -p port"?

ncsuapex 10-10-2008 09:21 AM

check_tcp -H hostname -p port
worked

Thanks for your assistance


All times are GMT -5. The time now is 12:51 AM.