]> granicus.if.org Git - icinga2/commitdiff
ITL: Add sar-perf 7428/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 16 Aug 2019 11:01:34 +0000 (13:01 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 16 Aug 2019 11:46:22 +0000 (13:46 +0200)
doc/08-advanced-topics.md
doc/10-icinga-template-library.md
itl/plugins-contrib.d/operating-system.conf

index 689be9a973f486e2f94459d4ac578ebee7c5882f..fe427abfb49a86773cffff7f040d8b1835eef2e2 100644 (file)
@@ -529,7 +529,7 @@ System              | Memory, Swap                  | [mem](10-icinga-template-library.md#plugin-contrib-co
 System         | Hardware                      | [hpasm](10-icinga-template-library.md#plugin-contrib-command-hpasm), [ipmi-sensor](10-icinga-template-library.md#plugin-contrib-command-ipmi-sensor)
 System         | Virtualization                | [VMware](10-icinga-template-library.md#plugin-contrib-vmware), [esxi_hardware](10-icinga-template-library.md#plugin-contrib-command-esxi-hardware)
 System         | Processes                     | [procs](10-icinga-template-library.md#plugin-check-command-processes), [service-windows](10-icinga-template-library.md#windows-plugins) (Windows Client)
-System         | System Activity Reports       | [check_sar_perf](https://github.com/dnsmichi/icinga-plugins/blob/master/scripts/check_sar_perf.py)
+System         | System Activity Reports       | [sar-perf](10-icinga-template-library.md#plugin-contrib-command-sar-perf)
 System         | I/O                           | [iostat](10-icinga-template-library.md#plugin-contrib-command-iostat)
 System         | Network interfaces            | [nwc_health](10-icinga-template-library.md#plugin-contrib-command-nwc_health), [interfaces](10-icinga-template-library.md#plugin-contrib-command-interfaces)
 System         | Users                         | [users](10-icinga-template-library.md#plugin-check-command-users), [users-windows](10-icinga-template-library.md#windows-plugins) (Windows Client)
index a3cec4fd6631e6a4776a85f703fdcfa59703e82e..06f99b79057802e2045ff795c94fb9b5ab48af80 100644 (file)
@@ -3293,6 +3293,19 @@ mem_cache    | **Optional.** If set to true, plugin will count cache as free mem
 mem_warning  | **Required.** Specify the warning threshold as number interpreted as percent.
 mem_critical | **Required.** Specify the critical threshold as number interpreted as percent.
 
+#### sar-perf <a id="plugin-contrib-command-sar-perf"></a>
+
+The [check_sar_perf.py](https://github.com/dnsmichi/check-sar-perf)
+plugin collects performance metrics from Linux hosts using the `sar` binary available in the `sysstat` package.
+
+Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
+
+Name             | Description
+-----------------|-----------------------------------------------------------------------------------------------------------------------
+sar_perf_profile | **Required.** Define the run profile: `pagestat`, `cpu`, `memory_util`, `memory_stat`, `io_transfer`, `queueln_load`, `swap_util`, `swap_stat`, `task`, `kernel`, `disk <disk>`. Can be a string or an array of multiple profiles.
+sar_perf_disk    | **Optional.** Disk name for the 'disk' profile.
+
+
 #### running_kernel <a id="plugin-contrib-command-running_kernel"></a>
 
 The [check_running_kernel](https://packages.debian.org/stretch/nagios-plugins-contrib) plugin
index 34e7ea9cfca3b53bcb0ec8ea0ea7afc68fd75c9f..afab177f0d1be9946ef5bd174add1116cdb8f57c 100644 (file)
@@ -31,6 +31,26 @@ object CheckCommand "mem" {
        vars.mem_cache = false
 }
 
+object CheckCommand "sar-perf" {
+       command = [ PluginContribDir + "/check_sar_perf.py" ]
+
+       arguments = {
+               "sar_perf_profile" = {
+                       value = "$sar_perf_profile$"
+                       description = "Define the run profile: pagestat, cpu, memory_util, memory_stat, io_transfer, queueln_load, swap_util, swap_stat, task, kernel, disk <disk>. Can be a string or an array of multiple profiles."
+                       skip_key = true
+                       repeat_key = false
+                       required = true
+               }
+               "sar_perf_disk" = {
+                       value = "$sar_perf_disk$"
+                       set_if = {{ macro("$sar_perf_profile$") == "disk" }}
+                       description = "Disk name for the 'disk' profile"
+                       skip_key = true
+               }
+       }
+}
+
 object CheckCommand "running_kernel" {
        command = {{
                var use_sudo = macro("$running_kernel_use_sudo$")