Xymon Mailing List Archive search

TS - Maintenance Mode for a group of hosts?

list Jeremy Laidman
Mon, 10 Dec 2012 11:21:08 +1100
Message-Id: <user-6f857158d55d@xymon.invalid>

If you only want the "disable" or "enable" to apply to a group of hosts,
you can search for hosts matching any tag you wish using xymongrep.  So for
instance, if you have the following:

192.168.1.1 www.test.com # http telnet CORP
192.168.1.2 mail.test.com # smtp telnet FINANCE
192.168.1.3 ftp.test.com # ftp ssh CORP

Then you can disable the first and third (in "CORP" group) for 90 minutes
with:

xymongrep CORP | while read IP NAME REST; do xymon $XYMSRV "disable $NAME.*
90m disabled group 1 servers"; done

If you want to disable at a future time, use the "schedule" command to
submit the "disable" command at the right time.  Or put the above into a
script and schedule it using "at".

You can be very flexible with the entries in the host.cfg file, and they
are normally ignored by Xymon unless then happen to match a test tag being
used elsewhere.  So instead of "CORP" and "FINANCE" you could have
"GROUP=corp" and "GROUP=finance", and then match that string format
appropriately, such as: xymongrep GROUP=corp.  You're less likely to match
another tag this way.

Then you can match all hosts that are in any group with: xymongrep
'GROUP=*'.  You can even have hosts in multiple groups like:
GROUP=CORP,Linux,prod; then match all corporate hosts with something like:
xymongrep 'GROUP=' | egrep '=CORP|,CORP'

If you already have "NET:location" definitions in hosts.cfg, then you can
match these with: xymongrep 'NET:*'  Or you can match any untagged entries
with

See the man page on xymongrep for more info.

J


On 7 December 2012 01:50, <user-9c1ae820b621@xymon.invalid> wrote:
I have a request to take an entire area of hosts and place setup a
maintenance window starting at a certain time and for say 3 hours.****

Is there a script that I can send it a list and have it place all of the
devices in maintenance mode?****

** **

All corporate servers will require a window of 3 hours at 6pm tonight.****

Also, is there any option on the HOST line that will not show up (like an
actual comment not the COMMENT: entry) that can be used to select them from.
****

e.g.  the word ‘CORP’ in the options like that will normally be ignored by
Xymon?****

** **

I am running Xymon 4.3.0-0.beta2.****

** **

Also, is there a way to show the COMMENT or DESCRIPTION on the line like
it does in the non-green view under this release?****

** **

*Thanks,*

* *

*Tom Schmitt*

*Senior IT Staff*****

Salt Lake City, UT  84116****

Phone (801) *594-3030*****

*            **\\\\||////***

*               **\ ~  ~ /  ***

*               **| @  @ |*

*--oOo---(_)---oOo--*

* Have A Nice Day !*

** **

*It is not necessary to change.*

*Survival is not mandatory.*

*        -- W. Edwards Deming*

** **