Difference between revisions of "Freeside:3:Documentation:Developer/FS/part export/cacti"

From Freeside
Jump to: navigation, search
(Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
 
Line 6: Line 6:
  
 
==DESCRIPTION==
 
==DESCRIPTION==
This module in particular handles FS::part_export object creation for Cacti integration; consult any existing [[Freeside:3:Documentation:Developer/FS/part export|FS::part_export]] documentation for details on how that works. What follows is more general instructions for connecting your Cacti installation to your Freeside installation.
+
This module in particular handles FS::part_export object creation for Cacti integration; consult any existing [[Freeside:3:Documentation:Developer/FS/part export|FS::part_export]] documentation for details on how that works.
  
===Connecting Cacti To Freeside===
+
==SUBROUTINES==
Copy the freeside_cacti.php script from the bin directory of your Freeside installation to the cli directory of your Cacti installation. Give this file the same permissions as the other files in that directory, and create (or choose an existing) user with sufficient permission to read these scripts.
+
; process_graphs JOB PARAM
 +
:Intended to be run as an FS::queue job.
  
In the regular Cacti interface, create a Host Template to be used by devices exported by Freeside, and note the template's id number. Optionally, create a Graph Tree for these devices to be automatically added to, and note the tree's id number. Configure a Graph Export (under Settings) and note the Export Directory.
+
:Copies graphs for a single service from Cacti export directory to FS cache, generates basic html pages for this service with base64-encoded graphs embedded, and stores the generated pages in the database.
  
In Freeside, go to Configuration->Services->Provisioning exports to add a new export. From the Add Export page, select cacti for Export then enter...
+
==METHODS==
 +
; cleanup
 +
:Removes all expired graphs for this export from the database.
 +
; exptime [ TIME ]
 +
:Accepts optional current time, defaults to actual current time.
  
* the Hostname or IP address of your Cacti server
+
:Returns timestamp for the oldest possible non-expired graph import, based on the import_freq option.
 
 
* the User Name with permission to run scripts in the cli directory
 
 
 
* the full Script Path to that directory (eg /usr/share/cacti/cli/)
 
 
 
* the Host Template ID for adding new devices
 
 
 
* the Graph Tree ID for adding new devices (optional)
 
 
 
* the Description for new devices; you can use the tokens $ip_addr and $description to include the equivalent fields from the broadband service definition
 
 
 
* the Graph Export Directory, including connection information if necessary (user@host:/path/to/graphs/)
 
 
 
* the minimum minutes between graph imports to Freeside (graphs will otherwise be imported into Freeside as needed.) This should be at least as long as the minumum time between graph exports configured in Cacti. Defaults to 5 if unspecified.
 
 
 
* the maximum size per graph, in MB; individual graphs that exceed this size will be quietly ignored by Freeside. Defaults to 5 if unspecified.
 
 
 
After adding the export, go to Configuration->Services->Service definitions. The export you just created will be available for selection when adding or editing broadband service definitions; check the box to activate it for a given service. Note that you should only have one cacti export per broadband service definition.
 
 
 
When properly configured broadband services are provisioned, they will now be added to Cacti using the Host Template you specified. If you also specified a Graph Tree, the created device will also be added to that.
 
 
 
Once added, a link to the graphs for this host will be available when viewing the details of the provisioned service in Freeside.
 
 
 
Devices will be deleted from Cacti when the service is unprovisioned in Freeside, and they will be deleted and re-added if the ip address changes.
 
 
 
Currently, graphs themselves must still be added in Cacti by hand or some other form of automation tailored to your specific graph inputs and data sources.
 
  
 
==AUTHOR==
 
==AUTHOR==

Latest revision as of 09:25, 20 April 2015

NAME

FS::part_export::cacti

SYNOPSIS

Cacti integration for Freeside

DESCRIPTION

This module in particular handles FS::part_export object creation for Cacti integration; consult any existing FS::part_export documentation for details on how that works.

SUBROUTINES

process_graphs JOB PARAM
Intended to be run as an FS::queue job.
Copies graphs for a single service from Cacti export directory to FS cache, generates basic html pages for this service with base64-encoded graphs embedded, and stores the generated pages in the database.

METHODS

cleanup
Removes all expired graphs for this export from the database.
exptime [ TIME ]
Accepts optional current time, defaults to actual current time.
Returns timestamp for the oldest possible non-expired graph import, based on the import_freq option.

AUTHOR

Jonathan Prykop jonathan@freeside.biz

LICENSE AND COPYRIGHT

Copyright 2015 Freeside Internet Services

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.