config report from command line?
list John Rothlisberger
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). Thanks, John Upcoming PTO: None John Rothlisberger IT Strategy, Infrastructure & Security - Technology Growth Platform TGP for Business Process Outsourcing Accenture XXX.XXX.XXXX office 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
list Martin Flemming
▸
On Fri, 7 Jun 2013, user-7adce57665bb@xymon.invalid 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_Discussion .. by the way, i'm interesting for your script :-) cheers, Martin
list John Rothlisberger
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
XXX.XXX.XXXX 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, user-7adce57665bb@xymon.invalid wrote:I am currently using Xymon 4.3.0 (Yeah, I know, I need to upgrade) on Ubuntu12.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,
MartinThis 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
list David Mills
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 (XXX) XXX-XXXX
▸
From: Xymon [xymon-bounces at xymon.com] on behalf of user-7adce57665bb@xymon.invalid [user-7adce57665bb@xymon.invalid]
Sent: Friday, June 07, 2013 12:37 PM
To: user-f286aaa49a76@xymon.invalid; 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
XXX.XXX.XXXX 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, user-7adce57665bb@xymon.invalid wrote:I am currently using Xymon 4.3.0 (Yeah, I know, I need to upgrade) on Ubuntu12.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.
list Jeremy Laidman
▸
On 7 June 2013 23:24, <user-7adce57665bb@xymon.invalid> wrote:
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?
What about using the xymond_alert tool. You can give it a "--dump-config"
switch to - well - dump the config. Also, you can use the "--test" switch
to display all scripts tied to a given host/test combination.
J
list John Rothlisberger
I have explored xymond_alert and unless you know something I don't it lacks the information that I am looking for. For example, if I do: xymond_alert --test webserver1 conn --color=red --duration=620 --cfid|grep -v Failed The only semi-useful line is: 00003412 2013-06-14 08:19:33 *** Match with 'PAGE=%.*/ORD EXPAGE=%.*/ORD_DEV EXHOST=app1,app2,db1,db2 EXSERVICE=virtuals COLOR=red,yellow' *** It does not include the actual actions to be performed that are contained within that match. For this particular page match, I have 4 separate scripts that can be run: - If SERVICE=cpu & COLOR=red - If COLOR=red & EXSERVICE=cpu,virtuals,procs <<-- This one should be matched/run - If SERVICE=procs & COLOR=red - Match all <<- This one should be matched/run None of the details of what is actually done are displayed. I know that Xymon can do all of this because, well, it does. But how can I parse it out via command line?
▸
Thanks,
John
Upcoming PTO: None
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
XXX.XXX.XXXX office
▸
From: Jeremy Laidman [mailto:user-71895fb2e44c@xymon.invalid]
Sent: Thursday, June 13, 2013 10:28 PM
To: Rothlisberger, John R.
Cc: xymon at xymon.com
Subject: Re: [Xymon] config report from command line?
On 7 June 2013 23:24, <user-7adce57665bb@xymon.invalid<mailto:user-7adce57665bb@xymon.invalid>> wrote:
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?
What about using the xymond_alert tool. You can give it a "--dump-config" switch to - well - dump the config. Also, you can use the "--test" switch to display all scripts tied to a given host/test combination.
J
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