Add hook for Threshold autocreation

This change adds a new hook which Cacti v1.3 can call during
an automation cycle to automatically create a Threshold for
the given device.  It removes the need for hardcoded plugin
functionality/checks just to generate the thresholds
This commit is contained in:
netniV committed 2019-03-28 08:45:42 +00:00
1 parent 1c9afd8f76
commit 6c357c9da3
3 files changed
+12 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[info]
name = thold
version = 1.2.1
version = 1.2.2
longname = Thresholds
author = The Cacti Group
email =
+6
View File
@@ -101,6 +101,12 @@ that.
## ChangeLog
--- 1.2.2 ---
* feature: Add hook for Threshold autocreation during automation cycle. This
allows Cacti v1.3 to use a hook instead of hardcoded plugin functionality to
generate the thresholds
--- 1.2.1 ---
* feature: Allow CLOG to direct link to threshold
+5
View File
@@ -56,6 +56,7 @@ function plugin_thold_install($upgrade = false) {
api_plugin_register_hook($plugin, 'device_action_prepare', 'thold_device_action_prepare', 'setup.php');
api_plugin_register_hook($plugin, 'api_device_save', 'thold_api_device_save', 'setup.php');
api_plugin_register_hook($plugin, 'host_edit_bottom', 'thold_host_edit_bottom', 'setup.php');
api_plugin_register_hook($plugin, 'device_threshold_autocreate', 'thold_device_autocreate', 'setup.php');
// Automation Hooks
api_plugin_register_hook($plugin, 'create_complete_graph_from_template', 'thold_create_graph_thold', 'setup.php');
@@ -1388,6 +1389,10 @@ function thold_device_template_top() {
}
}
function thold_hook_device_autocreate($host_id) {
autocreate($host_id);
}
function thold_create_graph_thold($save) {
global $config;