addons:hotlink-hostnames

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
addons:hotlink-hostnames [2015/09/29 03:36] – [xymonbodyfooter.cfg] jezaddons:hotlink-hostnames [2015/09/29 04:12] (current) – removed jez
Line 1: Line 1:
-====== My Addon (CHANGEME) ====== 
- 
-^ Author | [[ jlaidman@rebel-it.com.au | Jeremy Laidman ]] | 
-^ Compatibility | Xymon 4.x | 
-^ Requirements | none | 
-^ Download | None | 
-^ Last Update | 2015-09-29 | 
- 
-===== Description ===== 
- 
-This is an enhancement to the footer template file, to auto-hotlink hostnames to support click-to-connect for ssh:// and telnet:// URLs. 
- 
-===== Installation ===== 
- 
-1. Copy the file into xymonbodyfooter.cfg alongside xymonserver.cfg. 
-2. In xymonserver.cfg, set: XYMONBODYFOOTER="file:$XYMONHOME/etc/xymonbodyfooter.cfg" 
-3. Create COMMENT or DESCR strings in the form "...(connect: ssh, rdp, telnet)..." 
- 
-The "(connect ...)" text will be removed, and instead  
- 
-===== Source ===== 
-==== xymonbodyfooter.cfg ==== 
- 
-<hidden onHidden="Show Code ⇲" onVisible="Hide Code ⇱"> 
-<code> 
-<!-- 
-  -- Adds hotlinks to connect to the server.  To use: 
-  -- Copy this into the file xymonbodyfooter.cfg alongside xymonserver.cfg. 
-  -- In xymonserver.cfg, set: XYMONBODYFOOTER="file:$XYMONHOME/etc/xymonbodyfooter.cfg" 
-  -- Create COMMENT or DESCR strings in the form "...(connect: ssh, rdp, telnet)..." 
-  --> 
- 
-<!-- we pull in jquery and use it to manipulate the hostname to add links --> 
-<script src="http://code.jquery.com/jquery-latest.js"></script> 
-<script type="text/javascript"> 
-        var replaceConnect=1;   // replace (connect:...) string, zero to disable 
-        jQuery('.line span').replaceWith(function() { 
-                var title=jQuery(this).attr("title"); 
-                if (title == null) { return; }; // no title? nothing to do 
- 
-                var url = jQuery.trim(jQuery(this).text()); 
-                var servertext = jQuery.trim(jQuery(this).text()); 
- 
-                var svclist=[]; 
-                var titlematch=title.match(/^(.*)\s*\(connect:\s*(.*)\)\s*(.*)/); 
-                if (titlematch != null) { 
-                        svclist=titlematch[2].split(/\s*,\s*/); 
-                        if (replaceConnect == 1) { title=titlematch[1]+titlematch[3]; }; 
-                }; 
- 
-                var returnstr = ""; 
-                for (var i=0; i < svclist.length; i++) { 
-                        svc=svclist[i]; 
-                        // webby URLs open in new window 
-                        returnstr += '<span title="connect with '+svc+'">'; 
-                        returnstr += ' <a href="' + svc + '://' + url + '"'; 
-                        if (svc == 'http' || svc == 'https') { returnstr += '" target="_blank"'; }; 
-                        returnstr += '>' + svc + '</a>'; 
-                        returnstr += '</span>'; 
-                }; 
-                return '<span title="'+title+'">' + servertext + '</span>' + '<font size="-2">' + returnstr + '</font>'; 
-        }); 
-</script> 
-</code> 
-</hidden> 
- 
-===== Known  Bugs and Issues ===== 
- 
-===== To Do ===== 
- 
-===== Credits ===== 
- 
-===== Changelog ===== 
- 
-  * **2015-09-29** 
-    * Initial release 
  
  • addons/hotlink-hostnames.1443497815.txt.gz
  • Last modified: 2015/09/29 03:36
  • by jez