Creating clickablie links - urlize

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rwhelan
Posts: 3
Joined: Tue Dec 09, 2014 7:49 pm

Creating clickablie links - urlize

Post by rwhelan »

Hi,

Apologies if this is covered here somewhere, but I can't seem to get urlize working completely. I've follow the various suggestions on the web, to create the link, and whilst I can see the html code being generated, it is never actually clickable.

I'm running 3.4.3 (yes I know it's a little old). Have the following:

main commands file:
# 'check_ping' command definition
define command{
command_name check_ext_ping
command_line $USER1$/urlize "https://<nagios server>/nagios/cgi-bin/traceroute.cgi?$HOSTADDRESS$" $USER1$/check_ping -H $HOSTADDRESS$ -w 150,25% -c 1000,50% -p 5
}

Then in the check for the host:

define service{
use generic-service
host_name <monitor host>
service_description Traceroute Ping
check_command check_ext_ping
}

In the status detail page, I see the check,


Traceroute Ping

Notifications for this service have been disabled
OK 07-08-2016 10:01:27 0d 16h 28m 56s 1/2 <A href="https://<nagios server>/nagios/cgi-bin/traceroute.cgi?xx.xx.xx.xx">PING OK - Packet loss = 0%, RTA = 0.39 ms</A>

And if I click into I get, ie in Service State Information:

Status Information: <A href="https://<nagios server>/nagios/cgi-bin/traceroute.cgi?xx.xx.xx.xx">PING OK - Packet loss = 0%, RTA = 0.37 ms</A>

But at no point are any of these actually clickable. I know the traceroute cgi works and generates the output I'd like, but was hoping that it would just provide the link to click on.

Am I doing something wrong?

Cheers,

Richard
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Creating clickablie links - urlize

Post by rkennedy »

Take a look at your nagios.cfg file, specifically this field -

Code: Select all

illegal_macro_output_chars=`~$&|'"<>
If any of the characters you're using are marked as 'illegal' remove them.

One other file to look at is cgi.cfg, check this field -

Code: Select all

escape_html_tags=1
Should be set at 0.

Then restart nagios, and it should be working as expected.
Former Nagios Employee
rwhelan
Posts: 3
Joined: Tue Dec 09, 2014 7:49 pm

Re: Creating clickablie links - urlize

Post by rwhelan »

Thank you, it was the escape_html_tags that did the trick.

Cheers,

Richard
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Creating clickablie links - urlize

Post by mcapra »

Is it alright if we close this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
Locked