[Xymon] config report from command line?

Mills, David (IS) David.Mills at ngc.com
Fri Jun 7 20:38:18 CEST 2013


Martin --

I've written a Perl program to parse and maintain the files associated with hosts.cfg in our installation. As part of that program, I've written a couple of routines that parse out and report on host/page "matches" in alerts.cfg.

The parsing routine is not comprehensive of all allowable syntax for alerts.cfg (e.g. it's not up to digesting line continuations, interpreting macros, etc.), and it assumes the presence of certain comment lines embedded in the file, used in our environment to identify groupings of alerts associated with our teams. We use this mostly to see which hosts/pages belong to which teams. It does not dump out the actual mailing rules, though that would be a simple mod.

If you are interested in seeing some of that code, please contact me.

Sample output from one such run:

~/hobbit> ./hobcfgadm.pl --dump-alerts
Vers 2.44
TEAM: C & C
HOST:
Matches (name fragment): xwrl0(0[6-9]|1[01])

TEAM: Content Management
HOST:
Matches (name fragment): (xwau02[23]|ccp)

TEAM: DBA's
HOST:
Matches (name fragment): (awdu|xwdu)

TEAM: EA
PAGE:
Matches: Winters/urls_dev/prodfix_websvcs
Matches: Winters/urls_dev/sit1_websvcs
Matches: Winters/urls_dev/sit2_websvcs
Matches: Winters/urls_dev/uat1_websvcs
Matches: Winters/urls_dev/uat2_websvcs
...

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
David Mills
Systems Administrator
Northrop Grumman
(512) 873-6665

________________________________________
From: Xymon [xymon-bounces at xymon.com] on behalf of john.r.rothlisberger at accenture.com [john.r.rothlisberger at accenture.com]
Sent: Friday, June 07, 2013 12:37 PM
To: martin.flemming at desy.de; xymon at xymon.com
Subject: EXT :Re: [Xymon] config report from command line?

Although those modules look like they could be interesting the documentation is useless or non-existent.

I would be happy to share once I get something useful put together.

Thanks,
John
Upcoming PTO: None
_____________________________________________________________________
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
312.693.3136 office
_____________________________________________________________________

> -----Original Message-----
> From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Martin
> Flemming
> Sent: Friday, June 07, 2013 8:46 AM
> To: xymon at xymon.com
> Subject: Re: [Xymon] config report from command line?
>
> On Fri, 7 Jun 2013, john.r.rothlisberger at accenture.com wrote:
>
> > I am currently using Xymon 4.3.0 (Yeah, I know, I need to upgrade) on Ubuntu
> 12.04LTS.
> >
> > I am writing a perl script to parse my configuration and send it in a
> > spreadsheet format. I have been able to get through most everything but I want
> to include who gets alerted (or what scripts). But, I have not found an easy way to
> do this from the command line. Has anyone else tried this or have ideas?
> >
> > I have tried using wget to get configreport.sh and then html2text but
> > this is not easily parsed either. This cannot be done by just grepping through the
> alerts.cfg file as a host may be defined in multiple rules (HOST=*server*,
> HOST=testserver, PAGE=TEST, etc).
> >
>
>
> Hi !
>
> Maybe you find somthing useful on this side
>
> http://sourceforge.net/apps/mediawiki/xymon/index.php?title=Perl_Library_Discuss
> ion
>
> .. by the way, i'm interesting for your script :-)
>
> cheers,
>
> Martin

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

______________________________________________________________________________________

www.accenture.com

_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130607/26290b2f/attachment.html>


More information about the Xymon mailing list