Wednesday, 23 March 2016

Critical Server Alert Monitoring Through Hipchat App

What is HipChat:

HipChat is a Web service for internal/private chat and instant messaging. As well as one-on-one and group/topic chat, it also features cloud-based file storage, video calling, searchable message history and inline image viewing.

How we implemented HipChat in our Environment:

1.     Signup in using common email id []

2.     Created one chat Room []. Security=private

3.     Downloaded HipChat API to one of our monitoring server [alps]

Install HipChat API:
            [alps]# mkdir /usr/local/hipchat
            [alps]# cd /usr/local/hipchat
[alps]# unzip master
[alps]# vim /etc/hipchat

Here: HIPCHAT_TOKEN = Created from HipChat.comàLoginàasàAdminàGroup AdminàAPIàEnter the Admin PasswordàUnder Create New Tokenà
            Type: Notification
            Label: italertstoken
         HIPCHAT_ROOM_ID = is Rooms->API ID
4.     Create script for monitoring in Server [alps]

root@alps /]# cat /root/scripts/
for server in
packet=`ping -c 3 -f $server | grep "packet" | awk -F% '{print $1}' | awk '{print $NF}'`

if [ $packet -eq 100 ]


/usr/local/hipchat/hipchat-cli-master/hipchat_room_message -i "$server NOT REACHABLE" -f -n @all


[root@alps /]#

5.     Schedule the Script in Cron:

###HIPCHAT alert created by Mansoor##
*/3 * * * * /bin/bash /root/scripts/ > /tmp/hipchat_alert.txt

6.     Send Invitation to Users to Join into Group: Group AdminàUsersàAdd

7.     Install Mobile App from PlayStore & Desktop App [HipChat] from website

8.     Enable the Stay connected, Room Messages, One-to-One messages, Room mentions in Mobile App

9.     Add this HipChat Mobile App into “Protected Apps”, so that it won’t go offline


 To send alert to All Room members

#/usr/local/hipchat/hipchat-cli-master/hipchat_room_message -i "$server NOT REACHABLE" -f -n @all
#echo “Server is Not Reachable” | /usr/local/hipchat/hipchat-cli-master/hipchat_room_message -f -n @all

To send alert to All Specific Room members
#echo “Server is Not Reachable” | /usr/local/hipchat/hipchat-cli-master/hipchat_room_message -f -n @mdmansoor