Reader small image

You're reading from  Cacti 0.8 Beginner's Guide

Product typeBook
Published inMar 2011
Reading LevelBeginner
PublisherPackt
ISBN-139781849513920
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Thomas Urban
Thomas Urban
author image
Thomas Urban

Thomas Urban is the owner of Urban-Software.de, a software and consulting services company providing add-ons, plugins, and services for the Cacti Performance Monitoring systems. He has been in the consulting business for more than 5 years and has been creating web applications for over 20 years building reporting interfaces, network management software, asset management sites, and much more. He is a part of the Cacti community and is known as Phalek in the Cacti forums, where he is among the Top 10 contributors. He started writing the first Cacti Beginners Guide for Cacti 0.8 back in 2011. The second edition is his second official effort.
Read more about Thomas Urban

Right arrow

Time for action – retrieve data from the database


  1. Open the setup.php file from Example 3.

  2. Go to the cbEnhancedInfo_tree_after function.

  3. Search for the following code:

       /* Example 3 - Data retrieval is missing here ---> */
       /* <--- */
  4. Between these two lines, enter the following code:

    // Retrieve the enhanced information for that host from the table
    $host_longitude = db_fetch_cell("
    SELECT longitude 
    FROM plugin_cbEnhancedInfo_dataTable 
    WHERE hostId=$host_leaf_id");
    $host_latitude = db_fetch_cell("
    SELECT latitude 
    FROM plugin_cbEnhancedInfo_dataTable 
    WHERE hostId=$host_leaf_id");
    $host_contactAddress = db_fetch_cell("
    SELECT contactAddress 
    FROM plugin_cbEnhancedInfo_dataTable 
    WHERE hostId=$host_leaf_id");
    $host_additionalInformation = db_fetch_cell("
    SELECT additionalInformation 
    FROM
     plugin_cbEnhancedInfo_dataTable 
    WHERE hostId=$host_leaf_id");
    
    // Retrieve the host specific information from the host table
    $host_country = db_fetch_cell("
    SELECT ebEnhancedInfo_country 
    FROM host...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Cacti 0.8 Beginner's Guide
Published in: Mar 2011Publisher: PacktISBN-13: 9781849513920

Author (1)

author image
Thomas Urban

Thomas Urban is the owner of Urban-Software.de, a software and consulting services company providing add-ons, plugins, and services for the Cacti Performance Monitoring systems. He has been in the consulting business for more than 5 years and has been creating web applications for over 20 years building reporting interfaces, network management software, asset management sites, and much more. He is a part of the Cacti community and is known as Phalek in the Cacti forums, where he is among the Top 10 contributors. He started writing the first Cacti Beginners Guide for Cacti 0.8 back in 2011. The second edition is his second official effort.
Read more about Thomas Urban