Try out fedmsg notifications for nagios.

This commit is contained in:
Ralph Bean 2015-12-14 19:50:54 +00:00
parent 4182bef0dc
commit 2fd0c966ad
2 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,10 @@
define contact{
contact_name fedmsg
alias BUS
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-fedmsg
host_notification_commands host-notify-by-fedmsg
}

View file

@ -77,14 +77,24 @@ define command{
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nSource: $$(hostname)\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
# 'notify-by-ircbot' command definition
define command{
command_name notify-by-ircbot
command_line /usr/bin/printf "%b" "#fedora-noc $NOTIFICATIONTYPE$ - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$: $SERVICEOUTPUT$ ($$(hostname -s)) $HOSTACKAUTHOR$ $SERVICEACKAUTHOR$" | /usr/local/bin/irc-colorize.py | nc -w 1 value01 5050
}
# 'host-notify-by-fedmsg' command definition
define command{
command_name host-notify-by-fedmsg
command_line /usr/bin/echo {"type": "$NOTIFICATIONTYPE$", "host": "$HOSTALIAS$", "state": "$HOSTSTATE$", "host_ack_author": "$HOSTACKAUTHOR$", "service_ack_author": $SERVICEACKAUTHOR$"} | fedmsg-logger --cert-prefix nagios --modname nagios --topic host.state.change
}
# 'notify-by-fedmsg' command definition
define command{
command_name notify-by-fedmsg
command_line /usr/bin/echo {"type": "$NOTIFICATIONTYPE$", "host": "$HOSTALIAS$", "state": "$SERVICESTATE$", "host_ack_author": "$HOSTACKAUTHOR$", "service_ack_author": $SERVICEACKAUTHOR$"} | fedmsg-logger --cert-prefix nagios --modname nagios --topic service.state.change
}
# 'notify-by-xmpp' command definition
#define command{
# command_name notify-by-xmpp