]> granicus.if.org Git - icinga2/commitdiff
Adding check_uptime to itl 7437/head
authorMax Deparade <max.deparade@netways.de>
Thu, 22 Aug 2019 13:03:11 +0000 (15:03 +0200)
committerMax Deparade <max.deparade@netways.de>
Mon, 26 Aug 2019 09:13:58 +0000 (11:13 +0200)
doc/10-icinga-template-library.md
itl/command-plugins.conf

index 06f99b79057802e2045ff795c94fb9b5ab48af80..bbd3e824b7ec3c12bc458218e13d8907f132f720 100644 (file)
@@ -1485,6 +1485,21 @@ users_wgreater  | **Optional.** The user count warning threshold. Defaults to 20
 users_cgreater  | **Optional.** The user count critical threshold. Defaults to 50.
 
 
+### uptime <a id="plugin-check-command-uptime"></a>
+
+The [check_uptime](https://www.monitoring-plugins.org/doc/man/check_uptime.html) plugin
+checks the uptime of the system using /proc/uptime.
+
+Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
+
+Name            | Description
+----------------|--------------
+uptime_warning  | **Required.** Min. number of uptime to generate warning (-w 30m). Defaults to 30m.
+uptime_critical | **Required.** Min. number of uptime to generate critical alert (-c 15m). Defaults to 15m.
+uptime_for      | **Optional.** Show uptime in a pretty format (Running for x weeks, x days, ...). Defaults to false.
+uptime_since    | **Optional.** Show last boot in yyyy-mm-dd HH:MM:SS format (output from 'uptime -s'). Defaults to false.
+
+
 
 ## Windows Plugins for Icinga 2 <a id="windows-plugins"></a>
 
index 144cb3684b2cef8fdd7033d4e668ff9bbc0afa33..c3f7ffe1f9265ea097155e53f488a4c48b946a8e 100644 (file)
@@ -3140,3 +3140,32 @@ object CheckCommand "rpc" {
 
        vars.rpc_address = "$check_address$"
 }
+
+object CheckCommand "uptime" {
+        command = [ PluginDir + "/check_uptime" ]
+
+        arguments = {
+               "--warning" = {
+                       value = "$uptime_warning$"
+                       description = "Min. number of uptime to generate warning"
+                       required = true
+               }
+               "--critical" = {
+                       value = "$uptime_critical$"
+                       description = "Min. number of uptime to generate critical alert ( w < c )"
+                       required = true
+               }
+               "--for" = {
+                       set_if = "$uptime_for$"
+                       description = "Show uptime in a pretty format (Running for x weeks, x days, ...)"
+               }
+               "--since" = {
+                       set_if = "$uptime_since$"
+                       description = "Show last boot in yyyy-mm-dd HH:MM:SS format (output from 'uptime -s')"
+               }
+       }
+
+       vars.uptime_warning = "30m"
+       vars.uptime_critical = "15m"
+}
+