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 #
|
||||
###############################################################################
|
||||
|
||||
# VERSION: Version 0.99
|
||||
# VERSION: Version 1.0
|
||||
# AUTHOR: See README. This version updated by Ryan Loudfoot (ryan@delotha.com)
|
||||
|
||||
PROGRAM=${0##*/}
|
||||
PROGPATH=${0%/*}
|
||||
PROGRAM=$(whereis -b -B /{bin,usr,etc}/* -f whois | awk '{print $2}')
|
||||
|
||||
# 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
|
||||
# environment or outside of Nagios.
|
||||
if [ -e "$PROGPATH/utils.sh" ]; then
|
||||
. "$PROGPATH/utils.sh"
|
||||
if [ -e "utils.sh" ]; then
|
||||
. "utils.sh"
|
||||
else
|
||||
STATE_OK=0
|
||||
STATE_WARNING=1
|
||||
@ -83,6 +82,8 @@ Options:
|
||||
Response time to result in warning status (days)
|
||||
-c
|
||||
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.
|
||||
Example:
|
||||
@ -111,10 +112,10 @@ fi
|
||||
|
||||
# Looking for whois binary
|
||||
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."
|
||||
whois=whois
|
||||
type whois > /dev/null 2>&1 || die $STATE_UNKNOWN "UNKNOWN - Unable to find whois binary. Is it installed?"
|
||||
whois=$PROGRAM
|
||||
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"
|
||||
fi
|
||||
|
||||
|
7
readme
7
readme
@ -1,6 +1,7 @@
|
||||
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.
|
||||
Debian/Ubuntu: apt-get install whois
|
||||
RHEL/CentOS: yum install jwhois
|
||||
|
||||
Original version had this copyright notice in it:
|
||||
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.
|
||||
|
||||
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
|
||||
-Add support for .org domains thanks to Jack-Benny Persson (jack-benny@cyberinfo.se)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user