Alert info being truncated by Hipchat notfications.
Posted: Thu Aug 20, 2015 11:39 am
Running into the following issue.
On the Nagios Core page the alert is showing as
My question is, is <pre>{serviceoutput}</pre> supposed to be populated with all the info or are there other variables that need to be added like <pre>{serviceoutput_2}</pre> for example.
On the Nagios Core page the alert is showing as
However when the notification comes through via hipchat it truncates the second value:Status Information: Critical Cert "cert_1" will expire in 0 days
Critical Cert "cert_2" will expire in 0 days
Here is the template for the notification:Thu Aug 20 16:30:57 GMT 2015 - check_certs_ns_PROD on SOME_HOST (nagios@nagios01)
Type: PROBLEM
Host: SOME_HOST (SOME_IP)
State: CRITICAL
Info:
Critical Cert "cert_1" will expire in 0 days
Info:
Critical Cert "cert_1" will expire in 0 days
Code: Select all
"""
Templates used to build hipchat api payloads
"""
host_template = """
<strong>{timestamp} - {hostname} (nagios@{nagios_host})</strong><br/>
<strong>Type:</strong> {ntype}<br/>
<strong>Host:</strong> {hostname} (<a href="{hostaddress}">{hostaddress}</a>)<br/>
<strong>State:</strong> {state}<br>
<strong>Info:</strong>
<pre>{hostoutput}</pre>
"""
host_medium_template = "<strong>{timestamp} - {hostname} ({hostaddress}) - {ntype}/{state}</strong><br/><pre>{hostoutput}</pre>"
host_short_template = """[{ntype}] {hostname}: {hostoutput}"""
service_template = """
<strong>{timestamp} - {servicedesc} on {hostalias} (nagios@{nagios_host})</strong><br/>
<strong>Type:</strong> {ntype}<br/>
<strong>Host:</strong> {hostalias} (<a href="{hostaddress}">{hostaddress}</a>)<br/>
<strong>State:</strong> {state}<br/>
<strong>Info:</strong>
<pre>{serviceoutput}</pre>
<strong>Info:</strong>
<pre>{serviceoutput}</pre>
"""
service_medium_template = "<strong>{timestamp} - {servicedesc} on {hostalias} ({hostaddress}) - {ntype}/{state}</strong><br/><pre>{serviceoutput}</pre>"
service_short_template = "[{ntype}] {hostalias} {servicedesc}: {serviceoutput}"
templates = {'host': host_template, 'medium-host': host_medium_template, 'short-host': host_short_template,
'service': service_template, 'medium-service': service_medium_template, 'short-service': service_short_template}