官术网_书友最值得收藏!

Time for action – importing a template

  1. Start you web browser and go to http://forums.cacti.net/about9861.html. This is the topic on the forum containing all the links which we will be using later within this section. If the download links do not work, check back to this page and look for the new download links.
  2. Download the XML file named cacti087b_host_template_webserver_-_apache.xml from the first post and save it to your desktop.
  3. Logon 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
    
  5. Download the third file to that directory:
    wget http://forums.cacti.net/download/file.php?id=9907
    
  6. Rename the downloaded file to ws_apachestats.pl.gz:
    mv download.php\?id\=9907 ws_apachestats.pl.gz
    
  7. Unzip the file:
    gunzip ws_apachestats.pl.gz
    
  8. Now logon to your Cacti installation.
  9. Go to Import/Export | Import Templates.
    Time for action – importing a template
  10. Select the XML file from your desktop and click on 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.
    Time for action – importing a template

What just happened?

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 contained 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 host template WebServer - Apache. The XML file contained all of the definitions for the necessary graph templates and input methods needed for Cacti to graph the data.

The imported host 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 installation instructions.

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

What just happened?

Exporting templates

Exporting a template allows users to share their hard work in creating these templates with the Cacti community. The export mechanism only exports the graph, host, or data template definitions, but not the scripts that are necessary for some of the data input methods. SNMP-based templates do not need scripts so these are exported complete.

主站蜘蛛池模板: 韶山市| 萝北县| 阜康市| 宁波市| 临邑县| 门源| 错那县| 桓台县| 宁安市| 禄劝| 永定县| 岚皋县| 保定市| 武城县| 安义县| 泸水县| 平远县| 公主岭市| 通江县| 昭苏县| 抚松县| 托克逊县| 句容市| 青冈县| 青田县| 绥德县| 格尔木市| 康马县| 铅山县| 阿鲁科尔沁旗| 青田县| 桃源县| 龙岩市| 剑河县| 宿松县| 丹凤县| 康保县| 龙口市| 庆元县| 启东市| 公主岭市|