[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to get dnsreg to work .. ?
- To: hobbit (at) hswn.dk
- Subject: how to get dnsreg to work .. ?
- From: "meepmeep @ Fantasya.org" <meepmeep (at) fantasya.org>
- Date: Sun, 28 Feb 2010 17:31:03 +0100
- References: <b5e7736b1002280746q45a12a1eoa26d964ffb78a7a (at) mail.gmail.com>
Hi
I tried to get dnsreg script working, and it's a complete failure ..
Here what's I've done so far :
1/ Creating dnsreg script in server/ext/dnsreg (the one from xymon.com, with
a little modification).
My version :
#!/bin/sh
# Check DNS registrations in whois and warn when they are about to expire.
#
# NOTE: Requires a "whois" command that knows what servers to query.
# Requires GNU date.
# Should run only once a day.
BBHTAG=dnsreg
COLUMN=$BBHTAG
NOW=`date "+%s"`
WARNTIME=`expr $NOW + 864000` # 10 days
ALARMTIME=`expr $NOW + 432000` # 5 day
/home/xmon/server/bin/bbhostgrep dnsreg | while read L
do
set $L
DOMAIN=$1
EXPIRESTRING="`whois $DOMAIN | egrep -i
"Expires.*:|Expiration.*:|Renewal.*:" | head -n 1 | cut -d: -f2 | sed
-e's/^[ ]*//' | cut -f1 -d' '`"
EXPIRES=`date --date="$EXPIRESTRING" "+%s"`
if test $EXPIRES -le $ALARMTIME
then
COLOR=red
elif test $EXPIRES -le $WARNTIME
then
COLOR=yellow
else
COLOR=green
fi
$BB $BBDISP "status+12h $DOMAIN.dnsreg $COLOR `date`
Domain $DOMAIN expires on $EXPIRESTRING
"
done
exit 0
2/ Modify "server/etc/hobbitlaunch.cfg" to add :
[dnsreg]
ENVFILE /home/xmon/server/etc/hobbitserver.cfg
CMD /home/xmon/server/ext/dnsreg
LOGFILE $BBSERVERLOGS/bb-dnsreg.log
INTERVAL 5m
3/ Modify bb-hosts to add domain with dnsreg test:
group-compress <font size="+1">Servers</font>
...
[My classic test, working great]
...
groupe-compress <font size="+1">Domains</font>
0.0.0.0 firstdomain.tld # noconn dnsreg
0.0.0.0 second.tld # noconn dnsreg
0.0.0.0 etc.tld # noconn dnsreg
0.0.0.0 etcetc.tld # noconn dnsreg
Log is still empty, I try to restart/reload hobbit.sh. Nothing show on the
website concerning the "Domains" (all others tests are still showing).
Moreover, I would like to test the script on a standalone way, but I haven't
found the way to do it (like using hobbitd_alert --test)
I'm using xymon 4.3.0.0beta2 on debian, and all other tests are working
great :)
--
Nicolas G. / meepmeep