diff --git a/roles/nagios_server/files/nagios/contacts/fedmsg.cfg b/roles/nagios_server/files/nagios/contacts/fedmsg.cfg new file mode 100644 index 0000000000..cd577aa696 --- /dev/null +++ b/roles/nagios_server/files/nagios/contacts/fedmsg.cfg @@ -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 +} diff --git a/roles/nagios_server/files/nagios/misccommands.cfg b/roles/nagios_server/files/nagios/misccommands.cfg index e0974cdde4..eb6e4362c6 100644 --- a/roles/nagios_server/files/nagios/misccommands.cfg +++ b/roles/nagios_server/files/nagios/misccommands.cfg @@ -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