Plugin Hook API Reference

February 6, 2026 ยท View on GitHub

The following table shows all known Cacti plugin hooks and a brief description of their function.

hookhookhook
add_graph_template_to_hostapi_device_newapi_device_save
auth_alternate_realmsauth_profile_resetauth_profile_reset_value
auth_profile_run_actionauth_profile_saveauth_profile_tabs
auth_profile_update_databoost_poller_bottombottom_footer
cacti_stats_updatechange_password_titleclog_regex_array
config_arraysconfig_formconfig_insert
config_settingsconsole_afterconsole_before
copy_usercreate_complete_graph_from_templatecustom_denied
custom_logincustom_logout_messagecustom_password
custom_version_infodata_input_sql_wheredata_source_action_array
data_source_action_bottomdata_source_action_executedata_source_action_prepare
data_source_edit_bottomdata_source_edit_topdata_source_remove
data_source_to_poller_itemsdata_sources_tabledevice_action_array
device_action_bottomdevice_action_executedevice_action_prepare
device_display_textdevice_edit_pre_bottomdevice_edit_top_links
device_filter_enddevice_filter_startdevice_filters
device_change_javascriptdevice_removedevice_sql_where
device_table_bottomdevice_table_replacedevice_template_change
device_template_editdevice_template_topdraw_navigation_text
export_actionfgc_contextoptionget_friendly_name
global_settings_updategraphgraph_buttons
graph_edit_aftergraph_imagegraph_items_remove
graph_tree_page_buttonsgraphs_action_arraygraphs_action_bottom
graphs_action_executegraphs_action_preparegraphs_item_array
graphs_new_top_linksgraphs_removegraphs_sql_where
hmib_get_cpuhmib_get_cpu_indexeshmib_get_disk
host_edit_bottomhost_edit_tophost_save
import_actionis_console_pagelogin_after
login_beforelogin_options_navigatelogin_process
login_realmslogin_titlelogout_post_session_destroy
logout_pre_session_destroynav_login_afternav_login_before
page_bottompage_buttonspage_head
page_titlepoller_bottompoller_command_args
poller_exitingpoller_finishingpoller_output
poller_remote_maintpoller_topremote_agent
replicate_inreplicate_outreport_filters
resolve_dependenciesrrd_graph_graph_optionsrun_data_query
snmpagent_cache_installsubstitute_host_datatop_graph_header
top_graph_header_tabstop_graph_jquery_functiontop_graph_refresh
top_headertree_aftertree_view_page_end
ugroup_tabsupdate_data_source_title_cacheuser_admin_action
user_admin_edituser_admin_run_actionuser_admin_setup_sql_save
user_admin_tabuser_admin_user_saveuser_group_admin_action
user_group_admin_edituser_group_admin_saveuser_group_admin_setup_sql_save
[user_group_admin_run_action] (Plugin-Hook-API-Ref.md#user_group_admin_run_action)[user_group_admin_tab] (Plugin-Hook-API-Ref.md#user_group_admin_tab)[user_group_remove] (Plugin-Hook-API-Ref.md#user_group_remove)
user_removeutilities_actionutilities_array
utilities_listvalid_host_fields

add_graph_template_to_host

Allows you to perform additional operations when adding a graph template to host. The parameters passed are host_id and graph_template_id.

fileintroducedretired
cli/add_graph_template.php1.0.0
cli/host_update_template.php1.0.0
host.php1.0.0
lib/api_device.php1.0.0

api_device_new

This hooks allows you to perform additional operation at the end of api_device_save function. Unlike the api_device_save hook, the device ID is already defined here.

fileintroducedretired
lib/api_device.php1.0.0

api_device_save

This hook allows you to perform additional operation at the end of api_device_save function. Unlike the api_device_new hook, the device ID is might not be defined here.

This hook allows you to alter the contents to the device table with custom fields. When used properly, it allows you to extend the host table with your plugins custom fields.

fileintroducedretired
lib/api_device.php1.0.0

auth_alternate_realms

This hook allows you to handle user login check alternate plugin defined authentication realms.

fileintroducedretired
include/auth.php1.0.0

auth_profile_reset

Allows you to reset plugins all user settings

fileintroducedretired
auth_profile.php1.2.0-beta3

auth_profile_reset_value

Allows you to reset plugins single user settings

fileintroducedretired
auth_profile.php1.2.0-beta3

auth_profile_run_action

Allows you to draw plugins user settings form

fileintroducedretired
auth_profile.php1.2.0-beta3

auth_profile_save

Allows you to save plugins all user settings

fileintroducedretired
auth_profile.php1.2.0-beta3

auth_profile_tabs

Allows you to draw plugins user setting tabs

fileintroducedretired
auth_profile.php1.2.0-beta3

auth_profile_update_data

Allows you to update plugins single user setting

fileintroducedretired
auth_profile.php1.2.4

boost_poller_bottom

fileintroducedretired
poller_boost.php1.0.0

Allows you to override the rendering of the bottom_footer html snippet.

fileintroducedretired
include/bottom_footer.php0.8.7i1.1.38

cacti_stats_update

fileintroducedretired
poller.php1.0.0

change_password_title

fileintroducedretired
auth_changepassword.php1.2.0-beta1

clog_regex_array

Allows you to enhance the Logs display with additional information or links.

fileintroducedretired
lib/clog_webapi.php1.1.34

config_arrays

Allows your plug-in to define custom array elements to be used throughout cacti. Things like dropdown arrays and the like.

fileintroducedretired
include/global_arrays.php1.0.0

config_form

Allows you to define form object to represent data to be stored in your tables. In the case of MacTrack, there is a table called mac_track_sites and in order to drive the UI and allow for the user to provide input and save a site, you must provide the Cacti form engine a form array to allow for the form to be presented and contents to be saved.

fileintroducedretired
include/global_form.php1.0.0

config_insert

This is a general purpose hook used for connecting to other database, or sourcing common includes that would otherwise not be sourced.

fileintroducedretired
include/global.php1.0.0

config_settings

Allows you to extend the Cacti settings page to allow for custom tabs and global settings within them.

fileintroducedretired
include/global_settings.php1.0.0

console_after

Allows you to add text after the default message on the console page

fileintroducedretired
index.php1.0.0

console_before

Allows you to add text before the default message on the console page. For instance, the Update plug-in will display a message here if there are new versions of plugins.

fileintroducedretired
index.php1.0.0

copy_user

Allows a plugin to take part in the Copy User actions. This is important a plugin maintains user settings.

fileintroducedretired
lib/auth.php1.0.0

create_complete_graph_from_template

Allows you to perform additional operations when adding new graph to device from graph template.

fileintroducedretired
lib/template.php1.0.0

custom_denied

Allows you to override the rendering of the permission denied interface.

fileintroducedretired
permission_denied.php1.2.2
auth_login.php1.2.12

custom_login

Allows you to override the rendering of the auth_login.php page.

fileintroducedretired
auth_login.php1.0.0

custom_logout_message

Allows you to override the rendering of the logout.php page.

fileintroducedretired
logout.php1.0.0

custom_password

Allows you to override the rendering of the auth_changepassword.php page.

fileintroducedretired
auth_changepassword.php1.0.0

custom_version_info

Allows your plugin to display additional information on the cacti tech support page.

fileintroducedretired
utilities.php1.0.0

data_input_sql_where

fileintroducedretired
data_input.php1.0.0

data_source_action_array

Allows you to define custom dropdown actions from within the data sources page.

fileintroducedretired
data_sources.php1.0.0

data_source_action_bottom

fileintroducedretired
data_sources.php1.0.0

data_source_action_execute

Allows you to define custom actions to be taken upon you dropdown selection.

fileintroducedretired
data_sources.php1.0.0

data_source_action_prepare

This is the final component to creating a custom action within the data sources. In Cacti's form engine, you must provide the dropdown action and then two follow-up actions to complete the cycle. This is were you actually save the data.

fileintroducedretired
data_sources.php1.0.0

data_source_edit_bottom

Allows you to make minor change to the Data Sources page, like add a tabbed interface.

fileintroducedretired
data_sources.php1.0.0

data_source_edit_top

Allows you to make minor changes to the Data Sources page, like add a tabbed interface.

fileintroducedretired
data_sources.php1.0.0

data_source_remove

This hook is called when the data sources used by a graph are removed. The parameters are the graphs data sources.

fileintroducedretired
data_sources.php1.0.01.1.38
graphs.php1.0.01.1.38
host.php1.0.01.1.38
lib/api_data_source.php1.2.0-beta1

data_source_to_poller_items

fileintroducedretired
lib/utility.php1.0.0

data_sources_table

Allows you to change the data displayed on the Data Sources table. THold uses this to create a link to that datasources threshold

fileintroducedretired
data_sources.php1.0.0

device_action_array

Allows you to define custom dropdown actions from within the device/host page.

fileintroducedretired
host.php1.0.0

device_action_bottom

fileintroducedretired
host.php1.0.0

device_action_execute

Allows you to define custom actions to be taken upon you dropdown selection.

fileintroducedretired
host.php1.0.0

device_action_prepare

This is the final component to creating a custom action within the devices. In Cacti's form engine, you must provide the dropdown action and then two follow-up actions to complete the cycle. This is were you actually save the data.

fileintroducedretired
host.php1.0.0

device_display_text

This hook allows you to add custom columns header to the host list page

fileintroducedretired
host.php1.3.0 - Dev

device_edit_pre_bottom

fileintroducedretired
host.php1.0.0

This hook allows you to add custom actions to the host edit page, below the "Create graphs for this Host".

fileintroducedretired
host.php1.0.0

device_filter_end

This hook allows you to add custom filter fields before Cacti buildin filter to the host list page

fileintroducedretired
host.php1.3.0 - Dev

device_filter_start

This hook allows you to add custom filter fields after Cacti buildin filter to the host list page

fileintroducedretired
host.php1.3.0 - Dev

device_filters

fileintroducedretired
host.php1.0.0

device_change_javascript

This hook allows you to add custom javascript to Change device settings page

fileintroducedretired
host.php1.2.31

device_remove

This hook allows you to perform additional actions on devices that have been selected for deletion. The parameter is an array of deleted device IDs. Note that at this point, the devices are already deleted from the host table.

fileintroducedretired
host.php1.0.01.1.38
lib/api_device.php1.2.0-beta1

device_sql_where

fileintroducedretired
host.php1.0.0

device_table_bottom

fileintroducedretired
host.php1.0.0

device_table_replace

Allows you to override the rendering of the host list page

fileintroducedretired
host.php1.3.0 - Dev

device_template_change

Allows you to add template items such a threshold upon a device template change

fileintroducedretired
lib/ap_device.php1.2.25

device_template_edit

fileintroducedretired
host_templates.php1.0.0

device_template_top

fileintroducedretired
host_templates.php1.0.0

draw_navigation_text

Just below the Cacti "Console", and "Graphs" tabs, cacti provides a Navigation bar that allows you to move backward in a selection tree. Although it is not foolproof, this hook allows you to populate and navigate that tree.

fileintroducedretired
lib/functions.php1.0.0

export_action

fileintroducedretired
lib/export.php1.2.0-beta1

fgc_contextoption

fileintroducedretired
lib/functions.php1.1.28

get_friendly_name

fileintroducedretired
lib/import.php1.2.0-beta1

global_settings_update

fileintroducedretired
settings.php1.0.0

graph

This hook is called at the top of graph.php page

fileintroducedretired
graph.php1.0.0

graph_buttons

You know about the zoom button right? Well this allows you to add any additional custom button to the right of a graph.

fileintroducedretired
graph.php1.0.0

graph_edit_after

fileintroducedretired
graphs.php1.2.0-beta1

graph_image

This hooks allows displaying of alternative graphics in place of a graph image. This hook can no output text, only modify the image, as it is only called when a graph is required to be outputted.

fileintroducedretired
graph_image.php1.0.0
graph_json.php1.0.0

graph_items_remove

This hook is called when when the data source is deleted, and the option to remove all graph items tied to the data source is selected.

fileintroducedretired
data_sources.php1.0.0

graph_tree_page_buttons

Allows you to add custom HTML to the graph tree view page, under the timespan presets and the graph search box.

fileintroducedretired
lib/html_tree.php0.8.7i

graphs_action_array

Similar to the host actions and host, prepare and execute hooks. It allows you to have custom dropdown actions within the graph management interface.

fileintroducedretired
graphs.php1.0.0

graphs_action_bottom

fileintroducedretired
graphs.php1.0.0

graphs_action_execute

fileintroducedretired
graphs.php1.0.0

graphs_action_prepare

fileintroducedretired
graphs.php1.0.0

graphs_item_array

fileintroducedretired
graphs.php1.2.0-beta1

Add a link at the top of the "Create New Graphs" page.

fileintroducedretired
graphs_new.php1.0.0

graphs_remove

This hook is called after one or more graphs are removed. The parameters are the removed graph IDs.

fileintroducedretired
data_sources.php1.0.01.1.38
graphs.php1.0.01.1.38
host.php1.0.01.1.38
lib/api_graph.php1.2.0-beta1

graphs_sql_where

This hooks allows you to add additional where clauses to the select statement used to display graphs on the graphs.php page.

fileintroducedretired
graphs.php1.0.0

hmib_get_cpu

fileintroducedretired
scripts/ss_host_cpu.php1.0.0

hmib_get_cpu_indexes

fileintroducedretired
scripts/ss_host_cpu.php1.0.0

hmib_get_disk

fileintroducedretired
scripts/ss_host_disk.php1.0.0

host_edit_bottom

Allows you to make minor changes to the Devices page, like add a tabbed interface.

fileintroducedretired
host.php1.0.0

host_edit_top

Allows you to make minor changes to the Devices page, like add a tabbed interface.

fileintroducedretired
host.php1.0.0

host_save

fileintroducedretired
host.php1.0.0

import_action

fileintroducedretired
lib/import.php1.2.0-beta1

is_console_page

fileintroducedretired
lib/html.php1.0.0

login_after

This allows you to display text or html after the login form.

fileintroducedretired
auth_login.php1.0.0

login_before

This allows you to display text or html before the login form. Combined with the above hook, you could draw a box, etc around the form, change its background color, etc to slightly customize the login page.

fileintroducedretired
auth_login.php1.0.0

login_options_navigate

Used to support alternate login realm types.

fileintroducedretired
auth_changepassword.php1.0.0
auth_login.php1.0.0

login_process

Used to authenticate the user logging in to a custom plugin defined realm.

fileintroducedretired
auth_login.php1.0.0

login_realms

Used to defined additional custom plugin defined authentication realms. The parameter passed is an array of existing authentication realms.

fileintroducedretired
auth_login.php1.0.0

login_title

Allows the plugin to set/modify that page title.

fileintroducedretired
auth_login.php1.0.0

logout_post_session_destroy

This pair of hooks (logout_pre_session_destroy and logout_post_session_destroy) allows you to preserve some session variables that would otherwise get unset, when session_destroy() is called.

fileintroducedretired
logout.php1.0.0

logout_pre_session_destroy

This pair of hooks (logout_pre_session_destroy and logout_post_session_destroy) allows you to preserve some session variables that would otherwise get unset, when session_destroy() is called.

fileintroducedretired
logout.php1.0.0

This pair of hooks (nav_login_before and nav_login_after) allows you to add custom HTML to the navigation bar, before and after the "Logged in as " text.

fileintroducedretired
lib/functions.php1.0.0

This pair of hooks (nav_login_before and nav_login_after) allows you to add custom HTML to the navigation bar, before and after the "Logged in as " text.

fileintroducedretired
lib/functions.php1.0.0

page_bottom

This hook allows you to add custom HTML to the bottom of the page, after the main layout table.

fileintroducedretired
include/bottom_footer.php1.0.0

page_buttons

Allows you to add custom buttons and HTML to the top of the graph.php page, above the "Viewing graph" row.

fileintroducedretired
graph.php1.0.0

This hook allows you to add custom HTML tags to the page <head> tag.

fileintroducedretired
graph_realtime.php1.0.01.1.33
include/top_general_header.php1.0.01.1.33
include/top_graph_header.php1.0.01.1.33
include/top_header.php1.0.01.1.33
lib/html.php1.1.34

page_title

Allows the plugin to set/modify the page title

fileintroducedretired
include/top_general_header.php1.0.0
include/top_graph_header.php1.0.0
include/top_header.php1.0.0

poller_bottom

This hook allows you to launch other polling activities once Cacti has complete it's polling activities. Things like MacTrack, Boost, THold, and others use this hook to launch their respective poller.

fileintroducedretired
poller.php1.0.0

poller_command_args

Using this hook, your plugin can pass additional command line arguments to the poller.

fileintroducedretired
poller.php0.8.7i1.2.8

poller_exiting

fileintroducedretired
poller.php1.0.0

poller_finishing

fileintroducedretired
poller.php1.0.0

poller_output

This hook was designed specifically for the boost plug-in. However, it has found new life in many plugins making them much faster now. What this hook allows you to do is intercept the contents of the poller_output table before the data is deleted. This allows for things like threshold checking and other interesting actions such as checking for up/down events and the like. Previously, plugins were reliant on using things like rrdtool fetch to perform these actions. Now they can leverage the pollers output directly.

fileintroducedretired
lib/poller.php1.0.0

poller_remote_maint

This hook will fire for plugins that need to perform remote maintenance. It will only fire on the Remote Data Collectors.

fileintroducedretired
poller_maintenance.php1.2.23

poller_top

This hook allows you to launch processes concurrently with the Cacti poller for things like THolds fast poller for example.

fileintroducedretired
poller.php1.0.0

remote_agent

fileintroducedretired
remote_agent.php1.0.0

replicate_in

fileintroducedretired
lib/poller.php1.0.0

replicate_out

fileintroducedretired
lib/api_device.php
lib/poller.php1.0.0

resolve_dependencies

fileintroducedretired
lib/export.php1.2.0-beta1

rrd_graph_graph_options

This hook allows you to specify additional options or change parameters regarding graph image rendering. Some of the parameters will be passed to RRDtool.

fileintroducedretired
lib/rrd.php1.0.0

run_data_query

This hook allows your plugin to perform additional operations after a data query update was triggered.

fileintroducedretired
lib/data_query.php1.0.0

snmpagent_cache_install

fileintroducedretired
lib/snmpagent.php1.0.0

substitute_host_data

This allows you to add to the substitution variables that cacti can parse.

fileintroducedretired
lib/variables.php1.0.01.1.5

top_graph_header

Allows you to override the rendering of the top_graph_header.php include.

fileintroducedretired
include/top_graph_header.php0.8.7i1.1.38

top_graph_header_tabs

This hook is used to add tab's to Cacti's user interface.

fileintroducedretired
lib/html.php1.0.0

top_graph_jquery_function

fileintroducedretired
lib/html_tree.php1.0.0

top_graph_refresh

This allows you to change the refresh on the graph (and any plug-in page that calls the graph header)

fileintroducedretired
include/global_session.php1.0.0
include/themes/sunrise/global_session.php1.1.111.1.38

top_header

This hooks enables you to output custom HTML on top the the graph view page, if navigation tabs are not rendered. Allows you to override the rendering of the top_header.php include.

fileintroducedretired
include/top_general_header.php1.0.01.1.38
include/top_header.php0.8.7i1.1.38

tree_after

This hook allows you to add additional HTML at the bottom of the graph tree view page. The HTML is rendered only if a valid graph tree leaf is selected.

fileintroducedretired
lib/html_tree.php1.0.0

tree_view_page_end

This hook allows you to add additional HTML at the bottom of the graph tree view page, irrespective of the leaf selection.

fileintroducedretired
graph.php1.0.0
lib/html_tree.php1.0.0

ugroup_tabs

fileintroducedretired
user_group_admin.php1.0.0

update_data_source_title_cache

This hook is called after the data source title cache is updated.

fileintroducedretired
lib/variables.php1.0.0

user_admin_action

This hook is part of a series of hooks that allow you to add custom user settings. Consider a plug-in called "abc". In that plug-in, you want to save custom settings on a per user basis. Therefore, following our unpublished ? table naming standards, you would create a table called "abc_settings". When you tab over to the "abc" plug-in, you are provided an "abc settings" on the right similar to "Graphs". The next series of hooks allow you to present those settings to the user, enable or disable the users access to that specific "abc settings" tab and allow an administrator to define customer values for that plug-in on a per user basis.

fileintroducedretired
user_admin.php1.0.0

user_admin_edit

See the explanation on user_admin_action

fileintroducedretired
user_admin.php1.0.0

user_admin_run_action

See the explanation on user_admin_action

fileintroducedretired
user_admin.php1.0.0

user_admin_setup_sql_save

See the explanation on user_admin_action

fileintroducedretired
user_admin.php1.0.0

user_admin_tab

See the explanation on user_admin_action

fileintroducedretired
user_admin.php0.8.7i
utilities.php1.0.01.2.0-beta3

user_admin_user_save

See the explanation on user_admin_action

fileintroducedretired
user_admin.php1.0.0

user_group_admin_action

Similar to user_admin_action

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_edit

See the explanation on user_admin_action

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_save

See the explanation on user_admin_action

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_action

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_edit

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_save

fileintroducedretired
user_group_admin.php1.0.0

user_group_admin_setup_sql_save

fileintroducedretired
user_group_admin.php1.0.0

user_remove

Allows the plugin to take part in the user removal process. Important when the plugin maintains user settings.

fileintroducedretired
lib/auth.php1.0.0
user_admin.php1.0.0

utilities_action

This hook set's up the function to be executed from within Cacti's utilities section.

fileintroducedretired
utilities.php1.0.0

utilities_array

fileintroducedretired
utilities.php1.0.4

utilities_list

This hook allows you to add a custom utilities pick under Cacti's "Utilities" page.

fileintroducedretired
utilities.php1.0.0

utilities_tab

This hook allows you to add a custom utilities tab under Cacti's "Utilities" page.

fileintroducedretired
utilities.php1.2.0-beta3

valid_host_fields

Allows your plugin to define additional variables that will be used in substitute_host_data.

Pretty sure that this hook allows you to define custom replacement values in graphs.

fileintroducedretired
include/global_form.php1.0.0

Copyright (c) 2004-2026 The Cacti Group