LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-09-2008, 12:17 PM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
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 usernameassword
}


restarted nagios and keep getting that error. The usernameassword 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
 
Old 10-09-2008, 12:59 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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?

Last edited by unSpawn; 10-09-2008 at 01:05 PM.
 
Old 10-09-2008, 01:32 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
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.
 
Old 10-09-2008, 02:00 PM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
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?

Last edited by ncsuapex; 10-09-2008 at 02:01 PM. Reason: .
 
Old 10-09-2008, 05:10 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How about just "check_tcp -H hostname -p port"?
 
1 members found this post helpful.
Old 10-10-2008, 09:21 AM   #6
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
check_tcp -H hostname -p port
worked

Thanks for your assistance

Last edited by ncsuapex; 10-10-2008 at 10:21 AM. Reason: .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios check_http adams901 Linux - Software 1 10-07-2008 10:55 AM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 05:33 PM
Nagios : authorization problem for commits only denver1980 Linux - Software 1 12-21-2005 12:05 AM
Nagios - Check_Dummy / Check_Http Brainli Linux - Software 3 10-02-2005 05:09 PM
NAGIOS: Unable to Execute check_http danfig Linux - Newbie 2 12-20-2004 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration