[Xymon] Run Single Test

John Thurston john.thurston at alaska.gov
Thu Mar 26 18:56:01 CET 2015


On 3/26/2015 9:46 AM, John Tullis wrote:
> Cool! So my hosts file would look something like this?
>
> 0.0.0.0         domain1.com # NOCONN dnsreg:10
> 0.0.0.0         domain2.com # NOCONN dnsreg:11
> 0.0.0.0         domain3.com # NOCONN dnsreg:12
> 0.0.0.0         domain4.com # NOCONN dnsreg:16
> 0.0.0.0         domain5.com # NOCONN dnsreg:20

Yes. But it won't do anything useful unless you also modify dnsreg.sh to 
consume those numeric suffixes.

You might try some lines like:

HOUR=`/usr/bin/date +%H`
/usr/lib/hobbit/server/bin/bbhostgrep "dnsreg:$HOUR" | while read L

I don't know what OS or shell you are using. But the idea is to make 
your bbhostgrep match only the correctly tagged lines. I use Solaris so 
I get the number of the current hour with /usr/bin/date. You might use 
some other utility or parameter.

Another way to do it is to leave the bbhostsgrep line alone and put a 
conditional inside the 'do'. But that is going to depend on what fields 
have been returned in L  I don't know how bbhostsgrep differs from 
xymongrep, so I'll have to leave that as an exercise for the reader.


-- 
    Do things because you should, not just because you can.

John Thurston    907-465-8591
John.Thurston at alaska.gov
Enterprise Technology Services
Department of Administration
State of Alaska



More information about the Xymon mailing list