Basic Concepts
All plugins reside in the Cacti plugin directory. In the case, that cacti is installed in the following location: /var/www/html/cacti, the plugin directory would be: /var/www/html/cacti/plugins. Each plugin will have within the plugins directory, it's own directory.
In our example, the "abc" plugin will we used. Therefore, you would create a directory called: /var/www/html/cacti/plugins/abc. Under that directory, you will place other directories as needed. For example, it is quite common to have the following directories under the named plugin directory:
include - includes any special graph headers database connection information, etc.
images - contains any images pripriatary to your Plugin.
lib - contains shared function libraries
html - contains any special filter criterial that you have in your various user interface.
In each Plugins directory structure, you will have one to many file's. With the exception of the poller, the setup modules and command line scripts, it is a good practice to "prefix" all of your files with the "abc" plugin name. Therefore, a plugin that would allow you to view sites, may be called "abc_sites.php".
The exceptions to that rule include the poller module, that is typically named "poller_abc.php" to distinguish it from other UI modules and the most important file is the file "setup.php".
This setup file instructs the Plugin Architecture as to "how" it is to inject your specific functions into Cacti. In fact all Plugin specific hook registration functions typically are found in this file. The name setup.php is mandatory and the Plugin Architecture will find you file without problem.
As most plugins write to the Cacti database, it is important that you prefix all of your tables names with the plugin name. For example, in the example above, I would likely store my site information in the "abc_sites" table.
If you are to control various interfaces to your plugin, you must select one to many realms in Cacti. Unfortunately, there is no existing "realm agency" that assigns you realms. Therefore, I will document all known realms in a subsequent section to assist you in the development of your plugin. You must not overlap realms.





