Merge pull request #8569 from StuebiSoft/feature/snmp-process-use-fullpath

Add parameter -f to snmp-process
This commit is contained in:
Julian Brost 2020-12-23 14:17:11 +01:00 committed by GitHub
commit 8df3d965b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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.

View File

@ -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