Nagios Check Website Command help

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring Nagios Check Website Command help
# 1  
Old 11-17-2011
Nagios Check Website Command help

Hi all, me again....

I am trying to add a website to my nagios checking juggernaught

I am using the script from nagios exchange site called check_website_response (google to find it i am not allowed to post links yet, sorry)

It is in /usr/local/nagios/libexec with the rest of the default plugins

Here is my commands.cfg

Code:
# ‘check_website_responce' command definition
 Define_command{
                 Command_name                             check_website_responce
                 Command_line                                 $USER1$/check_website_responce.sh -u $ARG1$ -w $ARG2$ - c $ARG3$
                 }

Here is my websites.cfg
Code:
 Define service{
                 Use                                        generic-service
                 Host Name                         My Website
                 Service_description        Website Check
                 Check_command             check_website_responce!500!700!mywebsite in correct format but i cant post links yet
                 }
 

 Define Host{
                 Use                                        generic-website
                 Host_name                        My Website
                 Alias                                       My Website
                 Address                               website IP

                 Hostgroups                         Sites - Clients
                 }

With this it will return a service status of OK but a host status of DOWN with the following error

RESPONSE: UNKNOWN - Error: Illegal option used
Usage: check_website.sh -w (warning milliseconds) -c (critical milliseconds) -u (url)

I know the $ARG$ variables are working though because if i change the warning time to 2ms the service status changes to WARNING as it took longer to respond.

If i change the commands.cfg and put in values for the $ARG$ but leave the websites.cfg alone as original it works fine

Code:
# ‘check_website_responce' command definition
 Define_command{
                 Command_name                             check_website_responce
                 Command_line                                 $USER1$/check_website_responce.sh -w 300 -c 500 -u mywebsite in correct format but i cant post links yet
                 }

This will return both a host and service status of OK and UP.

I cant for the life of me work out whats happening here and its driving me to drink.

Anybody any ideas/ suggestions?

Cheers guys
# 2  
Old 03-31-2012
there is a space between the dash and the c in your original commands.cfg
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check who run the command?

Dear Team, i need to know in linux if someone run the command in linux server where i can check on server . i need to know the below points who (user) when (date and time) what (command) regards, scriptors (1 Reply)
Discussion started by: scriptor
1 Replies

2. Shell Programming and Scripting

Command to check only Autosys running jobs with autorep like command

Hi, Is there any specific command to use to check only say Running jobs via autorep or similar command for Autosys? (0 Replies)
Discussion started by: sidnow
0 Replies

3. Infrastructure Monitoring

Nagios check dependent on second nagios server

We have a dual Nagios server setup. One is setup for internal server monitoring on our LAN, while the second Nagios server is hosted externally and is used for external checks only such as URL and ping checks form the WAN side. I was wondering if there is any way to setup cross dependencies... (1 Reply)
Discussion started by: eugenes18t
1 Replies

4. Shell Programming and Scripting

Script to check one command and if it fails moves to other command

Input is list of Server's, script is basically to remove old_rootvg, So it should check first command "alt_rootvg_op -X old_rootvg" if it passes move to next server and starts check and if it fails moves to other command "exportvg old_rootvg" for only that particular server. I came up with below,... (6 Replies)
Discussion started by: aix_admin_007
6 Replies

5. Web Development

Request to check:PHP website design help

Hi I have a website name www.gentrepid.org I have all the setting scripts for this website in php now as a research part, I am new to this as I havent done that before. I have to make certain changes in the website Include some icons on the left like "Drugs" when user click on it... (0 Replies)
Discussion started by: manigrover
0 Replies

6. Linux

Ping check failed from Nagios master server on windows hosts in the same subnet

Hello All, We have added a windows host and its config files to Nagios master server and wanted to do a ping check alone at the moment however, the nagios master server identifies the host in its GUI and immediately disappears can anyone let me know the right approach to this one, We want to... (2 Replies)
Discussion started by: lovesaikrishna
2 Replies

7. UNIX Desktop Questions & Answers

Website-Command Line Prompt

Hello guys... I am having a doubt. Please try to rectify it. I would really appreciate it. The thing is that is it possible to open any website say for example,google from the command line prompt(terminal) if you are working in Linux-fedora... I am very new to Unix. regards, Mahesh... (2 Replies)
Discussion started by: mraghunandanan
2 Replies

8. Shell Programming and Scripting

HELP: check if website is on, if not email

if {ping -c 1 www || { "Destination Host Unreachable" ; }} then { echo "neveikia senas-pastas, web serveris" | mailx -s "Senas web serveris" mail } endif; this is my script but it does not work... :confused: this script will be used to check if website is online if not then sends an... (7 Replies)
Discussion started by: big_nobody
7 Replies

9. Shell Programming and Scripting

How do I check using shell-script if a website is available / responding?

Hi, Could someone please help. How do I verify using a shell script whether a website URL is available? It's roughly the URL equivalent of ping <servername> or tnsping <Oracle database name>? I hope this is enough information - please let me know if it's not. Many thanks, Neil (3 Replies)
Discussion started by: Neil_mw
3 Replies
Login or Register to Ask a Question