View Source

h6. Contents
{toc:minLevel=2|maxLevel=2|printable=false}

h2. Summary

GroundWork has created an extension to the Status application to allow direct access to the Cacti screens for displaying a large number of performance-data graphs for a host. This is done via a link in Status, in the "Related Links" section of the status information page for the host. Please note the our mechanism for supporting hyperlinks to Cacti graphs from within Status is broken in the GWMEE 7.0.x releases. Fixing this requires some file changes discussed in this document.

h2. Features

* A particular Cacti graph tree is designated as the preferred graph tree to be displayed for each host when accessed through this link.
* The "Default Tree" graph tree is automatically used as a possible secondary graph tree if the host is not found to be associated with the preferred graph tree.
* The Cacti graphs appear in a new window, so as not to disturb the state of the Status window and take extra time to get back to where you were before the graphs were displayed. (Most users configure their browsers so that new windows like this simply appear as a new tab in the same browser context.)
* The new window is unencumbered by any of the GroundWork Monitor layout chrome, leaving more room for the graphs. However, security is still maintained, as access to the page is still subject to JBoss session controls.

h2. To Install

Decide what Cacti graph tree you will want to show up when the link is traversed. This graph tree will be mentioned in the link that you configure (below). Configure hosts under that graph tree as desired. You may also configure those and additional hosts under the *Default Tree* graph tree, if that makes sense for your monitoring situation.
{note:title=Steps 1 and 2 below are for 6.5 and earlier releases only}
Downloading and installing the *cacti_graphs.cgi* script should only be done for GroundWork Monitor releases 6.5 and earlier. GroundWork Monitor 6.6 and later releases already include a proper version of this script.{note}
# Download the file *cacti_graphs.cgi*:
{attachments}
# With the owner group *nagios:nagios* and *755* permissions, install the *cacti_graphs.cgi* file as:
{code}/usr/local/groundwork/core/performance/cgi-bin/graphs/cacti_graphs.cgi{code}
# At least in GroundWork Monitor 7.x.x releases, a specific form of the hostname must be used in the *config/cacti.properties* file and in the *config/status-viewer.properties* file. It is the value of the *gatein.sso.josso.host* property that is found with this simple command:
{code}fgrep gatein.sso.josso.host= /usr/local/groundwork/config/configuration.properties{code}
For example, if the result is:
{code}gatein.sso.josso.host=MY-SERVER.MY-COMPANY.com{code}
then *MY-SERVER.MY-COMPANY.com* is the form of hostname you will need in the *cacti.1.host* line, and as the replacement text for *MY_GW_SERVER* in the sample *portal.statusviewer.host.custom.url.2* template line.
# Modify the */usr/local/groundwork/config/status-viewer.properties* file, in the Custom host URLs section near the bottom of the file, to create the links to Cacti graph pages. Choose the first unused pair of lines to modify. You need to make two substitutions in the first sample line below, one for the hostname of the GroundWork Monitor server (here, *MY_GW_SERVER*), and one to specify the preferred graph tree you decided on above (here, *MY_PREFERRED_TREE*).
{code}
portal.statusviewer.host.custom.url.2=http://MY_GW_SERVER/graphs/cgi-bin/cacti_graphs.cgi?graph_tree_name=MY_PREFERRED_TREE&host_name=$HOST$
portal.statusviewer.host.custom.url.2.display.name=Cacti Graphs
{code}
In the first line, use the standard URL encoding of *%20* instead of space characters in your preferred graph tree name, if that name contains spaces. For example, if your GroundWork Monitor server is *carolina* and your preferred graph tree is *Special Graph Tree*, you would specify:
{code}
portal.statusviewer.host.custom.url.3=http://carolina/graphs/cgi-bin/cacti_graphs.cgi?graph_tree_name=Special%20Graph%20Tree&host_name=$HOST$
{code}
In the second ("*display.name*") line, note the intentional lack of quotes around the value, even though it contains a space, and no
special encoding of that space character.
# In the GWMEE 7.0.0 and 7.0.1 releases, you will need to add the following line near the end of */usr/local/groundwork/apache2/conf/httpd.conf*, in the section of other *ProxyPassMatch* lines:
{code}ProxyPassMatch ^/graphs/cgi-bin/(.*)$ http://localhost:8080/performance/cgi-bin/graphs/$1{code}
This line has been added for the next release (7.0.2), so no change will be necessary there. For the 7.0.0 and 7.0.1 releases, you must restart Apache after making that change:
{code}service groundwork restart apache{code}
# Restart GroundWork Monitor to pick up the configuration changes:
{code}
service groundwork restart gwservices
{code}

h2. Notes

* The *Graphs Per Page* and *Thumbnails* settings at the top of the *Cacti Graphs* > *Tree Mode* page seem to be global settings that persist even across sessions. So they are completely under user control, and not set by this new link.

* The *cacti_graphs.cgi* script looks successively in each database configured in the *cacti.propertie{*}s file, not just in one particular database, so it will easily handle complex setups. Wherever it first finds what it's looking for, that's what it runs with. Also, Cacti itself does not enforce uniqueness of applying a graph tree to a host, though perhaps it should. If duplication across databases or within a single database appears in your Cacti setup, the script will use the first match it finds, regardless of whether additional matches exist.