Running latest XI on CentOS6. As of now, I've been creating a user account for each person I want to sent notifications to, but I'm realizing this is just asking for a security risk since alot of these 'users' don't need access to XI and only want the email notifications.
I've modified xi_host_notification_handler to have all of the fields I'd like, and formatted the notifications via the user settings. This part is OK.
With notify-host-by-email, I'm not able to get the formatting the same as xi_host_notification handler. Wondering if I could get a hand in getting for formatting correct?
xi_host_notification_handler
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --notes="$HOSTNOTES$" --hostgroup="$HOSTGROUPNAME$" --hostgroupnotes="$HOSTGROUPNOTES$" --hostgroupnotesurl="$HOSTGROUPNOTESURL$" --hostgroupalias="$HOSTGROUPALIAS$"
Code: Select all
***** Empire Monitoring Alert *****
Nagios has detected a problem with this host.
Notification Type: PROBLEM
Customer Information:
Hostgroup: Linux Servers
Site Address: Linux Servers
Sharepoint URL:
Notes:
Host Information:
Host: hostname
State: DOWN
Address: 192.168.10.10
Info: CRITICAL - 192.168.10.10: rta nan, lost 100%
Date/Time: 2015-12-28 11:49:50
Respond: respond-url
Nagios URL: url-to-xi
Code: Select all
/usr/bin/printf "%b" "***** Empire Monitoring Alert *****\n\nComments: $NOTIFICATIONCOMMENT$\n\nNotification Type: $NOTIFICATIONTYPE$\n\nCustomer Information:\nHostgroup: $HOSTGROUPNAME$ \nSite Address: $HOSTGROUPALIAS$ \nSharepoint URL: $HOSTGROUPNOTESURL$ \nNotes: $HOSTGROUPNOTES$\n\nHost Information:\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
If you can think of a simpler way, I'm definitely open to it! We don't have the 'Enterprise' version of XI.