Alert info being truncated by Hipchat notfications.
Re: Alert info being truncated by Hipchat notfications.
XI R2.7 running on CentOS 6.5
Re: Alert info being truncated by Hipchat notfications.
If you edit your /usr/local/nagios/var/status.dat file and find the service in there, which portion is the Cert_02.crt showing up in, plugin_output or long_plugin_output?
Can you post a sanitized screenshot?
Can you post a sanitized screenshot?
Re: Alert info being truncated by Hipchat notfications.
It's using long_plugin_output in the /usr/local/nagios/var/status.dat and here you go:
You do not have the required permissions to view the files attached to this post.
Re: Alert info being truncated by Hipchat notfications.
Please attach the latest notification template you are using.
Re: Alert info being truncated by Hipchat notfications.
Here is the hipsaint template for hipchat intergration:
Here is the email template.
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>
"""
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}
Code: Select all
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
%serviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Alert info being truncated by Hipchat notfications.
Is the "Allow HTML Tags in Host/service Status" check-box selected under the "System Settings" (Admin->Manage System Config)?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Alert info being truncated by Hipchat notfications.
I've never used hipsaint but my assumption is that something like this would work:
*** Notice the {longserviceoutput} I've added under the service_template, you can add it anywhere you want, I'm just showing you an example.
If you want the long_output in the email, this is how your template would look:
*** Notice the %longserviceoutput% I've added, you can add it anywhere you want, I'm just showing you an example.
Edit: Here is the list of standard macros that you can use - https://assets.nagios.com/downloads/nag ... olist.html
*** Notice the {longserviceoutput} I've added under the service_template, you can add it anywhere you want, I'm just showing you an example.
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} {longserviceoutput}</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}If you want the long_output in the email, this is how your template would look:
*** Notice the %longserviceoutput% I've added, you can add it anywhere you want, I'm just showing you an example.
Code: Select all
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
%serviceoutput%
%longserviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%Re: Alert info being truncated by Hipchat notfications.
Using %longserviceoutput% doesn't help:
***** Nagios Monitor XI Alert *****
Notification Type: PROBLEM
Service: check_certs_ns_PROD
Host: <HOST>
Address: <IP_ADDRESS>
State: CRITICAL
Date/Time: Tue Aug 25 13:37:48 GMT 2015
Additional Info:
Critical Cert_01.crt will expire in 0 days
Here is the Template I'm using for email (Hipsaint template requires some coding on the back end to update so we'll just focus on email as it's a built in function)
***** Nagios Monitor XI Alert *****
Notification Type: PROBLEM
Service: check_certs_ns_PROD
Host: <HOST>
Address: <IP_ADDRESS>
State: CRITICAL
Date/Time: Tue Aug 25 13:37:48 GMT 2015
Additional Info:
Critical Cert_01.crt will expire in 0 days
Here is the Template I'm using for email (Hipsaint template requires some coding on the back end to update so we'll just focus on email as it's a built in function)
Code: Select all
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
%longserviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Alert info being truncated by Hipchat notfications.
Let's try this to make sure that the template is actually being applied:
Try this template, have it generate an email, see if the text Long: is even shown in the email.
Try this template, have it generate an email, see if the text Long: is even shown in the email.
Code: Select all
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info: %serviceoutput%
Long: %longserviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%Re: Alert info being truncated by Hipchat notfications.
Something isn't adding up. Your template shows ***** Nagios XI Alert ***** but the email you receive shows ***** Nagios Monitor XI Alert ***** which is defined by the notify-host-by-email command. You likely need to make your contact use the xi_host_notification_handler and xi_service_notification_handler commands in the CCM, and the changes will take effect.
Former Nagios employee