From 511727b3f603fd30ad55e52de866c0c9eee3aecb Mon Sep 17 00:00:00 2001 From: Maik Stuebner Date: Wed, 16 Dec 2020 12:04:03 +0100 Subject: [PATCH] Add parameter -f to snmp-process with var snmp_process_use_fullpath is set to true --- doc/10-icinga-template-library.md | 1 + itl/command-plugins-manubulon.conf | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index b9db4e2f7..983a47db1 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -2199,6 +2199,7 @@ snmp_process_name | **Optional.** Name of the process (regexp). No trai snmp_perf | **Optional.** Enable perfdata values. Defaults to true. snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. snmp_process_use_params | **Optional.** Add process parameters to process name for regexp matching. Example: "named.*-t /var/named/chroot" will only select named process with this parameter. Defaults to false. +snmp_process_use_fullpath | **Optional.** Use full path name instead of process name to select processes. Example: "/opt/app1/app1bin" will only select named process with this full path. Defaults to false. snmp_process_mem_usage | **Optional.** Define to check memory usage for the process. Defaults to false. snmp_process_mem_threshold | **Optional.** Defines the warning and critical thresholds in Mb when snmp_process_mem_usage set to true. Example "512,1024". Defaults to "0,0". snmp_process_cpu_usage | **Optional.** Define to check CPU usage for the process. Defaults to false. diff --git a/itl/command-plugins-manubulon.conf b/itl/command-plugins-manubulon.conf index c6ce5c249..3213e55a1 100644 --- a/itl/command-plugins-manubulon.conf +++ b/itl/command-plugins-manubulon.conf @@ -342,6 +342,10 @@ object CheckCommand "snmp-process" { set_if = "$snmp_process_use_params$" description = "Add parameters to select processes (ex : 'named.*-t /var/named/chroot' will only select named process with this parameter)" } + "-f" = { + set_if = "$snmp_process_use_fullpath$" + description = "Use full path name instead of process name to select processes (ex : '/opt/app1/app1bin' will only select named process with this full path)" + } "-m" = { set_if = "$snmp_process_mem_usage$" value = "$snmp_process_mem_threshold$" @@ -359,6 +363,7 @@ object CheckCommand "snmp-process" { vars.snmp_crit = 0 vars.snmp_perf = true vars.snmp_process_use_params = false + vars.snmp_process_use_fullpath = false vars.snmp_process_mem_usage = false vars.snmp_process_mem_threshold = "0,0" vars.snmp_process_cpu_usage = false