NRPE Style
This commit is contained in:
parent
1d6b4d9315
commit
878c32cc16
1 changed files with 20 additions and 1 deletions
|
@ -1,7 +1,26 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
score=`curl --silent "http://www.pool.ntp.org/scores/195.154.45.50/log?limit=1" 2>&1 | tail -1 | cut -f 5 -d ","`
|
OPTIND=1
|
||||||
|
|
||||||
|
while getopts "H:" opt; do
|
||||||
|
case "$opt" in
|
||||||
|
H)
|
||||||
|
hostname=$OPTARG
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
[ "$1" = "--" ] && shift
|
||||||
|
|
||||||
|
if [ -z $hostname ]
|
||||||
|
then
|
||||||
|
echo "ERROR: please provide IP with -H: $0 -H <IP>"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
score=`curl --silent "http://www.pool.ntp.org/scores/$hostname/log?limit=1" 2>&1 | tail -1 | cut -f 5 -d ","`
|
||||||
|
|
||||||
if [ $score == "" ]
|
if [ $score == "" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue