Mar 18, 2013 11:17 PM
Custom Monitoring Template Not Working.
-
Like (0)
Hello everyone,
I have created a bash script to be used by a monitoring template.
I have created a monitoring template and locally binded it to a device in zenoss.
I then added a datasource of type "command".
The command template then points to the bash script that I have created.
Manually running the scripts shows that it is doing good.
I have also tested it via zentestcommand (with the option "-t 120") and it also returns the correct output.
Sample outputs:
- OK All hosts are valid. |
- Error Some hosts are not existing. |
What matters to me right now are the summary values of the output.
However, in the monitoring template, the command doesn't seem to be executed.
No alerts were generated.
The behavior I want is for zenoss to raise an alert when the output is -> "Error Some hosts are not existing |"
Your help and advices would greatly be appreciated.
Thanks,
Daniel
Daniel:
Is your bash script passing an exit code for the event severity? That's how the severity is communicated to zenoss by nagios type plugins.
Best,
--Shane Scott (Hackman238)
SWS Consulting / Rackspace Hosting
Hello Shane,
Thanks for the reply, but I have already used exit codes
- exit 0 for OK output
- exit 1 for ERROR output
When testing via zencommand, it does seem ok. It does seem to get the exit code 1 on ERROR output.
But still no alerts are comming out from zenoss events console.
Here is the output of zencommand:
2013-03-20 07:02:23,073 DEBUG zen.zencommand: Received exit code: 1
2013-03-20 07:02:23,073 DEBUG zen.zencommand: Command: '/bin/sh -c exec /usr/local/zenoss/zenoss/libexec/<the command script and parameters are here>'
2013-03-20 07:02:23,073 DEBUG zen.zencommand: Output: 'ERROR invalid_hosts=<hosts are listed here separated by comma>|\n'
2013-03-20 07:02:23,074 DEBUG zen.zencommand: Process <script and parameters are here> stopped (1), 45.60 seconds elapsed
2013-03-20 07:02:23,074 DEBUG zen.zencommand: The result of "/usr/local/zenoss/zenoss/libexec/<the command script and parameters are here>" was "'ERROR invalid_hosts=<hosts are listed here separated by comma>|\n'"
2013-03-20 07:02:23,075 DEBUG zen.zencommand: Queueing event {'severity': 5, 'performanceData': [''], 'component': 'Test-Leo', 'agent': 'zencommand', 'summary': 'ERROR invalid_hosts=<hosts are listed here seperated by comma>', 'manager': 'zenoss01', 'eventKey': 'haproxy_hosts_check', 'device': '<device name>', 'message': 'ERROR invalid_hosts=<hosts are listed here separated by comma>|\n', 'eventClass': '/Config', 'monitor': 'localhost'}
2013-03-20 07:02:23,075 DEBUG zen.zencommand: Total of 1 queued events
2013-03-20 07:02:23,076 DEBUG zen.zencommand: Sent a 'stop' event
2013-03-20 07:02:23,137 DEBUG zen.zencommand: stop() called when not running
2013-03-20 07:02:23,138 INFO zen.zencommand: Daemon zencommand shutting down
2013-03-20 07:02:23,138 DEBUG zen.zencommand: Removing service EventService
2013-03-20 07:02:23,138 DEBUG zen.zencommand: Removing service CommandConfig
Sorry for the notes inclosed within '<' and '>', they are sensitive informations so I have to hide them.
Well, it's clearly queuing the event properly. Are you seeing issues with other events being generated as well or just with that specific event? Do you have any event transforms/mapping that might act on that event and cause it to drop? Is the event visible in the event history or archive?
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||