Info Output Custom Plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Info Output Custom Plugin

Post by WillemDH »

I even tried inserting a <br> instead of `r`n , but I get
CODE: SELECT ALL
1 / 59 tasks failed! Check tasks: <br>Task BW_Buurtwerk by demeyerfailed with exitcode 267014<br>

as output.
Already tried that :)
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Info Output Custom Plugin

Post by tmcdonald »

Did you check the "Allow HTML Tags in Host/Service Status" box in Admin -> Manage System Config?
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Info Output Custom Plugin

Post by WillemDH »

Hmm, I don't know. Gonna check that tomorrow! (not at work atm)
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Info Output Custom Plugin

Post by tmcdonald »

Sweet. Just swatting this thread off the front page of our "bug you til you answer" dashboard. Let us know how it works out!
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Info Output Custom Plugin

Post by WillemDH »

Trevor, Spenser,

It seems the "Allow HTML Tags in Host/Service Status" did help. The failed tasks now appear in the service state history, which will help troubleshoot failed tasks.

The service state history information now looks like this however:

Code: Select all

2 / 59 tasks failed! Check tasks: <br>Task BW_Bezigheidshome by user1 failed with exitcode 267014 <br>Task BW_Buurtwerk by user1 failed with exitcode 267014 <br>
The Service status detail overview looks like this:

Code: Select all

Critical
2 / 59 tasks failed! Check tasks:
Task BW_Bezigheidshome by user1 failed with exitcode 267014
Task BW_Buurtwerk by user1 failed with exitcode 267014
So I know I got a solution and I can see the failed tasks in history.. But is there way to make the <br> not appear on the service status history information?

Second question, is this "Allow HTML Tags in Host/Service Status" a Nagios XI only option or is this also available in Core? As I'm publishing this plugin on the Nagios Exchange, I wouldn't want to exclude the core users from being able to see which tasks are failed when. or at least I will have to put it in the documentation.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Info Output Custom Plugin

Post by tmcdonald »

WillemDH wrote:But is there way to make the <br> not appear on the service status history information?
Sadly not with that checkbox. Different portions of the web interface are going to handler rendering HTML differently, and the checkbox only affects the Host/Service Status field.
WillemDH wrote:Second question, is this "Allow HTML Tags in Host/Service Status" a Nagios XI only option or is this also available in Core?
This option is only in XI.
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Info Output Custom Plugin

Post by WillemDH »

Ok, thanks Trevor. I'm gonna skip the <br> and `r`n story completely. Too much hassle. Edited the script to put everything in one line and split the tasks by ' -> ', which gives

Code: Select all

All 59 tasks ran succesfully! -> Task BW_Bezigheidshome by user1, exitcode 267009 is still running! -> Task BW_Buurtwerk by user1, exitcode 267009 is still running!
and

Code: Select all

2 / 59 tasks failed! Check tasks: -> Task BW_Bezigheidshome by user1 failed with exitcode 267014 -> Task BW_Buurtwerk by user1 failed with exitcode 267014
as results, which kind of satisfies me... :)

Thanks for the help! Thread can be closed.

Willem
Nagios XI 5.8.1
https://outsideit.net
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Info Output Custom Plugin

Post by slansing »

Second question, is this "Allow HTML Tags in Host/Service Status" a Nagios XI only option or is this also available in Core? As I'm publishing this plugin on the Nagios Exchange, I wouldn't want to exclude the core users from being able to see which tasks are failed when. or at least I will have to put it in the documentation.
Actually, you can do this through the cgi.cfg file in core. You'd want to flip this to 0:

Code: Select all

escape_html_tags=0
That is located in:

Code: Select all

/usr/local/nagios/etc/cgi.cfg
http://nagios.sourceforge.net/docs/3_0/configcgi.html

I'll lock the thread up now. :)
Locked