etsy / nagios-herald

Add context to Nagios alerts
https://codeascraft.com/2014/06/06/introducing-nagios-herald/
MIT License
321 stars 32 forks source link

Where can one view the code for /usr/local/nagios-herald/bin/nagios-herald #51

Closed og-bash-scripts closed 4 years ago

og-bash-scripts commented 5 years ago

Hello community,

I am trying to review the nagios.cmd file on how the output of the npre commands are formated.

you mention the following on https://github.com/etsy/nagios-herald/blob/master/docs/nagios-config.md

NOTE: $_HOSTMESSAGE_FORMATTER_NAME$ and $_SERVICEMESSAGE_FORMATTER_NAME$ are Nagios macros, generated from a custom variable in a relevant service check definition.

It looks like the file is located here: /usr/local/nagios-herald/bin/nagios-herald

I am trying to review how the nagios-hearld parses the output of a command that is ran on the targeted monitored server with the npre and how that output is formatted and fed into the email body.

thanks in advance.

RyanFrantz commented 5 years ago

This is done by adding a custom variable in a Nagios defintion like the example in https://github.com/etsy/nagios-herald/blob/master/docs/nagios-config.md#service-configuration

For example $_SERVICEMESSAGE_FORMATTER_NAME$ is generated by Nagios as a result of having a custom variable called _message_formatter_name in a Nagios service definition.