<div class="gmail_quote">Hi<div><br></div><div>I tried to get dnsreg script working, and it's a complete failure ..</div><div>Here what's I've done so far :</div><div><br></div><div>1/ Creating dnsreg script in server/ext/dnsreg (the one from <a href="http://xymon.com" target="_blank">xymon.com</a>, with a little modification). </div>
<div>My version :</div><div><br></div><div><div>#!/bin/sh</div><div><br></div><div># Check DNS registrations in whois and warn when they are about to expire.</div><div>#</div><div># NOTE: Requires a "whois" command that knows what servers to query.</div>
<div># Requires GNU date.</div><div># Should run only once a day.</div><div><br></div><div>BBHTAG=dnsreg</div><div>COLUMN=$BBHTAG</div><div>NOW=`date "+%s"`</div><div>WARNTIME=`expr $NOW + 864000` # 10 days</div>
<div>ALARMTIME=`expr $NOW + 432000` # 5 day</div><div><br></div><div>/home/xmon/server/bin/bbhostgrep dnsreg | while read L</div><div>do</div><div> set $L</div><div> DOMAIN=$1</div><div><br></div><div> EXPIRESTRING="`whois $DOMAIN | egrep -i "Expires.*:|Expiration.*:|Renewal.*:" | head -n 1 | cut -d: -f2 | sed -e's/^[ ]*//' | cut -f1 -d' '`"</div>
<div> EXPIRES=`date --date="$EXPIRESTRING" "+%s"`</div><div><br></div><div> if test $EXPIRES -le $ALARMTIME</div><div> then</div><div> COLOR=red</div><div> elif test $EXPIRES -le $WARNTIME</div>
<div> then</div><div> COLOR=yellow</div><div> else</div><div> COLOR=green</div><div> fi</div><div><br></div><div> $BB $BBDISP "status+12h $DOMAIN.dnsreg $COLOR `date`</div><div><br>
</div><div>Domain $DOMAIN expires on $EXPIRESTRING</div><div>"</div><div>done</div><div><br></div><div>exit 0</div><div><br></div></div><div><br></div><div><font face="arial, helvetica, sans-serif">2/ Modify "</font><span style="line-height:19px"><font face="arial, helvetica, sans-serif">server/etc/hobbitlaunch.cfg" to add :</font></span></div>
<div><span style="line-height:19px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="line-height:19px"><font face="arial, helvetica, sans-serif"><div>
[dnsreg]</div><div> ENVFILE /home/xmon/server/etc/hobbitserver.cfg</div><div> CMD /home/xmon/server/ext/dnsreg</div><div> LOGFILE $BBSERVERLOGS/bb-dnsreg.log</div><div> INTERVAL 5m</div><div><br>
</div><div>3/ Modify bb-hosts to add domain with dnsreg test:</div><div><br></div><div><div>group-compress <font size="+1">Servers</font></div><div>...</div><div>[My classic test, working great]</div>
<div>...</div><div><br></div><div>groupe-compress <font size="+1">Domains</font></div><div>0.0.0.0 firstdomain.tld # noconn dnsreg</div><div>0.0.0.0 second.tld # noconn dnsreg</div><div>0.0.0.0 etc.tld # noconn dnsreg</div>
<div>0.0.0.0 etcetc.tld # noconn dnsreg</div><div><br></div></div><div>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).</div>
<div>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)</div><div><br></div><div>I'm using xymon 4.3.0.0beta2 on debian, and all other tests are working great :)</div>
</font></span></div><div><br clear="all">--<br>Nicolas G. / meepmeep<br>
</div>
</div><br>