how to get dnsreg to work .. ?

meepmeep @ Fantasya.org meepmeep at fantasya.org
Sun Feb 28 16:46:58 CET 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100228/124ecf6f/attachment.html>


More information about the Xymon mailing list