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(" ...

Get Cacti 0.8 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.