Service Output is shown in a line

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Service Output is shown in a line

Post by parisa »

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
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Post by mbellerue »

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!
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Post by parisa »

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
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Post by mbellerue »

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!
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Post by parisa »

Yes, I restarted Nagios twice, the Nagios XI version is 5.6.5.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Service Output is shown in a line

Post by mbellerue »

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!
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Output is shown in a line

Post by parisa »

@ 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Output is shown in a line

Post by scottwilkerson »

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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked