Page 2 of 2

Re: Info Output Custom Plugin

Posted: Tue Apr 22, 2014 12:05 pm
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 :)

Re: Info Output Custom Plugin

Posted: Tue Apr 22, 2014 12:11 pm
by tmcdonald
Did you check the "Allow HTML Tags in Host/Service Status" box in Admin -> Manage System Config?

Re: Info Output Custom Plugin

Posted: Tue Apr 22, 2014 12:13 pm
by WillemDH
Hmm, I don't know. Gonna check that tomorrow! (not at work atm)

Re: Info Output Custom Plugin

Posted: Tue Apr 22, 2014 12:23 pm
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!

Re: Info Output Custom Plugin

Posted: Wed Apr 23, 2014 7:38 am
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

Re: Info Output Custom Plugin

Posted: Wed Apr 23, 2014 9:18 am
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.

Re: Info Output Custom Plugin

Posted: Thu Apr 24, 2014 4:42 am
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

Re: Info Output Custom Plugin

Posted: Thu Apr 24, 2014 9:17 am
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. :)