Donnerstag, 6. März 2014

icinga notification chat to chatroom

define command{
        command_name                    notify-host-by-jabber
        command_line                    /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\nKOMMENTAR: $NOTIFICATIONCOMMENT$\nHost: $HOSTNAME$\nHostalias: $HOSTALIAS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nHostInfo: https://internallog.server.domain?q=$HOSTNAME$\nIcingaInfo: https://icinga.server.domain/icinga/cgi-bin/extinfo.cgi?type=1&host=$HOSTNAME$\n\nDate/Time: $SHORTDATETIME$\n" | /bin/sendxmpp -u chatuser -j jabber.server.domain -p 'jabberuserpassword' -c room@conference.jabber.server.domain -r chatuser 

}

see:
http://docs.icinga.org/latest/de/sample-notifications.html

environment:
Server: icinga + ejabberd (chatserver) + sendxmpp
Client: pidgin, apple-ichat


idea: you can also put a similar script on an webserver and forward the query-string to the chatroom!

echo -e “hello world” | /usr/bin/sendxmpp -u chatuser -j jabber.server.domain -p ‘jabberuserpassword’ -c room@conference.jabber.server.domain

Keine Kommentare: