Xymon – drop a test or host

Posted by & filed under Server Admin.

Straight from the manpage:

Deleting a test:

For Xymon use the command:

/server/bin/xymon 127.0.0.1 “drop HOSTNAME ftp”

For BigBrother use the command

~/server/bin/bb 127.0.0.1 “drop HOSTNAME ftp”

to permanenly remove all traces of a test. Note that you need the quotes around the “drop HOSTNAME ftp”.

 

For Xymon: Deleting a host

First, remove the host from the /etc/xymon/hosts.conf file. Then use the command

server/bin/xymon 127.0.0.1 “drop HOSTNAME”

to permanently remove all traces of a host. Note that you need the quotes around the “drop HOSTNAME”.

 

For Big Brother: Deleting a host

First, remove the host from the ~/server/etc/bb-hosts file. Then use the command

~/server/bin/bb 127.0.0.1 “drop HOSTNAME”

to permanently remove all traces of a host. Note that you need the quotes around the “drop HOSTNAME”.

 

Updated 03/24/14 w/ Xymon specific syntax.

Xymon script testing/debugging

Posted by & filed under Server Admin.

This is a follow-up to a older post I made about Hobbit/Xymon and testing alerting (natesbox.com/blog/?p=378)

I have needed to write a few Xymon scripts and in order to test them outside of Xymon, but with the Xymon environment variables which most scripts depend on. In order to do this we use the xymoncmd command like so:

This works for a client script, but I wanted the server env vars, so I added one additional option:

Also one note on older compatibility: As of the (slightly outdated) version I am currently running, xymoncmd is just a alias of bbcmd, So this should apply to older hobbit stuff too.

Hobbit / Xymon Host conn flapping due to DNS lookup issues

Posted by & filed under Uncategorized.

I had a few hosts that were intermittently going red for no reason on the conn test (ping). After some effort, I found that adding the –no-ares switch to the [bbnet] CMD section of hobbitlaunch.cfg and then restarting the hobbit server resolved the issue. Services stable and accurate!

manpages.ubuntu.com/manpages/natty/man1/…

–no-ares
Disable the ARES resolver built into bbtest-net. This makes
bbtest-net resolve hostnames using your system resolver
function. You should only use this as a last resort if bbtest-
net cannot resolve the hostnames you use in the normal way (via
DNS or /etc/hosts). One reason for using this would be if you
need to resolve hostnames via NIS/NIS+ (a.k.a. Yellow Pages).
The system resolver function does not provide a mechanism for
controlling timeouts of the hostname lookups, so if your DNS or
NIS server is down, bbtest-net can take a very long time to run.
The –dns-timeout option is effectively disabled when using this
option.

Xymon/Hobbit Custom Scripting

Posted by & filed under Uncategorized.

There are a few steps to get custom scripts working.

  • 1. Update hobbitlaunch.cfg with the new script. For my WHOIS checker I used:


    #
    # WHOIS Expiration Checker
    #

    [dnsreg]
    ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
    CMD /usr/lib/hobbit/server/ext/dnsreg
    LOGFILE $BBSERVERLOGS/dnsreg.log
    INTERVAL 1d

  • 2. Install script, make sure it is executable, etc. This should be placed at the path of CMD in my above snippet. By default it is /server/ext
  • 3. Update bb-hosts with the service name
  • www.balldawg.net/index.php/2009/05/creat…

Configure Xymon Client (BBWin)

Posted by & filed under Server Admin.

I periodically need to configure BBWin clients for our Xymon monitoring system.

Config Steps:
–>Install BBWin Client
–>Copy bbwin/etc/bbwin.cfg from an existing install
–>Set HKLM/Software/BBWin/hostname
–>Start Service

Kick off a test alert with Xymon

Posted by & filed under Server Admin.

If you want to test how your alert configuration handles a specific host, you can run xymond_alert in test mode – you give it a hostname and servicename as input, and it will go through the configuration and tell you which rules match and who gets an alert.

Xymon:

osiris:~ $ cd server/
osiris:~/server $ ./bin/xymoncmd xymond_alert –test osiris.hswn.dk cpu
Matching host:service:page ‘osiris.hswn.dk:cpu:’ against rule line 109:Matched
*** Match with ‘HOST=*’ ***
Matching host:service:page ‘osiris.hswn.dk:cpu:’ against rule line 110:Matched
*** Match with ‘MAIL henrik@sample.com REPEAT=2 RECOVERED COLOR=red’ ***
Mail alert with command ‘mail -s “XYmon [12345] osiris.hswn.dk:cpu is RED” henrik@sample.com

BigBrother is slightly different:
$ bbcmd hobbitd_alert –test ns2.whatever.net conn

Both can optionally be appended with a duration to meet any requirements:

dev@monitor:/usr/lib/hobbit/server/bin$ bbcmd hobbitd_alert --test ns2.whatever.net conn --duration=501
2011-07-08 10:37:05 Using default environment file /usr/lib/hobbit/client/etc/hobbitserver.cfg
00013395 2011-07-08 10:37:05 send_alert ns2.whatever.net:conn state Paging
00013395 2011-07-08 10:37:05 Matching host:service:page 'ns2.whatever.net:conn:' against rule line 26
00013395 2011-07-08 10:37:05 Failed 'HOST=$INTIDEAS' (hostname not in include list)
00013395 2011-07-08 10:37:05 Matching host:service:page 'ns2.whatever.net:conn:' against rule line 39
00013395 2011-07-08 10:37:05 *** Match with 'HOST=*' ***

The hobbitd_alert and xymond_alert (depending on if it is xymon or bb) command calls the module:


Update 07/25/18: The Xymon syntax is a bit off, it should be:

See www.xymon.com/xymon/help/manpages/man8/x… for additional details on the parameters.