Difference between revisions of "Icinga2 - Notification Scripts for Notificiation on Twitter through Twidge"
(Created page with "Twidge must be installed and configured. In Icinga2: You have to configure notification templates and apply it also. <br> === Service notification script /etc/icinga2/scripts/...") |
(No difference)
|
Revision as of 03:14, 11 October 2019
Twidge must be installed and configured. In Icinga2: You have to configure notification templates and apply it also.
Service notification script /etc/icinga2/scripts/twitter-service-notification.sh
#!/bin/bash if [ $NOTIFICATIONTYPE = 'CUSTOM' ] then /bin/echo "#$NOTIFICATIONTYPE - Service $SERVICEDISPLAYNAME. $NOTIFICATIONCOMMENT" | twidge -c /etc/icinga2/twidgerc update else if [ "$SERVICESTATE" = 'UP' ] || [ "$SERVICESTATE" = 'OK' ] then /bin/echo "#$NOTIFICATIONTYPE - SERVICE #$SERVICEDISPLAYNAME is $SERVICESTATE. Sorry for any inconvenience." | twidge -c /etc/icinga2/twidgerc update else /bin/echo "#$NOTIFICATIONTYPE - SERVICE #$SERVICEDISPLAYNAME on #$HOSTALIAS is $SERVICESTATE. Will be fixed." | twidge -c /etc/icinga2/twidgerc update fi fi
Host notification script /etc/icinga2/scripts/twitter-host-notification.sh
- !/bin/sh
if [ $NOTIFICATIONTYPE = 'CUSTOM' ] then
/bin/echo "#$NOTIFICATIONTYPE - Server $HOSTALIAS. $NOTIFICATIONCOMMENT" | twidge -c /etc/icinga2/twidgerc update
else
if [ "$SERVICESTATE" = 'UP' ] || [ "$SERVICESTATE" = 'OK' ] then /bin/echo "#$NOTIFICATIONTYPE - SERVER #$HOSTALIAS is $HOSTSTATE. Sorry for any inconvenience." | twidge -c /etc/icinga2/twidgerc update else /bin/echo "#$NOTIFICATIONTYPE - SERVER #$HOSTALIAS is $HOSTSTATE. Will be fixed." | twidge -c /etc/icinga2/twidgerc update fi
fi