I see a couple of things that could be wrong.  Possibly you should be doing "DOMAIN=$2" in the loop??  $1 is the ip address, $2 is the fully-qualified hostname.  It seemed to work just fine when I replaced the bbhostgrep line with<div>
<div><br></div><div>     echo "<a href="http://yahoo.com">yahoo.com</a>" | while read L<br><div><br></div><div>Definitely you should be converting the dots in $DOMAIN to commas.  See the second paragraph under "XYMON MESSAGE SYNTAX" in the bb.1 manpage.  This would do it:</div>
<div><br></div><div>   DOM=`echo $DOMAIN | sed -e 's/\./,/g'`</div><div><div>   echo $BB $BBDISP "status+12h $DOM.dnsreg $COLOR `date`</div><div><br></div></div><div>You can test your script using bbcmd:<div>
<br></div><div>   server/bin/bbcmd  server/ext/dnsreg</div><div><br></div><div>That kicks off the script with the same environment that Xymon gives it.  You probably want to put a  'set -x' in at the top, to see everything that's going on.  I generally put an "echo" in front of the $BB line when testing, to minimize the amount of bogus reports going to the server.</div>
<div><br></div><div>Ralph Mitchell</div><div><br><div><br><div class="gmail_quote">On Sun, Feb 28, 2010 at 11:31 AM, meepmeep @ Fantasya.org <span dir="ltr"><<a href="mailto:meepmeep@fantasya.org">meepmeep@fantasya.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><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>
</blockquote></div><br></div></div></div></div></div>