Mar 19, 2010 4:00 PM
Here is another script I wrote to help you find Alerting Rules
-
Like (0)
Good Afternoon my fellow Zenoss users. here I bring you another Python tool to use with Zenoss. This tool will allow you to list all of your alerting rules, either by Group, User, or Query. If you are like me and have over 100 Alerting Rules. Managing these rules are more then a pain in the butt. Especially when you create a new rule and you know you created it correctly, but it just does not work... Well you might have another conflicting rule. Well what do you do in this situation?? You can go through each rule manually and sooner or later you will find it.
You can get it here..
http://www.linuxdynasty.org/how-to-find-alerting-rules-using-the-zenoss-api.html
Here are some examples...
[zenoss@zenoss ~]$ python ZalertingRules_Manager.py --type="users" --search="asanabria"
################################################################################
Alerting Rules for asanabria
************************************************************
Alerting Rule: foo
SQL Query: severity >= 4 and eventState = 0 and prodState = 1000
Windows for Alerting Rule foo
Window: yee
Start time: Thu Mar 18 14:40:30 2010
Duration: days 0 hours 1 minutes 0
************************************************************
[zenoss@zenoss ~]$ python ZalertingRules_Manager.py --type="groups" --search="Escalation 0"
################################################################################
Alerting Rules for Escalation 0
************************************************************
Alerting Rule: Server - QA
SQL Query: (prodState = 1000) and (deviceClass like '/Server/Linux/QA Servers%') and (eventState = 0) and (severity >= 4)
************************************************************
Alerting Rule: Email - Downgrade
SQL Query: (prodState = 1000) and (eventClass like '/App/Email/Downgrade%') and (eventState = 0) and (severity >= 4)
************************************************************
Alerting Rule: Email - Job Alerts
SQL Query: (prodState = 1000) and (eventClass like '/App/Email/Job Alerts%') and (eventState = 0) and (severity >= 4)
Windows for Alerting Rule Email - Job Alerts
Window: 0700-0701
Start time: Sat Mar 13 07:00:00 2010
Duration: days 0 hours 0 minutes 1
***********************************************************[zenoss@zenoss ~]$ python ZalertingRules_Manager.py --type="query" --search="/App/Log/Java"
################################################################################
Owner = App - Tomcat
Alerting Rule Tomcat Java Log
Matching Query = (prodState = 1000) and (eventClassKey not like '%Java Self Axis Scorer Infinite Loop%') and (eventState = 0) and (severity >= 3) and (eventClass like '/App/Log/Java/US/')
Window: 0100-2355
Start time: Thu Mar 18 01:00:00 2010
Duration: days 0 hours 22 minutes 55
************************************************************
################################################################################
Owner = Java Self Axis Scorer Infinite Loop
Alerting Rule Java Self Axis Scorer Infinite Loop
Matching Query = (prodState = 1000) and (eventClassKey like '%Java Self Axis Scorer Infinite Loop%') and (deviceClass like '/Server/Linux/Tomcat/%') and (eventClass like '/App/Log/Java/%') and (eventState = 0) and (severity >= 3)
If this could be wrapped in a report like the Event Transforms Report ZenPack that would be very useful.
I will give it a try. I have not created a Report in a while. Also I forgot to mention where this script really help me... It helped me find all my alerting rules that have schedules assigned to them. This was especially important because of the DST change.
Was not able to download the program.
Were you logged into http://linuxdynasty.org ? You have to be logged in to download it. I just logged in and downloaded the script just fine.
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||