Xymon Mailing List Archive search

Run Single Test

list John Thurston
Thu, 26 Mar 2015 09:56:01 -0800
Message-Id: <user-fda5c5a26fb9@xymon.invalid>

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    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska