Time for action - importing a template

Instead of creating you own graph templates and data sources, you can also import existing templates from the Cacti website and forum:

  1. Start your web browser and go to https://docs.cacti.net/usertemplate:graph:apache.
  2. Download the cacti_host_template_webserver_apache.zip file and extract the cacti_host_template_webserver_-_apache.xml file from the archive to your desktop.
  3. Log on to your cacti server.
  4. Go to your cacti installation and navigate to the scripts directory. On CentOS, the command is:
cd /var/www/html/cacti/scripts
  
  1. Download the third file to that directory:
wget 'https://docs.cacti.net/_media/usertemplate:graph:ws_apachestats.zip' -O ws_apachestats.zip
  
  1. Unzip the file:
unzip ws_apachestats.zip
  
  1. Now log on to your Cacti installation.
  1. Go to Import/Export | Import Template:

  1. Select the XML file from your desktop and click the Import button. You will see some status information as well as the templates, data input methods, and other items that have been imported to your Cacti system:

As in the preceding example, a template may not always consist of XML files, but may also have an associated script that needs to be added to the Cacti installation. The template you just imported did contain such a script. You have downloaded, renamed, and extracted it into the scripts directory. This directory contains all the scripts being used within data input methods.

You then imported the XML file for the WebServer - Apache device template. The XML file contained all definitions for the necessary graph templates and input methods needed for Cacti to graph the data.

The imported device template can now be used and assigned to the devices. As with all external files, make sure you read and follow the corresponding readme files or install instructions.

  1. If you have done everything correctly, you should see the following graph after a few polling cycles: