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
Nagios::Plugin::Config(3pm)				User Contributed Perl Documentation			       Nagios::Plugin::Config(3pm)

NAME
Nagios::Plugin::Config - read nagios plugin .ini style config files SYNOPSIS
# Read given nagios plugin config file $Config = Nagios::Plugin::Config->read( '/etc/nagios/plugins.ini' ); # Search for and read default nagios plugin config file $Config = Nagios::Plugin::Config->read(); # Access sections and properties (returns scalars or arrayrefs) $rootproperty = $Config->{_}->{rootproperty}; $one = $Config->{section}->{one}; $Foo = $Config->{section}->{Foo}; DESCRIPTION
Nagios::Plugin::Config is a subclass of the excellent Config::Tiny, with the following changes: o Repeated keys are allowed within sections, returning lists instead of scalars o Write functionality has been removed i.e. access is read only o Nagios::Plugin::Config searches for a default nagios plugins file if no explicit filename is given to "read()". The current standard locations checked are: /etc/nagios/plugins.ini /usr/local/nagios/etc/plugins.ini /usr/local/etc/nagios /etc/opt/nagios/plugins.ini /etc/nagios-plugins.ini /usr/local/etc/nagios-plugins.ini /etc/opt/nagios-plugins.ini To use a custom location, set a "NAGIOS_CONFIG_PATH" environment variable to the set of directories that should be checked. The first "plugins.ini" or "nagios-plugins.ini" file found will be used. SEE ALSO
Config::Tiny, Nagios::Plugin AUTHORS
This code is maintained by the Nagios Plugin Development Team: <http://nagiosplug.sourceforge.net>. COPYRIGHT and LICENCE Copyright (C) 2006-2007 by Nagios Plugin Development Team This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2010-12-03 Nagios::Plugin::Config(3pm)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy