alternative text behind links
Tedman Eng
teng at dataway.com
Fri Dec 16 00:18:28 CET 2005
Here's how to achieve what you want:
HOWTO: Add javascript to a mouseover event associated with a service.
For this exercise, I'm using 1.2 (other versions may behave differently, I
haven't tried)
First, make sure you have extended service information configured. Extended
service information allows you to set a link, an image and alt text for any
service. Nagios does not check for validity of the text you set for those
fields, and we'll take advantage of this behavior.
Here's a normal example extinfo.cfg from the docs:
--------------------------
define serviceextinfo{
host_name linux2
service_description Log Anomalies
icon_image security.png
icon_image_alt Security-Related Alerts
}
--------------------------
Modify it to look like this (notice the mismatched '' single quotes):
--------------------------
define serviceextinfo{
host_name linux2
service_description Log Anomalies
icon_image security.png
icon_image_alt Security-Related Alerts'
onmouseover='alert("Vote for Pedro")
}
--------------------------
What this does is closes the ALT attribute that Nagios adds, inserts our
extra attributes, then Nagios adds a single quote which closes off our
injected attribute. This example is merely illustrative, so you should
probably call a javascript function there instead of a simple alert. The
tooltip functions can be defined using the custom CGI headers feature.
Hope this helps!
Tedman
> -----Original Message-----
> From: Richard Gliebe [mailto:richard.gliebe at fhv.at]
> Sent: Wednesday, December 14, 2005 11:48 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] alternative text behind links
>
>
> Hi,
>
> maybe a cracy question.
>
> I want to insert/define an alternative text (MouseOver)
> behind a link in
> the WebGUI like this:
>
> [...]
> Service Status Details For Host 'x.y.z'
> .
> OutputSource OK 12-15-2005 08:35:21 0d 0h 21m 33s 1/3 Output
> Source OK -
> 3
> .
> [...]
>
> the Column "OutputSource" is a link to the "Service State Information"
>
> Now I want to define an explanation (MouseOver Popup) behind
> this link,
> what the snmpget output "3" meens for this service, like:
>
> INTEGERS:
> other (1),
> none (2),
> normal (3),
> bypass (4),
> battery (5),
> booster (6),
> reducer (7)
>
> Thanks in advance
> Richard
>
> --
> Richard Gliebe
> Fachhochschule Vorarlberg GmbH / University for Applied Science
> Information Services
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web.
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS
> when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list