Version 1.0! Now use whereis to find the binary. Updated --help with the -P switch. Remove unnecessary variable.
This commit is contained in:
parent
8b2bbf4274
commit
24614212fb
17
check_domain
17
check_domain
@ -23,17 +23,16 @@
|
|||||||
# https://github.com/Elyrith/check_domain #
|
# https://github.com/Elyrith/check_domain #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# VERSION: Version 0.99
|
# VERSION: Version 1.0
|
||||||
# AUTHOR: See README. This version updated by Ryan Loudfoot (ryan@delotha.com)
|
# AUTHOR: See README. This version updated by Ryan Loudfoot (ryan@delotha.com)
|
||||||
|
|
||||||
PROGRAM=${0##*/}
|
PROGRAM=$(whereis -b -B /{bin,usr,etc}/* -f whois | awk '{print $2}')
|
||||||
PROGPATH=${0%/*}
|
|
||||||
|
|
||||||
# Ryan's note: utils.sh is installed with nagios-plugins in with the plugins
|
# Ryan's note: utils.sh is installed with nagios-plugins in with the plugins
|
||||||
# Check if utils.sh exists. This lets you use check_domain in a testing
|
# Check if utils.sh exists. This lets you use check_domain in a testing
|
||||||
# environment or outside of Nagios.
|
# environment or outside of Nagios.
|
||||||
if [ -e "$PROGPATH/utils.sh" ]; then
|
if [ -e "utils.sh" ]; then
|
||||||
. "$PROGPATH/utils.sh"
|
. "utils.sh"
|
||||||
else
|
else
|
||||||
STATE_OK=0
|
STATE_OK=0
|
||||||
STATE_WARNING=1
|
STATE_WARNING=1
|
||||||
@ -83,6 +82,8 @@ Options:
|
|||||||
Response time to result in warning status (days)
|
Response time to result in warning status (days)
|
||||||
-c
|
-c
|
||||||
Response time to result in critical status (days)
|
Response time to result in critical status (days)
|
||||||
|
-P
|
||||||
|
Path to whois command (No ending slash, like "/usr/bin")
|
||||||
|
|
||||||
This plugin will use whois service to get the expiration date for the domain name.
|
This plugin will use whois service to get the expiration date for the domain name.
|
||||||
Example:
|
Example:
|
||||||
@ -111,10 +112,10 @@ fi
|
|||||||
|
|
||||||
# Looking for whois binary
|
# Looking for whois binary
|
||||||
if [ -z "$whoispath" ]; then
|
if [ -z "$whoispath" ]; then
|
||||||
type whois > /dev/null 2>&1 || die $STATE_UNKNOWN "UNKNOWN - Unable to find whois binary in your path. Is it installed? Please specify path."
|
type whois > /dev/null 2>&1 || die $STATE_UNKNOWN "UNKNOWN - Unable to find whois binary. Is it installed?"
|
||||||
whois=whois
|
whois=$PROGRAM
|
||||||
else
|
else
|
||||||
[ -x "$whoispath/whois" ] || die $STATE_UNKNOWN "UNKNOWN - Unable to find whois binary, you specified an incorrect path"
|
[ -x "$whoispath/whois" ] || die $STATE_UNKNOWN "UNKNOWN - Unable to find whois binary, you specified an incorrect path."
|
||||||
whois="$whoispath/whois"
|
whois="$whoispath/whois"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
7
readme
7
readme
@ -1,6 +1,7 @@
|
|||||||
This is a Nagios plugin to check the expiration date of a domain name.
|
This is a Nagios plugin to check the expiration date of a domain name.
|
||||||
It uses the "whois" command, which usually comes as a "whois" package.
|
It uses the "whois" command, which usually comes as a "whois" package.
|
||||||
Debian/Ubuntu: apt-get install whois
|
Debian/Ubuntu: apt-get install whois
|
||||||
|
RHEL/CentOS: yum install jwhois
|
||||||
|
|
||||||
Original version had this copyright notice in it:
|
Original version had this copyright notice in it:
|
||||||
Copyright (c) 2005 Tomàs Núñez Lirola <tnunez@criptos.com>,
|
Copyright (c) 2005 Tomàs Núñez Lirola <tnunez@criptos.com>,
|
||||||
@ -18,6 +19,12 @@ Support for Performance Data by Ryan Loudfoot
|
|||||||
If you would like to add a TLD, send me the code or a pull request. If you want me to add one, let me know and I'll see what I can do.
|
If you would like to add a TLD, send me the code or a pull request. If you want me to add one, let me know and I'll see what I can do.
|
||||||
|
|
||||||
Change log:
|
Change log:
|
||||||
|
2014-09-06 - Version 1.0!
|
||||||
|
-Using whereis command to find the whois binary
|
||||||
|
("whois on first, whereis on second..." -geekiest Abbot and Costello?)
|
||||||
|
-Add help text for -P switch
|
||||||
|
-Add RHEL/CentOS command for installing whois command (jwhois package)
|
||||||
|
|
||||||
2014-06-26 - Version 0.99
|
2014-06-26 - Version 0.99
|
||||||
-Add support for .org domains thanks to Jack-Benny Persson (jack-benny@cyberinfo.se)
|
-Add support for .org domains thanks to Jack-Benny Persson (jack-benny@cyberinfo.se)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user