Home > Centreon, HowTo, Linux, plugins > Nagios Notify html Script

Nagios Notify html Script

September 29th, 2016 Leave a comment Go to comments

The default notification script for nagios is very simple, why not get more information on the email. Like: hostgroup, how long has the problem happened, link to the possible documentation. And format it in a nice html table.

To work, create two new commands at:
Centreon>Configuration>Commands>Notifications>

The host notifiy command must have this definition:
$USER1$/notify_host “$NOTIFICATIONTYPE$” “$HOSTNAME$” “$HOSTALIAS$” “$HOSTSTATE$” “$HOSTADDRESS$” “$HOSTOUTPUT$” “$SHORTDATETIME$” “$SERVICEDESC$” “$SERVICESTATE$” “$CONTACTEMAIL$” “$TOTALHOSTSUP$” “$TOTALHOSTSDOWN$” “$HOSTNOTESURL$” “$HOSTGROUPNAME$” “$HOSTDURATIONSEC$” $HOSTEXECUTIONTIME$

The service notifiy command must have this definition:
$USER1$/notify_service “$NOTIFICATIONTYPE$” “$HOSTNAME$” “$HOSTALIAS$” “$HOSTSTATE$” “$HOSTADDRESS$” “$SERVICEOUTPUT$” “$SHORTDATETIME$” “$SERVICEDESC$” “$SERVICESTATE$” “$CONTACTEMAIL$” “$SERVICEDURATIONSEC$” “$SERVICEEXECUTIONTIME$” “$TOTALSERVICESWARNING$” “$TOTALSERVICESCRITICAL$” “$TOTALSERVICESUNKNOWN$” “$LASTSERVICEOK$” “$LASTSERVICEWARNING$” “$SERVICENOTIFICATIONNUMBER$” “$HOSTNOTESURL$” “$SERVICENOTESURL$” “$HOSTGROUPNAME$”

The code for Host:

The code for Service:

The one thing I still could not do was to link it to a Acknowledge Page, unfortunally with centreon there is no such page as there is with nagios.

  1. No comments yet.
  1. No trackbacks yet.
What is 6 + 7 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

*