Page 1 of 1

How to Alert using 'Execute Script' feature?

Posted: Wed Sep 09, 2015 11:31 am
by cowboyrx
Are there any sample scripts available and any documentation on how to use this feature, such as which variables that can be used for alerting?
Goal is to send an email/sms alert that contains the message, logsource, timestamp, etc that triggered the alert. The default 'email users' option is very generic and makes the recipient log into the dashboard to look at the alert.

Re: How to Alert using 'Execute Script' feature?

Posted: Wed Sep 09, 2015 11:51 am
by jolson
cowboyrx,

This is one of our most highly requested features - and one that there is a feature request in place for. Our macros currently support only what you see in the email, and are as follows:
count - The total # of events
status - The status (ok, warning, critical)
output - The output from the alert
lastrun - The timestamp of the last run
What would you like to see specifically? I assume you'd like to bind macros to particular fields in Nagios Log Server? For instance:

fieldhost - The value of the 'host' field.
fieldip - The value of the 'ip' field.
etc.

Is my above statement accurate?

Re: How to Alert using 'Execute Script' feature?

Posted: Fri Sep 11, 2015 9:10 am
by cowboyrx
Need the following:
1. Sample scripts and documentation on how to use this feature
2. Future release/update should provide an option to include all fields (message, logsource, program, timestamp, etc) that triggered the alert, so the alerted email recipient does not have to log into the dashboard to view the alert.

When is the ETA on the feature update/next release?

Re: How to Alert using 'Execute Script' feature?

Posted: Fri Sep 11, 2015 11:51 am
by tmcdonald
cowboyrx wrote:1. Sample scripts and documentation on how to use this feature
The scripts can be anything you want, whether it's bash, perl, python, compiled C, or just about anything else you can think of. We don't have any sample scripts for this, because there really are not many limitations on what can be done - if you can script it, you can run it. As far as documentation goes, it is covered somewhat in this doc:

https://assets.nagios.com/downloads/nag ... Server.pdf

cowboyrx wrote:2. Future release/update should provide an option to include all fields (message, logsource, program, timestamp, etc) that triggered the alert, so the alerted email recipient does not have to log into the dashboard to view the alert.

When is the ETA on the feature update/next release?
This is definitely on our radar, however I don't have an ETA for this specific request, nor for the next Logserver release. The release cycle is up to the developers, and we don't have any control over that.