Service Check Output - Not displaying all lines of output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scomdco
Posts: 45
Joined: Fri Oct 04, 2019 3:18 pm

Service Check Output - Not displaying all lines of output

Post by scomdco »

In Nagios XI, the output message field/box(?) will not display all the output of the check's script that ran. This was not an issue in Nagios Core and it'd be great to know if there is a way to modify how much text that box will display.

I have to redact most of the info, but hopefully you can see in this picture how the message is cut off within the second line. Each line is using a break code, and realistically there is 4 lines that should be displaying.
Annotation 2019-11-22 144346.png
Also, and i'll create a seperate thread if needed. The email alerts we receive are not acknowledging any html code we have. Within Nagios XI it's acknowledging the code successfully as shown in the above screenshots. It'd be great to know if there is a way for emails to acknowledge the html code as well, especially if the output message field/box within XI can't be modified.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Check Output - Not displaying all lines of outpu

Post by scottwilkerson »

Can you show the results of the following run from the CLI

Code: Select all

echo "desc nagios_servicestatus;"|mysql -pnagiosxi nagios|grep output
The commands end with -pnagiosxi where nagiosxi is the default password. If you have changed your database password you'll need to change the command to reflect this.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scomdco
Posts: 45
Joined: Fri Oct 04, 2019 3:18 pm

Re: Service Check Output - Not displaying all lines of outpu

Post by scomdco »

Sure thing, here you go:

Code: Select all


output  varchar(255)    NO
long_output     text    NO              NULL

scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Check Output - Not displaying all lines of outpu

Post by scottwilkerson »

I think you are getting cut-off ate the 255 chars

Run the following on the server and it should increase the size of the output fields

Code: Select all

echo "use nagios;alter table nagios_servicestatus modify output varchar(65535) not null;alter table nagios_servicestatus modify long_output TEXT not null;alter table nagios_servicestatus modify perfdata TEXT not null;" | mysql -pnagiosxi

echo "use nagios;alter table nagios_hoststatus modify output varchar(65535) not null;alter table nagios_hoststatus modify long_output TEXT not null;alter table nagios_hoststatus modify perfdata TEXT not null;" | mysql -pnagiosxi

echo "use nagios;alter table nagios_servicechecks modify output varchar(65535) not null;alter table nagios_servicechecks modify long_output TEXT not null;alter table nagios_servicechecks modify perfdata TEXT not null;" | mysql -pnagiosxi

echo "use nagios;alter table nagios_hostchecks modify output varchar(65535) not null;alter table nagios_hostchecks modify long_output TEXT not null;alter table nagios_hostchecks modify perfdata TEXT not null;" | mysql -pnagiosxi
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scomdco
Posts: 45
Joined: Fri Oct 04, 2019 3:18 pm

Re: Service Check Output - Not displaying all lines of outpu

Post by scomdco »

Thank you Scott! I've applied the change and i see the full output is displaying now, this is much appreciated.

If i needed to revert the change, or modify how many characters i'd want to allow, then i would just edit the number with the parenthesis, correct? If not let me know. If it is correct, and just for informational purposes, is 65535 the max number of characters that can be allowed?

echo "use nagios;alter table nagios_hostchecks modify output varchar(255) not null;alter table nagios_hostchecks modify long_output TEXT not null;alter table nagios_hostchecks modify perfdata TEXT not null;" | mysql -pnagiosxi
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Check Output - Not displaying all lines of outpu

Post by scottwilkerson »

scomdco wrote:If i needed to revert the change, or modify how many characters i'd want to allow, then i would just edit the number with the parenthesis, correct? If not let me know. If it is correct, and just for informational purposes, is 65535 the max number of characters that can be allowed?

echo "use nagios;alter table nagios_hostchecks modify output varchar(255) not null;alter table nagios_hostchecks modify long_output TEXT not null;alter table nagios_hostchecks modify perfdata TEXT not null;" | mysql -pnagiosxi
Correct and correct.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scomdco
Posts: 45
Joined: Fri Oct 04, 2019 3:18 pm

Re: Service Check Output - Not displaying all lines of outpu

Post by scomdco »

Sounds good! This thread can be closed as i'll create a seperate thread for the emails not acknowledging HTML code, unless you'd rather give insight on that through here.

Here's the output of the service check now. It's acknowledging any of the HTML code within the script, (Underline,Bold,Break), i redacted some info for security purposes.
htmlemail3.png
Here's the output in the email, you can see the raw html code within the output
htmlemail1.png
Here's another example where just Bold is supposed to apply
htmlemail.png
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Check Output - Not displaying all lines of outpu

Post by scottwilkerson »

Lets create a different thread for that but I am going to speculate that the output just has newline seperators and not html <br> tags which would make this expected output.

The only way I can see around this would be to change the email template to wrap %serviceoutput% in a pre tag, like

Code: Select all

<pre>%serviceoutput%</pre>
Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked