Service Output is shown in a line

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Service Output is shown in a line

Postby parisa » Sat Aug 24, 2019 8:35 am

Hi
I have defined a service in Nagios xi that the service uses from a script (bash script), the service works correctly but output of the service is lines of a file that the script creates the file. I wanted the output to show in some lines but the output is shown as a line.
would you help me, how to show the service output line by line in "status information" part of monitoring?
I used \n and <br /> but it didn't work.
This is related to output of service:
Code: Select all
while read line
do
printf "%s<br />" "$line"
done < $Channels_Info


BR.
Parisa
Attachments
service status.PNG
Service status
parisa
 
Posts: 61
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Postby mbellerue » Mon Aug 26, 2019 2:24 pm

If you edit the file /usr/local/nagios/etc/cgi.cfg you will see this setting,

Code: Select all
escape_html_tags=1


Just change that from a 1 to a 0. You may need to restart Nagios for it to take effect. But once it's in effect, it will no longer escape HTML tags, so your <br /> should get you a new line.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
 
Posts: 763
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Postby parisa » Mon Aug 26, 2019 11:53 pm

Hi @mbellerue
Thanks for your answer
I had changed value of "escape_html_tags" to 0 but I see the service output as attachment yet and html tag of <br /> is shown in output , is there any way to have better view?

BR.
Parisa
Attachments
4113.PNG
Service output
parisa
 
Posts: 61
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Postby mbellerue » Tue Aug 27, 2019 9:40 am

Did you also restart Nagios? That may be required for this change to take effect. Also, what version of Nagios XI is this?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
 
Posts: 763
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Postby parisa » Tue Aug 27, 2019 11:13 pm

Yes, I restarted Nagios twice, the Nagios XI version is 5.6.5.
parisa
 
Posts: 61
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Postby mbellerue » Wed Aug 28, 2019 10:20 am

Ah, my apologies. That piece was just for Nagios Core. For Nagios XI, we need to enable HTML Tags. Head over to Admin -> System Settings -> General, and there will be a checkbox labeled "Allow HTML Tags in Host/Service Status." Just enable that, and head back over to Services and it should be processed properly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
 
Posts: 763
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Postby parisa » Sat Aug 31, 2019 12:37 am

@ mbellerue It's appreciated, it's solved.

I had searched for a option in cfg files of Nagios to active HTML tags, but only found "escape_html_tags" that it didn't work on XI. I didn't search on UI.
thanks for your help.

BE.
Parisa
parisa
 
Posts: 61
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Postby scottwilkerson » Tue Sep 03, 2019 7:27 am

parisa wrote:@ mbellerue It's appreciated, it's solved.

I had searched for a option in cfg files of Nagios to active HTML tags, but only found "escape_html_tags" that it didn't work on XI. I didn't search on UI.
thanks for your help.

BE.
Parisa

Great!

Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 16616
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios XI

Who is online

Users browsing this forum: MSN [Bot] and 6 guests