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.
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.
Service Check Output - Not displaying all lines of output
Service Check Output - Not displaying all lines of output
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
Can you show the results of the following run from the CLI
Code: Select all
echo "desc nagios_servicestatus;"|mysql -pnagiosxi nagios|grep outputThe 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.
Re: Service Check Output - Not displaying all lines of outpu
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
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
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 -pnagiosxiRe: Service Check Output - Not displaying all lines of outpu
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
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
Correct and correct.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
Re: Service Check Output - Not displaying all lines of outpu
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. Here's the output in the email, you can see the raw html code within the output Here's another example where just Bold is supposed to apply
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. Here's the output in the email, you can see the raw html code within the output Here's another example where just Bold is supposed to apply
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
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
Locking thread
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>