[icinga-checkins] icinga.org: icinga2/master: Add check command definition for check_graphite

git at icinga.org git at icinga.org
Fri Jul 29 11:40:17 CEST 2016


Module: icinga2
Branch: master
Commit: 6d082e61aeebe150c51d25b45f34d16a62893854
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=6d082e61aeebe150c51d25b45f34d16a62893854

Author: Markus Waldmüller <markus.waldmueller at netways.de>
Date:   Fri Jul 29 11:29:40 2016 +0200

Add check command definition for check_graphite

fixes #12256

Signed-off-by: Gunnar Beutner <gunnar.beutner at netways.de>

---

 doc/7-icinga-template-library.md     |   24 +++++++++++++
 itl/plugins-contrib.d/CMakeLists.txt |    2 +-
 itl/plugins-contrib.d/metrics.conf   |   62 ++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 1 deletion(-)

diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md
index e85b83a..e42f3bd 100644
--- a/doc/7-icinga-template-library.md
+++ b/doc/7-icinga-template-library.md
@@ -1972,6 +1972,30 @@ ipmi_number_of_active_fans       | **Optional.** Number of fans that should be a
 ipmi_show_fru                    | **Optional.** Print the product serial number if it is available in the IPMI FRU data.
 ipmi_no_sel_checking             | **Optional.** Turn off system event log checking via ipmi-sel.
 
+### <a id="plugins-contrib-metrics"></a> Metrics
+
+This category includes all plugins for metric-based checks.
+
+#### <a id="plugin-check-command-graphite"></a> graphite
+
+Check command object for the [check_graphite](https://github.com/obfuscurity/nagios-scripts) plugin.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                                | Description
+------------------------------------|-----------------------------------------------------------------------------------------------------
+graphite_url                        | **Required.** Target url.
+graphite_metric                     | **Required.** Metric path string.
+graphite_shortname                  | **Optional.** Metric short name (used for performance data).
+graphite_duration                   | **Optional.** Length, in minute of data to parse (default: 5).
+graphite_function                   | **Optional.** Function applied to metrics for thresholds (default: average).
+graphite_warning                    | **Required.** Warning threshold.
+graphite_critical                   | **Required.** Critical threshold.
+graphite_units                      | **Optional.** Adds a text tag to the metric count in the plugin output. Useful to identify the metric units. Doesn't affect data queries.
+graphite_message                    | **Optional.** Text message to output (default: "metric count:").
+graphite_zero_on_error              | **Optional.** Return 0 on a graphite 500 error.
+graphite_link_graph                 | **Optional.** Add a link in the plugin output, showing a 24h graph for this metric in graphite.
+
 ### <a id="plugins-contrib-network-components"></a> Network Components
 
 This category includes all plugins for various network components like routers, switches and firewalls.
diff --git a/itl/plugins-contrib.d/CMakeLists.txt b/itl/plugins-contrib.d/CMakeLists.txt
index 0ce1e66..d2b130e 100644
--- a/itl/plugins-contrib.d/CMakeLists.txt
+++ b/itl/plugins-contrib.d/CMakeLists.txt
@@ -16,6 +16,6 @@
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 install(
-  FILES databases.conf icingacli.conf ipmi.conf network-components.conf operating-system.conf virtualization.conf vmware.conf web.conf hardware.conf network-services.conf
+  FILES databases.conf icingacli.conf ipmi.conf network-components.conf operating-system.conf virtualization.conf vmware.conf web.conf hardware.conf network-services.conf metrics.conf
   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2/include/plugins-contrib.d
 )
diff --git a/itl/plugins-contrib.d/metrics.conf b/itl/plugins-contrib.d/metrics.conf
new file mode 100644
index 0000000..f7734de
--- /dev/null
+++ b/itl/plugins-contrib.d/metrics.conf
@@ -0,0 +1,62 @@
+object CheckCommand "graphite" {
+	import "plugin-check-command"
+
+	command = [ PluginContribDir + "/check_graphite" ]
+
+	arguments = {
+		"-u" = {
+			value = "$graphite_url$"
+			description = "Target url"
+			required = true
+		}
+		"-m" = {
+			value = "$graphite_metric$"
+			description = "Metric path string"
+			required = true
+		}
+		"-s" = {
+			value = "$graphite_shortname$"
+			description = "Metric short name (used for performance data)"
+		}
+		"-d" = {
+			value = "$graphite_duration$"
+			description = "Length, in minute of data to parse (default: 5)"
+		}
+		"-f" = {
+			value = "$graphite_function$"
+			description = "Function applied to metrics for thresholds (default: average)"
+		}
+		"-w" = {
+			value = "$graphite_warning$"
+			description = "Warning threshold"
+			required = true
+		}
+		"-c" = {
+			value = "$graphite_critical$"
+			description = "Critical threshold"
+			required = true
+		}
+		"-U" = {
+			value = "$graphite_units$"
+			description = "Adds a text tag to the metric count in the plugin output. Useful to identify the metric units. Doesn't affect data queries."
+		}
+		"-M" = {
+			value = "$graphite_message$"
+			description = "Text message to output (default: 'metric count:')"
+		}
+		"-z" = {
+			set_if = "$graphite_zero_on_error$"
+			description = "Return 0 on a graphite 500 error"
+		}
+		"-l" = {
+			set_if = "$graphite_link_graph$"
+			description = "Add a link in the plugin output, showing a 24h graph for this metric in graphite."
+		}
+	}
+
+	vars.graphite_duration = "5"
+	vars.graphite_function = "average"
+	vars.graphite_message = "metric count:"
+	vars.graphite_zero_on_error = false
+	vars.graphite_link_graph = false
+}



More information about the icinga-checkins mailing list