LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-28-2013, 10:48 AM   #1
Sibla
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
Unhappy Nagios Configuration


I have an issue where my website is hosted in a virtual container on a shared IIS server provided by a hosting company.

This means that my website is found via header information rather than its IP address.

In nagios I want to check that my web site pages are all up and i have found a couple of plugins that will do what I want.

check_website_response.sh and check_http_content

I can get both of them to run from the command line without any issues but I have having trouble when I want to write them into my nagios cfg files.

I have the following in my commands file

define command{
command_name check_website_response
command_line $USER1$/check_website_response.sh -u $ARG1$ -w $ARG2$ -c $ARG3$
}

define command{
command_name check_http_content
command_line $USER1$/check_http_content -U $ARG1$ -m $ARG2$ -t $ARG3$
}
my issue is wring my host file as I can't use the IP address.

I have created a service as follows

define service{
use generic-service
hostgroup_name website
service_description Website
check_command checkcheck_website_response.sh! -w 250 -c 350 -u www.kierbeck.com/index.php
}

and my host looks like this

define service{
use generic-service
host_name HomePage
service_description Home Page
check_command check_http_content! -u http://www.kierbeck.com/index.php -m valued -t 5
}

Nagios doesn't complain when I validate the files but the check fails saying the request requires HTTP

How can I confiure my host so that it works when the check is run from within Nagios

many thanks
 
Old 01-28-2013, 06:59 PM   #2
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,568
Blog Entries: 14

Rep: Reputation: Disabled
Quote:
Originally Posted by Sibla View Post
define command{
...
command_line $USER1$/check_website_response.sh -u $ARG1$ -w $ARG2$ -c $ARG3$
}

define command{
...
command_line $USER1$/check_http_content -U $ARG1$ -m $ARG2$ -t $ARG3$
}
my issue is wring my host file as I can't use the IP address.

I have created a service as follows

define service{
...
check_command checkcheck_website_response.sh! -w 250 -c 350 -u www.kierbeck.com/index.php
}

and my host looks like this

define service{
...
check_command check_http_content! -u http://www.kierbeck.com/index.php -m valued -t 5
}
diff:
command_line $USER1$/check_http_content
check_command check_http_content!

It's been awhile, but is the ! necessary?

Last edited by Habitual; 01-28-2013 at 07:01 PM.
 
Old 01-28-2013, 07:37 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
See also
Code:
checkcheck_website_response.sh!
I'm sure double 'check' is wrong; can't remember about cmd format for '!'
 
Old 01-29-2013, 02:40 AM   #4
Sibla
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for point out my typo!.

The issue is how do I create my host file entry by using the FQDN. Is this possible in Nagios and if so can some one point me in the right direction.

Thanks
 
Old 01-29-2013, 01:33 PM   #5
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,568
Blog Entries: 14

Rep: Reputation: Disabled
Quote:
Originally Posted by Sibla View Post
Thanks for point out my typo!.

The issue is how do I create my host file entry by using the FQDN. Is this possible in Nagios and if so can some one point me in the right direction.

Thanks
Yeah, but I missed the checkcheck (Good Eye, Chris)

Usually an entry in the nagios server's /etc/hosts file will accomodate the FQDN to IP lookup.
Code:
84.40.x.xxx <tab> kierbeck.com
should do it.

I am not certain the www is necessary but it may be in your case as kierbeck.com doesn't resolve to an IP but www.kierbeck.com does.

Other help may be offered.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 07:26 AM
Advance Nagios Configuration p_s_shah Linux - Server 3 08-15-2011 07:06 PM
Need help on Nagios installation and configuration varun.at Linux - Newbie 11 10-22-2010 01:30 AM
Nagios Configuration linson_85 Linux - Software 2 10-09-2009 04:34 AM
Nagios configuration ZAMO Linux - Server 5 10-16-2007 07:54 AM

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

All times are GMT -5. The time now is 03:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration