Cacti favicon



Cacti is a network graphing package based on RRDTool.

Problem
Cacti's very pretty, but it lacks a Favicon. I often lose my Cacti windows amongst the myriad other tabs in my Firefox.

Uploading a favicon would be simple enough but that only makes sense if the virtual host is used only for Cacti. If you are in that position then you can just copy [[Media:Cacti favicon.ico|the icon]] to the root of your Cacti virtual host and name it favicon.ico, and stop reading now.

Solution
Following some instructions found on the Cacti forums it is possible to install a favicon even when Cacti does not run from the web root. You need to upload the icon and slightly edit 5 of Cacti's PHP files.

Get the icon
Copy [[Media:Cacti favicon.ico|the icon]] to your Cacti images directory (/usr/share/cacti/images/ on Debian sarge).

Modify Cacti files to serve the image
The following files need to be modified. The paths are relative to the base of the Cacti installation (/usr/share/cacti/ on Debian sarge).

auth_login.php
Around line 97, just underneath the line with the &lt;title&gt; tag:  

include/top_header.php
In each file there is one line that reads: 

Add:

 

Below it in each file.

lib/graph_export.php</tt>
Around line 275 you should see: copy("$cacti_root_path/images/shadow.gif", "$cacti_export_path/shadow.gif");

Add:

copy("$cacti_root_path/images/cacti_favicon.ico", "$cacti_export_path/cacti_favicon.ico");

below it.

Around line 410 you should see:

<link href='main.css' rel='stylesheet' />

Add:

<link href='cacti_favicon.ico' rel='image/x-icon' /> <link rel='shortcut icon' href='cacti_favicon.ico' type='image/x-icon' />

below it.