Send your Nagios notices to HipChat Room
- Login to www.hipchat.com with a Admin Account.
- Add an Integration
- Copy your Room-ID and Auth_Token
- Install the Script.
$ cd ~
$ git clone https://github.com/svenkuegler/notify-by-hipchat.git
Notice! This is only an Example. You allready can upload the script to any other Location.
-
Edit the script notify-by-hipchat and add your Auth_Token and Room-ID.
-
Add the following lines to your commands.cfg
# 'notify-host-by-hipchat' command definition
define command{
command_name notify-host-by-hipchat
command_line /bin/echo "Notification Type: $NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /home/ubuntu/notify-by-hipchat/notify-by-hipchat $HOSTSTATE$ "Host"
}
# 'notify-service-by-hipchat' command definition
define command{
command_name notify-service-by-hipchat
command_line /bin/echo "Notification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /home/ubuntu/notify-by-hipchat/notify-by-hipchat $SERVICESTATE$ "Service"
}
- Add the HipChat Command to your contact.cfg.
For Example:
define contact{
name generic-contact
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email,notify-service-by-hipchat
host_notification_commands notify-host-by-email,notify-host-by-hipchat
register 0
service_notification_period 24x7
host_notification_period 24x7
}