nagios alert messages not appearing in hipchat chat window.

Hi,

Thanks for the reply. I have put the below entries in nagios commands.cfg file I am running Nagios 3.4.4 on CentOS 6.4.

define command {
command_name notify-host-by-hipchat
command_line /usr/bin/hipsaint
--token=c29bab160e8e6a4f3ca39ba6fe7c1d --room=67307 --type=host
--inputs="$HOSTNAME$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$HOSTSTATE$|$HOSTOUTPUT$"
-n
}
define command {
command_name notify-service-by-hipchat
command_line /usr/bin/hipsaint
--token=c29bab160e8e6a4f3ca39ba6fe7c1d --room=67307 --type=service
--inputs="$SERVICEDESC$|$HOSTALIAS$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$SERVICESTATE$|$SERVICEOUTPUT$"
-n
}

I am unable to see any nagios alert messages in hipchat window. Please let me know if anyone needs more information.

Regards,

Kaushal

3 answers

/usr/bin/hipsaint --token=c29bab160e8e6a4f3ca39ba6fe7c1d --room=67307 --type=service --inputs="$SERVICEDESC$|$HOSTALIAS$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$SERVICESTATE$|$SERVICEOUTPUT$"
when i run the below command replacing all macros, I get the below issue.
[nagios@nagios ~]$ id
uid=502(nagios) gid=502(nagios) groups=502(nagios),503(nagcmd)
[nagios@nagios ~]$ /usr/bin/hipsaint --token=c29bab160e8e6a4f3ca39ba6fe7c1d --room=67307 --type=service --inputs="Main Website solr Wed Jul 31 20:42:28 IST 2013 Recovery 192.168.70.15 Recovery Ping OK"
Traceback (most recent call last):
File "/usr/bin/hipsaint", line 9, in <module>
load_entry_point('hipsaint==0.4', 'console_scripts', 'hipsaint')()
File "/usr/lib/python2.6/site-packages/hipsaint-0.4-py2.6.egg/hipsaint/bin/commands.py", line 55, in main
msg.deliver_payload()
File "/usr/lib/python2.6/site-packages/hipsaint-0.4-py2.6.egg/hipsaint/messages.py", line 29, in deliver_payload
message_body = self.render_message()
File "/usr/lib/python2.6/site-packages/hipsaint-0.4-py2.6.egg/hipsaint/messages.py", line 56, in render_message
servicedesc, hostalias, timestamp, ntype, hostaddress, state, serviceoutput = self.inputs.split('|')
ValueError: need more than 1 value to unpack
[nagios@nagios ~]$
Please suggest further

Hello Kaushal,

Author of the nagios hipchat python library here. You're getting this error message because you're missing pipes | as separators between each variable.

It should look like this:

hipsaint --token=[INSERT TOKEN] --room=[INSERT ROOM ID] --type=service --inputs="Main Website|solr|Wed Jul 31 20:42:28 IST 2013|RECOVERY|192.168.70.15|OK|Ping OK"

Good luck!

I receive a similar trace as well:

 

 File "/bin/hipsaint", line 11, in <module>

    sys.exit(main())

  File "/usr/lib/python2.7/site-packages/hipsaint/bin/commands.py", line 78, in main

    msg.deliver_payload()

  File "/usr/lib/python2.7/site-packages/hipsaint/messages.py", line 68, in deliver_payload_v1

    raw_response = urlopen(self.urlv1, message_params)

  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen

    return opener.open(url, data, timeout)

  File "/usr/lib64/python2.7/urllib2.py", line 437, in open

    response = meth(req, response)

  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response

    'http', request, response, code, msg, hdrs)

  File "/usr/lib64/python2.7/urllib2.py", line 475, in error

    return self._call_chain(*args)

  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain

    result = func(*args)

  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default

    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

urllib2.HTTPError: HTTP Error 401: Unauthorized

 

 

Any resolution on this?

 

Thanks,

 

Jared

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 10, 2018 in Hipchat

What should I think about when migrating HipChat to Slack?

...from the beginning. We have built up a lot of content in HipChat, with it being a core tool in our distributed company model. While it is true that we didn’t need to move to Slack immediately, we felt it...

496 views 1 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you