Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring Nagios Check Website Command help Post 302574392 by Yoshi17 on Thursday 17th of November 2011 07:48:44 AM
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
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
send_nsca(1)						      General Commands Manual						      send_nsca(1)

NAME
send_nsca - send passive check results to an NSCA daemon SYNOPSIS
send_nsca -H <host_address> [-p port] [-to to_sec] [-d delim] [ -c config_file] DESCRIPTION
send_nsca This utility is used to send passive check results to the NSCA daemon. Host and Service check data that is to be sent to the NSCA daemon is read from standard input. Input should be provided in the following format (tab-delimited unless overriden with -d command line argument, one entry per line): Service Checks <host> <svc_description> <return_code> <plugin_output> Host Checks: <host> <return_code> <plugin_output> OPTIONS
host_address The IP address of the host running the NSCA daemon port The port on which the daemon is running - default is 5667 to_sec Number of seconds before connection attempt times out. (default timeout is 10 seconds) delim Delimiter to use when parsing input (defaults to a tab) config_file Name of config file to use SEE ALSO
nsca(1) FILES
/etc/nsca.cfg nsca server configuration /etc/send_nsca.cfg send_nsca configuration AUTHOR
NSCA was written by Ethan Galstad <nagios@nagios.org>. This manpage was written by sean finney <seanius@debian.org> for Debian (but it may be freely used, modified, and redistributed by others). nsca December 2005 send_nsca(1)
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy