This script is provided to help administrators monitor their Zenoss instance.
- Add zenactiond functionality to synthetic check
./zenossMonitoring.py -h usage: zenossMonitoring.py [-h] [-v] [-s] [-q] [-e EVID] [-t] [-c] zenossMonitoring script for monitoring event handling in Zenoss. http://wiki.zenoss.org/Monitoring_Zenoss optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -s, --synthetic perform synthetic check -q, --queue perform rabbitmq queue check -e EVID, --event EVID perform event check on pre-existing event -t, --transform print out transform -c, --create create event for pre-existing event check
- Python 2.7
- argparse module
- requests module
You will need to either edit the global variables within the script to match your environment. Or import the classes/methods and pass the proper arguments.
Monitoring queues in RabbitMQ
Monitoring for common symptoms of problems with an application can be very helpful. Especially when many issues have one common symptom.
Looking for backed up queues in RabbitMQ is one of those symptoms.
Here are a few issues that will cause queues to back up:
- Slow or bad transform
- Stopped daemons:
- Deadlocked ZenDS/MySql
For this reason, it is important to monitor the queues within RabbitMQ.
There are three queues that are critical to Zenoss event flow:
See Queue Troubleshooting for more information on Zenoss queues.
Monitoring the queues:
This will also print out performance data
Everything OK! | zenoss.queues.zep.rawevents=0 zenoss.queues.zep.signal=0 zenoss.queues.zep.zenevents=0
There are two synthetic type checks for monitoring events.
First is a pre-existing event check. This will send API calls to Zenoss to acknowledge and unacknowledge an event. This will verify that the following is up and running in some capacity.
Monitoring a pre-existing event:
./zenossMonitoring.py -e 005056b9-4bf4-8754-11e6-17b8c881cd54
You can also use the script to create a template event to use for the pre-existing event check.
./zenossMonitoring.py -c Event ID to use for pre-existing event check: 005056b9-4bf4-8754-11e6-17b8c881cd54
The second is a more synthetic check.
- This will open a new event
- Find the event created
- Check the event was modified by the transform
- Close the event
- Verify the event was closed
This will verify that the following is up and running in some capacity:
You will need to have a transform put in place for this to work properly. the transform can be retrived from the script.
./zenossMonitoring.py -t Under Event Class /App/Zenoss, add the following transform: if hasattr(evt, 'device') and hasattr(evt, 'component'): if (evt.device == 'localhost' and evt.component == 'zenossMonitoring' and 'Synthetic Zenoss event check' in evt.summary): evt.message = '%s\n%s' % (evt.summary, 'Transform worked.')