From 61655171de7d7522fed9355f677932d69a5a2396 Mon Sep 17 00:00:00 2001 From: lorenzg Date: Fri, 16 Oct 2026 14:23:58 +0200 Subject: [PATCH 1/3] update docs --- Makefile | 2 +- docs/checks/commands/_index.md | 8 +- docs/checks/commands/check_connections.md | 64 +++++----- docs/checks/commands/check_cpu.md | 64 +++++----- docs/checks/commands/check_cpu_utilization.md | 72 ++++++------ docs/checks/commands/check_dns.md | 2 +- docs/checks/commands/check_drive_io.md | 83 +++++++------ docs/checks/commands/check_drivesize.md | 86 +++++++------- docs/checks/commands/check_dummy.md | 12 +- docs/checks/commands/check_eventlog.md | 70 ++++++----- docs/checks/commands/check_files.md | 70 ++++++----- docs/checks/commands/check_http.md | 2 +- docs/checks/commands/check_index.md | 62 +++++----- docs/checks/commands/check_kernel_stats.md | 54 +++++---- docs/checks/commands/check_load.md | 54 +++++---- docs/checks/commands/check_logfile.md | 66 +++++------ docs/checks/commands/check_mailq.md | 60 +++++----- docs/checks/commands/check_memory.md | 72 ++++++------ docs/checks/commands/check_mount.md | 58 +++++---- docs/checks/commands/check_multi.md | 86 +++++++------- docs/checks/commands/check_network.md | 52 ++++----- docs/checks/commands/check_nsc_web.md | 5 +- docs/checks/commands/check_ntp_offset.md | 68 ++++++----- docs/checks/commands/check_omd.md | 68 ++++++----- docs/checks/commands/check_os_updates.md | 72 ++++++------ docs/checks/commands/check_os_version.md | 58 +++++---- docs/checks/commands/check_pagefile.md | 52 ++++----- docs/checks/commands/check_pdh.md | 57 +++++---- docs/checks/commands/check_ping.md | 56 +++++---- docs/checks/commands/check_process.md | 110 +++++++++--------- docs/checks/commands/check_service_linux.md | 86 +++++++------- docs/checks/commands/check_service_windows.md | 76 ++++++------ docs/checks/commands/check_snclient.md | 2 +- .../checks/commands/check_snclient_version.md | 58 +++++---- docs/checks/commands/check_ssh.md | 2 +- docs/checks/commands/check_swap_io.md | 68 ++++++----- docs/checks/commands/check_tasksched.md | 62 +++++----- docs/checks/commands/check_tcp.md | 2 +- docs/checks/commands/check_temperature.md | 68 ++++++----- docs/checks/commands/check_uptime.md | 52 ++++----- docs/checks/commands/check_wmi.md | 48 ++++---- docs/checks/external_commands/_index.md | 2 +- docs/checks/macros/_index.md | 46 ++++++++ docs/checks/plugins/_index.md | 2 +- docs/checks/plugins/check_dns.md | 68 ++++++----- docs/checks/plugins/check_http.md | 103 ++++++++-------- docs/checks/plugins/check_nsc_web.md | 1 + docs/checks/plugins/check_snclient.md | 62 +++++----- docs/checks/plugins/check_ssh.md | 64 +++++----- docs/checks/plugins/check_tcp.md | 77 ++++++------ docs/configuration/_index.md | 43 +------ pkg/check_dns/check_dns.go | 2 +- pkg/check_http/check_http.go | 16 +-- pkg/check_tcp/check_tcp.go | 4 +- pkg/snclient/builtin_check.go | 1 + pkg/snclient/check_connections.go | 2 +- pkg/snclient/check_cpu.go | 2 +- pkg/snclient/check_cpu_utilization.go | 20 ++-- pkg/snclient/check_dns.go | 2 +- pkg/snclient/check_drive_io.go | 23 ++-- pkg/snclient/check_drivesize.go | 6 +- pkg/snclient/check_drivesize_other.go | 6 +- pkg/snclient/check_drivesize_windows.go | 4 +- pkg/snclient/check_eventlog.go | 8 +- pkg/snclient/check_files.go | 8 +- pkg/snclient/check_http.go | 8 +- pkg/snclient/check_index.go | 10 +- pkg/snclient/check_kernel_stats_linux.go | 2 +- pkg/snclient/check_load.go | 2 +- pkg/snclient/check_logfile.go | 12 +- pkg/snclient/check_mailq.go | 4 +- pkg/snclient/check_memory.go | 12 +- pkg/snclient/check_multi.go | 2 +- pkg/snclient/check_ntp_offset.go | 16 +-- pkg/snclient/check_omd.go | 6 +- pkg/snclient/check_os_updates.go | 6 +- pkg/snclient/check_os_version.go | 6 +- pkg/snclient/check_pdh.go | 15 ++- pkg/snclient/check_ping.go | 6 +- pkg/snclient/check_process.go | 22 ++-- pkg/snclient/check_service_linux.go | 14 +-- pkg/snclient/check_service_windows.go | 10 +- pkg/snclient/check_snclient.go | 4 +- pkg/snclient/check_snclient_version.go | 2 +- pkg/snclient/check_ssh.go | 10 +- pkg/snclient/check_swap_io.go | 10 +- pkg/snclient/check_tasksched.go | 10 +- pkg/snclient/check_tcp.go | 11 +- pkg/snclient/check_temperature.go | 6 +- pkg/snclient/check_wmi.go | 2 +- pkg/snclient/checkdata.go | 15 ++- 91 files changed, 1446 insertions(+), 1518 deletions(-) create mode 100644 docs/checks/macros/_index.md diff --git a/Makefile b/Makefile index 7383cfc8b..e177f310e 100644 --- a/Makefile +++ b/Makefile @@ -791,7 +791,7 @@ docs_plugin_links: set -e; \ for CHK in $(DOC_PLUGINS); do \ echo "updating docs/checks/commands/$$CHK.md"; \ - printf -- '---\ntitle: %s\ncomment: auto-generated by make docs, do not edit\n---\n\n%s is a built-in check plugin. Its documentation is in the [plugins section](../plugins/%s/).\n' "$${CHK#check_}" "$$CHK" "$$CHK" > docs/checks/commands/$$CHK.md ; \ + printf -- '---\ntitle: %s\ncomment: auto-generated by make docs, do not edit\n---\n\n%s is a built-in check plugin. Its documentation is in the [plugins section](../plugins/%s/).\n' "$$CHK" "$$CHK" "$$CHK" > docs/checks/commands/$$CHK.md ; \ done docs_check_service: diff --git a/docs/checks/commands/_index.md b/docs/checks/commands/_index.md index 58cd2f9b3..709f6f319 100644 --- a/docs/checks/commands/_index.md +++ b/docs/checks/commands/_index.md @@ -1,13 +1,11 @@ --- -title: Check Commands +title: Built-in commands weight: 2000 --- -The following build in commands are available: +This is the list of built-in check commands. Most of them are drop-in replacements for the NSClient++ equivalent. -This is the list of built-in checks. They work like check commands in NSClient++. - -Each check usually has a help page which can be accessed by the `help` argument. +Each check command has a help page which can be accessed by the `help` argument. For example: diff --git a/docs/checks/commands/check_connections.md b/docs/checks/commands/check_connections.md index e13519ced..834ef416a 100644 --- a/docs/checks/commands/check_connections.md +++ b/docs/checks/commands/check_connections.md @@ -1,15 +1,13 @@ --- -title: connections +title: check_connections comment: auto-generated by make docs, do not edit --- -## check_connections +Checks the number of TCP connections. -Checks the number of tcp connections. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,34 +15,6 @@ Checks the number of tcp connections. |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | -## Examples - -### Default Check - - check_connections - OK - total connections 60 - -Check only ipv6 connections: - - check_connections inet=ipv6 - OK - total ipv6 connections 13 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_connections - use generic-service - check_command check_nrpe!check_connections!'warn=total > 500' 'crit=total > 1500' - } - ## Argument Defaults | Argument | Default Value | @@ -87,3 +57,31 @@ these can be used in filters and thresholds (along with the default attributes): | listen | total number of connections of type: listen | | closing | total number of connections of type: closing | | new_syn_recv | total number of connections of type: new_syn_recv | + +## Examples + +### Default Check + + check_connections + OK - total connections 60 + +Check only ipv6 connections: + + check_connections inet=ipv6 + OK - total ipv6 connections 13 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_connections + use generic-service + check_command check_nrpe!check_connections!'warn=total > 500' 'crit=total > 1500' + } diff --git a/docs/checks/commands/check_cpu.md b/docs/checks/commands/check_cpu.md index 733b26f65..971a3d9e2 100644 --- a/docs/checks/commands/check_cpu.md +++ b/docs/checks/commands/check_cpu.md @@ -1,15 +1,13 @@ --- -title: cpu +title: check_cpu comment: auto-generated by make docs, do not edit --- -## check_cpu +Checks the CPU usage metrics. -Checks the cpu usage metrics. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,34 +15,6 @@ Checks the cpu usage metrics. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_cpu - OK - CPU load is ok. |'total 5m'=13%;80;90 'total 1m'=13%;80;90 'total 5s'=13%;80;90 - -Checking **each core** by adding filter=none (disabling the filter): - - check_cpu filter=none - OK - CPU load is ok. |'core1 5m'=13%;80;90 'core1 1m'=12%;80;90 'core1 5s'=9%;80;90... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_cpu - use generic-service - check_command check_nrpe!check_cpu!'warn=load > 80' 'crit=load > 95' - } - ## Argument Defaults | Argument | Default Value | @@ -80,3 +50,31 @@ these can be used in filters and thresholds (along with the default attributes): | kernel | Current kernel load for a given core (currently not supported) | | load | Current load for a given core | | time | Time frame checked | + +## Examples + +### Default Check + + check_cpu + OK - CPU load is ok. |'total 5m'=13%;80;90 'total 1m'=13%;80;90 'total 5s'=13%;80;90 + +Checking **each core** by adding filter=none (disabling the filter): + + check_cpu filter=none + OK - CPU load is ok. |'core1 5m'=13%;80;90 'core1 1m'=12%;80;90 'core1 5s'=9%;80;90... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_cpu + use generic-service + check_command check_nrpe!check_cpu!'warn=load > 80' 'crit=load > 95' + } diff --git a/docs/checks/commands/check_cpu_utilization.md b/docs/checks/commands/check_cpu_utilization.md index 88f68928c..5d251fa99 100644 --- a/docs/checks/commands/check_cpu_utilization.md +++ b/docs/checks/commands/check_cpu_utilization.md @@ -1,15 +1,13 @@ --- -title: cpu_utilization +title: check_cpu_utilization comment: auto-generated by make docs, do not edit --- -## check_cpu_utilization +Checks the CPU utilization metrics. -Checks the cpu utilization metrics. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the cpu utilization metrics. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_cpu_utilization -OK - user: 2% - system: 1% - iowait: 0% - steal: 0% - guest: 0 - idle: 96% |'total'=3.4%;90;95;0; 'user'=2.11%;;;0;... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_cpu_utilization - use generic-service - check_command check_nrpe!check_cpu_utilization!'warn=total > 90%' 'crit=total > 95%' - } - ## Argument Defaults | Argument | Default Value | @@ -66,12 +41,35 @@ Naemon Config these can be used in filters and thresholds (along with the default attributes): -| Attribute | Description | -| --------- | ---------------------------------------------------- | -| total | Sum of user,system,iowait,steal and guest in percent | -| user | User cpu utilization in percent | -| system | System cpu utilization in percent | -| iowait | IOWait cpu utilization in percent | -| steal | Steal cpu utilization in percent | -| guest | Guest cpu utilization in percent | -| idle | Idle cpu utilization in percent | +| Attribute | Description | +| --------- | ------------------------------------------------------- | +| total | Sum of user, system, iowait, steal and guest in percent | +| user | User CPU utilization in percent | +| system | System CPU utilization in percent | +| iowait | IOWait CPU utilization in percent | +| steal | Steal CPU utilization in percent | +| guest | Guest CPU utilization in percent | +| idle | Idle CPU utilization in percent | + +## Examples + +### Default Check + + check_cpu_utilization + OK - user: 2% - system: 1% - iowait: 0% - steal: 0% - guest: 0 - idle: 96% |'total'=3.4%;90;95;0; 'user'=2.11%;;;0;... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_cpu_utilization + use generic-service + check_command check_nrpe!check_cpu_utilization!'warn=total > 90%' 'crit=total > 95%' + } diff --git a/docs/checks/commands/check_dns.md b/docs/checks/commands/check_dns.md index 8e92f91ca..3fffed3c3 100644 --- a/docs/checks/commands/check_dns.md +++ b/docs/checks/commands/check_dns.md @@ -1,5 +1,5 @@ --- -title: dns +title: check_dns comment: auto-generated by make docs, do not edit --- diff --git a/docs/checks/commands/check_drive_io.md b/docs/checks/commands/check_drive_io.md index 81b865c1d..107da9dd1 100644 --- a/docs/checks/commands/check_drive_io.md +++ b/docs/checks/commands/check_drive_io.md @@ -1,15 +1,13 @@ --- -title: drive_io +title: check_drive_io comment: auto-generated by make docs, do not edit --- -## check_drive_io +Checks the disk I/O on the host. -Checks the disk Input / Output on the host. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,35 +15,6 @@ Checks the disk Input / Output on the host. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_drive_io - OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C -_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; - -Check a UNIX drive and alert if for the last 30 seconds written bytes/second is above 10 Mb/s . Dm-0 is the name of the encrypted volume, it could be nvme0n1 or sdb as well - - check_drivesize lookback=30 warn="write_bytes_rate > 10Mb" - OK - dm-0 >1.8 MiB/s/s <815.0 B/s/s 0.0%, sda1 >0 B/s/s <0 B/s/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; 'sda1_read_count'=3178c;;;0; 'sda1_read_bytes'=67430400c;;;0; 'sda1_read_time'=13572ms;;;0; 'sda1_write_count'=3193c;;;0; 'sda1_write_bytes'=282012672c;;;0; 'sda1_write_time'=9446ms;;;0; 'sda1_utilization'=0%;95;;0; 'sda1_io_time'=10832ms;;;0; 'sda1_weighted_io'=23019;;;0; 'sda1_iops_in_progress'=0;;;0; - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_drive_io - use generic-service - check_command check_nrpe!check_drive_io! - } - ## Argument Defaults | Argument | Default Value | @@ -59,10 +28,10 @@ Naemon Config ## Check Specific Arguments -| Argument | Description | -| -------- | ----------------------------------------------------------------------------------------------------- | -| drive | Name(s) of the drives to check the IO stats for ex.: c: or / .If left empty, it will check all drives | -| lookback | Lookback period for value change rate and utilization calculations, given in seconds. Default: 300 | +| Argument | Description | +| -------- | -------------------------------------------------------------------------------------------------- | +| drive | Names of the drives to check I/O stats for, e.g. C: or sda. If left empty, all drives are checked | +| lookback | Lookback period for value change rate and utilization calculations, given in seconds. Default: 300 | ## Attributes @@ -72,8 +41,8 @@ these can be used in filters and thresholds (along with the default attributes): | Attribute | Description | | -------------------------- | ---------------------------------------------------------------------------------------- | -| drive | Name(s) of the drives to check the io stats for. If left empty, it will check all drives. For Windows this is the drive letter. For UNIX it is the logical name of the drive. | -| lookback | Lookback period for which the value change rate and utilization is calculated. | +| drive | Names of the drives to check I/O stats for. If left empty, it will check all drives. For Windows this is the drive letter. For UNIX it is the logical name of the drive. | +| lookback | Lookback period for which the value change rate and utilization are calculated. | | read_count | Total number of read operations completed successfully | | read_count_rate | Number of read operations per second during the lookback period | | read_bytes | Total number of bytes read from the disk | @@ -84,7 +53,7 @@ these can be used in filters and thresholds (along with the default attributes): | write_count_rate | Number of write operations per second during the lookback period | | write_bytes | Total number of bytes written to the disk | | write_bytes_rate | Average bytes written per second during the lookback period | -| write_bytes_rate_humanized | Average bytes read per second during the lookback period, written in humanized format | +| write_bytes_rate_humanized | Average bytes written per second during the lookback period, written in humanized format | | write_time | Total time spent on write operations (milliseconds). | | label | Label of the drive. Windows does not report this. | | io_time | Total time during which the disk had at least one active I/O (milliseconds). Windows does not report this. | @@ -94,5 +63,33 @@ these can be used in filters and thresholds (along with the default attributes): | iops_in_progress | Number of I/O operations currently in flight. Windows does not report this. | | idle_time | Count of the 100 ns periods the disk was idle. Windows only | | query_time | The time the performance query was sent. Count of 100 ns periods since the Win32 epoch of 01.01.1601. Windows only | -| queue_depth | The depth of the IO queue. Windows only. | -| split_count | The cumulative count of IOs that are associated IOs. Windows only. | +| queue_depth | The depth of the I/O queue. Windows only. | +| split_count | The cumulative count of I/Os that are associated I/Os. Windows only. | + +## Examples + +### Default Check + + check_drive_io + OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; + +Check a UNIX drive and alert if the average write rate over the last 30 seconds exceeds 10 MB/s. Here, dm-0 is the encrypted volume; it could be nvme0n1 or sdb instead. + + check_drive_io drive=dm-0 lookback=30 warn="write_bytes_rate > 10MB" + OK - dm-0 >1.8 MiB/s <815.0 B/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_drive_io + use generic-service + check_command check_nrpe!check_drive_io! + } diff --git a/docs/checks/commands/check_drivesize.md b/docs/checks/commands/check_drivesize.md index 4d8c3a586..44e446048 100644 --- a/docs/checks/commands/check_drivesize.md +++ b/docs/checks/commands/check_drivesize.md @@ -1,15 +1,13 @@ --- -title: drivesize +title: check_drivesize comment: auto-generated by make docs, do not edit --- -## check_drivesize - Checks the disk drive/volumes usage on a host. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,43 +15,6 @@ Checks the disk drive/volumes usage on a host. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_drivesize drive=/ show-all - OK - / 280.155 GiB/455.948 GiB (64.7%) |... - -Check drive including inodes: - - check_drivesize drive=/ warn="used > 90%" "crit=used > 95%" "warn=inodes > 90%" "crit=inodes > 95%" - OK - All 1 drive(s) are ok |'/ used'=307515822080B;440613398938;465091921101;0;489570443264 '/ used %'=62.8%;90;95;0;100 '/ inodes'=12.1%;90;95;0;100 - -Check folder, no matter if its a mountpoint itself or not: - - check_drivesize folder=/tmp show-all - OK - /tmp 280.155 GiB/455.948 GiB (64.7%) |... - -This check supports specifying different usage thresholds for each drive. Use '[drive] used_pct' or '[drive] used %' in the condition: - check_drivesize "drive=/" "drive=/tmp" "warn='/ used_pct' gt 70" "crit='/tmp used %' > 1" - CRITICAL - / 428.040 GiB/935.929 GiB (45.7%), /tmp 471.496 MiB/31.127 GiB (1.5%) |'/ used'=459604856832B;;;0;1004946423808 '/ used %'=45.7%;70;;0;100 '/tmp used'=494399488B;;;0;33422544896 '/tmp used %'=1.5%;;1;0;100 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_drivesize - use generic-service - check_command check_nrpe!check_drivesize!'warn=used_pct > 90' 'crit=used_pct > 95' - } - ## Argument Defaults | Argument | Default Value | @@ -114,7 +75,7 @@ these can be used in filters and thresholds (along with the default attributes): | size_bytes | Total size in bytes | | inodes_free | Number of free inodes | | inodes_free_pct | Number of free inodes in percent | -| inodes_total | Number of total free inodes | +| inodes_total | Total number of inodes | | inodes_used | Number of used inodes | | inodes_used_pct | Number of used inodes in percent | | media_type | Windows only: numeric media type of drive | @@ -122,9 +83,46 @@ these can be used in filters and thresholds (along with the default attributes): | readable | Windows only: flag drive is readable (0/1) | | writable | Windows only: flag drive is writable (0/1) | | removable | Windows only: flag drive is removable (0/1) | -| erasable | Windows only: flag whether if drive is erasable (0/1) | -| hotplug | Windows only: flag drive is hotplugable (0/1) | +| erasable | Windows only: flag whether the drive is erasable (0/1) | +| hotplug | Windows only: flag drive is hot-pluggable (0/1) | | remote_name | Windows only: the remote name of the drive, if it uses a network name | | persistent | Windows only: if the network drive is mounted as persistent (0/1) | | hidden | Windows only: if the network share is a hidden share, i.e. the share name ends with a dollar sign like C\$ (0/1) | | localised_remote_path | Windows only: If the path is given as a remote path, and that remote path has an assigned logical drive, this is the replaced path under that logical drive. | + +## Examples + +### Default Check + + check_drivesize drive=/ show-all + OK - / 280.155 GiB/455.948 GiB (61.4%) |... + +Check drive including inodes: + + check_drivesize drive=/ warn="used > 90%" "crit=used > 95%" "warn=inodes > 90%" "crit=inodes > 95%" + OK - All 1 drive(s) are ok |'/ used'=307515822080B;440613398938;465091921101;0;489570443264 '/ used %'=62.8%;90;95;0;100 '/ inodes'=12.1%;90;95;0;100 + +Check folder, no matter if it's a mount point itself or not: + + check_drivesize folder=/tmp show-all + OK - /tmp 280.155 GiB/455.948 GiB (61.4%) |... + +This check supports specifying different usage thresholds for each drive. Use '[drive] used_pct' or '[drive] used %' in the condition: + check_drivesize "drive=/" "drive=/tmp" "warn='/ used_pct' gt 70" "crit='/tmp used %' > 1" + CRITICAL - / 428.040 GiB/935.929 GiB (45.7%), /tmp 471.496 MiB/31.127 GiB (1.5%) |'/ used'=459604856832B;;;0;1004946423808 '/ used %'=45.7%;70;;0;100 '/tmp used'=494399488B;;;0;33422544896 '/tmp used %'=1.5%;;1;0;100 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_drivesize + use generic-service + check_command check_nrpe!check_drivesize!'warn=used_pct > 90' 'crit=used_pct > 95' + } diff --git a/docs/checks/commands/check_dummy.md b/docs/checks/commands/check_dummy.md index b249015b6..2971cab6a 100644 --- a/docs/checks/commands/check_dummy.md +++ b/docs/checks/commands/check_dummy.md @@ -1,10 +1,8 @@ --- -title: dummy +title: check_dummy comment: auto-generated by make docs, do not edit --- -## check_dummy - This check simply sets the state to the given value and outputs the remaining arguments. - [Examples](#examples) @@ -15,6 +13,10 @@ This check simply sets the state to the given value and outputs the remaining ar |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +## Check Specific Arguments + +None + ## Examples ### Default Check @@ -37,7 +39,3 @@ Naemon Config use generic-service check_command check_nrpe!check_dummy!0 'some example output' } - -## Check Specific Arguments - -None diff --git a/docs/checks/commands/check_eventlog.md b/docs/checks/commands/check_eventlog.md index 567e9862e..62332514c 100755 --- a/docs/checks/commands/check_eventlog.md +++ b/docs/checks/commands/check_eventlog.md @@ -1,13 +1,11 @@ --- -title: eventlog +title: check_eventlog comment: auto-generated by make docs, do not edit --- -## check_eventlog +Checks the Windows eventlog entries. -Checks the windows eventlog entries. - -Basically, this check wraps this wmi query: +Basically, this check wraps this WMI query: SELECT ComputerName, LogFile, @@ -26,13 +24,13 @@ FROM See https://learn.microsoft.com/en-us/previous-versions/windows/desktop/eventlogprov/win32-ntlogevent for a description of the provided fields. -Filter conditions on id are added to the WHERE clause of the wmi query when possible, +Filter conditions on id are added to the WHERE clause of the WMI query when possible, the filter is still applied to the returned events. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -40,34 +38,6 @@ the filter is still applied to the returned events. |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | -## Examples - -### Default Check - - check_eventlog - OK - Event log seems fine - - Return all events, by default only unique events will be returned: - - check_eventlog "detail-syntax=%(id) %(uniqueindex)" "unique-index=0" - WARNING - 4 message(s) warning(10010 Application-Microsoft-Windows-RestartManager-10010, 10016 System-Microsoft-Windows-DistributedCOM-10016, 6155 System-LsaSrv-6155, 6147 System-LsaSrv-6147) - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_eventlog - use generic-service - check_command check_nrpe!check_eventlog!filter=provider = 'Microsoft-Windows-Security-SPP' and id = 903 and message like 'foo' - } - ## Argument Defaults | Argument | Default Value | @@ -111,4 +81,32 @@ these can be used in filters and thresholds (along with the default attributes): | message | The message as a string | | source | The source system (SourceName) | | provider | Alias for source | -| written | Time of the message being written( TimeWritten) | +| written | Time of the message being written (TimeWritten) | + +## Examples + +### Default Check + + check_eventlog + OK - Event log seems fine + + Return all events, by default only unique events will be returned: + + check_eventlog "detail-syntax=%(id) %(uniqueindex)" "unique-index=0" + WARNING - 4 message(s) warning(10010 Application-Microsoft-Windows-RestartManager-10010, 10016 System-Microsoft-Windows-DistributedCOM-10016, 6155 System-LsaSrv-6155, 6147 System-LsaSrv-6147) + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_eventlog + use generic-service + check_command check_nrpe!check_eventlog!filter=provider = 'Microsoft-Windows-Security-SPP' and id = 903 and message like 'foo' + } diff --git a/docs/checks/commands/check_files.md b/docs/checks/commands/check_files.md index 1d104265d..73a24f917 100644 --- a/docs/checks/commands/check_files.md +++ b/docs/checks/commands/check_files.md @@ -1,15 +1,13 @@ --- -title: files +title: check_files comment: auto-generated by make docs, do not edit --- -## check_files - Checks files and directories. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,36 +15,6 @@ Checks files and directories. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - -Alert if there are logs older than 1 hour in /tmp: - - check_files path="/tmp" pattern="*.log" "filter=age > 1h" crit="count > 0" empty-state=0 empty-syntax="no old files found" top-syntax="found %(count) too old logs" - OK - All 138 files are ok: (29.22 MiB) |'count'=138;500;600;0 'size'=30642669B;;;0 - -Check for folder size: - - check_files 'path=/tmp' 'warn=total_size > 200MiB' 'crit=total_size > 300MiB' - OK - All 145 files are ok: (34.72 MiB) |'count'=145;;;0 'size'=36406741B;209715200;314572800;0 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_files - use generic-service - check_command check_nrpe!check_files!'path=/tmp' 'filter=age > 3d' 'warn=count > 500' 'crit=count > 600' - } - ## Argument Defaults | Argument | Default Value | @@ -66,7 +34,7 @@ Naemon Config | calculate-subdirectory-sizes | For subdirectories that are found under the search paths, calculate the subdirectory sizes based on found files. This calculation may be expensive. Default: false | | file | Alias for path | | follow-symlinks | Follow symlinks of files and subdirectories while traversing. The file paths will be registered originating from search path. Default: true | -| max-depth | Maximum recursion depth. '0' and '1' disable recursion into subfolders and only include files/directories directly under path., '2' starts to include files/directories of subdirectories with given depth. '-1' disables depth checks. Default: -1 | +| max-depth | Maximum recursion depth. '0' and '1' disable recursion into subfolders and only include files/directories directly under path, '2' starts to include files/directories of subdirectories with given depth. '-1' disables depth checks. Default: -1 | | max-files | Maximum number of files to process. Default: 10000 | | path | Path in which to search for files | | paths | A comma separated list of paths | @@ -95,7 +63,7 @@ these can be used in filters and thresholds (along with the default attributes): | written | Unix timestamp when file was last written to | | write | Alias for written | | age | Seconds since file was last written | -| version | Windows exe/dll file version (windows only) | +| version | Windows exe/dll file version (Windows only) | | line_count | Number of lines in the files (text files) | | total_bytes | Total size over all files in bytes | | total_size | Total size over all files as human readable bytes | @@ -107,3 +75,33 @@ these can be used in filters and thresholds (along with the default attributes): | sha384_checksum | SHA384 checksum of the file | | sha512_checksum | SHA512 checksum of the file | | is_symlink | The file/directory is a symlink | + +## Examples + +### Default Check + +Alert if there are logs older than 1 hour in /tmp: + + check_files path="/tmp" pattern="*.log" "filter=age > 1h" crit="count > 0" empty-state=0 empty-syntax="no old files found" top-syntax="%(status) - found %(count) old log files" + CRITICAL - found 138 old log files |'count'=138;;0;0 'size'=30642669B;;;0 + +Check for folder size: + + check_files 'path=/tmp' 'warn=total_size > 200MiB' 'crit=total_size > 300MiB' + OK - All 145 files are ok: (34.72 MiB) |'count'=145;;;0 'size'=36406741B;209715200;314572800;0 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_files + use generic-service + check_command check_nrpe!check_files!'path=/tmp' 'filter=age > 3d' 'warn=count > 500' 'crit=count > 600' + } diff --git a/docs/checks/commands/check_http.md b/docs/checks/commands/check_http.md index da71fc198..8d2565fa8 100644 --- a/docs/checks/commands/check_http.md +++ b/docs/checks/commands/check_http.md @@ -1,5 +1,5 @@ --- -title: http +title: check_http comment: auto-generated by make docs, do not edit --- diff --git a/docs/checks/commands/check_index.md b/docs/checks/commands/check_index.md index 7b1795160..dbf85a62a 100644 --- a/docs/checks/commands/check_index.md +++ b/docs/checks/commands/check_index.md @@ -1,15 +1,13 @@ --- -title: index +title: check_index comment: auto-generated by make docs, do not edit --- -## check_index +Returns list of all known checks. -returns list of known checks. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ returns list of known checks. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_index filter="implemented = 1" - check_cpu... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_index - use generic-service - check_command check_nrpe!check_index! - } - ## Argument Defaults | Argument | Default Value | @@ -66,9 +41,32 @@ these can be used in filters and thresholds (along with the default attributes): | name | name of the check | | description | description of the check | | implemented | check is available on current platform: 0 / 1 | -| windows | check is available on windows: 0 / 1 | -| linux | check is available on linux: 0 / 1 | -| osx | check is available on mac osx: 0 / 1 | -| freebsd | check is available on freebsd: 0 / 1 | +| windows | check is available on Windows: 0 / 1 | +| linux | check is available on Linux: 0 / 1 | +| osx | check is available on macOS: 0 / 1 | +| freebsd | check is available on FreeBSD: 0 / 1 | | alias | check is an alias: 0 / 1 | | script | check is a (wrapped) script: 0 / 1 | + +## Examples + +### Default Check + + check_index filter="implemented = 1" + check_cpu... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_index + use generic-service + check_command check_nrpe!check_index! + } diff --git a/docs/checks/commands/check_kernel_stats.md b/docs/checks/commands/check_kernel_stats.md index 59b8908fc..8f99043da 100644 --- a/docs/checks/commands/check_kernel_stats.md +++ b/docs/checks/commands/check_kernel_stats.md @@ -1,15 +1,13 @@ --- -title: kernel_stats +title: check_kernel_stats comment: auto-generated by make docs, do not edit --- -## check_kernel_stats +Checks some metrics of the Linux kernel. Currently supports context switches, process creations and total number of threads. -Checks some metrics of the linux kernel. Currently support context switches, process creations and total number of threads. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks some metrics of the linux kernel. Currently support context switches, pro |:-------:|:------------------:|:-------:|:------:| | | :white_check_mark: | | | -## Examples - -### Default Check - - check_kernel_stats - OK - Context Switches 29.2/s, Process Creations 12.7/s, Threads 2574 |'ctxt'=29.2/s 'processes'=12.7/s 'threads'=2574;8000;10000;0 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_kernel_stats - use generic-service - check_command check_nrpe!check_kernel_stats! - } - ## Argument Defaults | Argument | Default Value | @@ -71,3 +46,26 @@ these can be used in filters and thresholds (along with the default attributes): | rate | Rate of this metric | | current | Current raw value | | human | Human readable number | + +## Examples + +### Default Check + + check_kernel_stats + OK - Context Switches 29.2/s, Process Creations 12.7/s, Threads 2574 |'ctxt'=29.2/s 'processes'=12.7/s 'threads'=2574;8000;10000;0 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_kernel_stats + use generic-service + check_command check_nrpe!check_kernel_stats! + } diff --git a/docs/checks/commands/check_load.md b/docs/checks/commands/check_load.md index 95ba6152e..4f015bd45 100644 --- a/docs/checks/commands/check_load.md +++ b/docs/checks/commands/check_load.md @@ -1,15 +1,13 @@ --- -title: load +title: check_load comment: auto-generated by make docs, do not edit --- -## check_load +Checks the CPU load metrics. -Checks the cpu load metrics. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the cpu load metrics. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_load - OK - total load average: 2.36, 1.26, 1.01 |'load1'=2.36;;;0 'load5'=1.26;;;0 'load15'=1.01;;;0 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_load - use generic-service - check_command check_nrpe!check_load!'warn=load > 20' 'crit=load > 30' - } - ## Argument Defaults | Argument | Default Value | @@ -74,3 +49,26 @@ these can be used in filters and thresholds (along with the default attributes): | load5 | average load value over 5 minutes | | load15 | average load value over 15 minutes | | load | maximum value of load1, load5 and load15 | + +## Examples + +### Default Check + + check_load + OK - total load average: 2.36, 1.26, 1.01 |'load1'=2.36;;;0 'load5'=1.26;;;0 'load15'=1.01;;;0 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_load + use generic-service + check_command check_nrpe!check_load!'warn=load > 20' 'crit=load > 30' + } diff --git a/docs/checks/commands/check_logfile.md b/docs/checks/commands/check_logfile.md index 4d82b91b7..e8be72eeb 100644 --- a/docs/checks/commands/check_logfile.md +++ b/docs/checks/commands/check_logfile.md @@ -1,10 +1,8 @@ --- -title: logfile +title: check_logfile comment: auto-generated by make docs, do not edit --- -## check_logfile - Checks logfiles or any other text format file for errors or other general patterns In order to use this plugin, you need to enable 'CheckLogFile' in the '[/modules]' section of the snclient_local.ini. @@ -20,9 +18,9 @@ Checks logfiles or any other text format file for errors or other general patter See https://github.com/bmatcuk/doublestar#patterns for details on the pattern syntax. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -30,35 +28,6 @@ Checks logfiles or any other text format file for errors or other general patter |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - -Alert if there are errors in the snclient log file: - - check_files files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error'" - OK - 134 line(s) found - -Non-OK output example - check_files files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error'" - CRITICAL - 23/548 line(s) found - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_logfile - use generic-service - check_command check_nrpe!check_logfile!'files=/var/log/snclient/snclient.log' 'warn=line like Warn' - } - ## Argument Defaults | Argument | Default Value | @@ -93,4 +62,33 @@ these can be used in filters and thresholds (along with the default attributes): | count | Number of items matching the filter. Common option for all checks. | | filename | The name of the file | | line | Match the content of an entire line | -| columnN | Match the content of the N-th column only if enough columns exists | +| columnN | Match the content of the N-th column only if enough columns exist | + +## Examples + +### Default Check + +Alert if there are errors in the SNClient log file: + + check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' + OK - 134 line(s) found + +Non-OK output example + check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' + CRITICAL - 23/548 line(s) found + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_logfile + use generic-service + check_command check_nrpe!check_logfile!'files=/var/log/snclient/snclient.log' 'warn=line like Warn' + } diff --git a/docs/checks/commands/check_mailq.md b/docs/checks/commands/check_mailq.md index 354a94cfe..afb9f2835 100644 --- a/docs/checks/commands/check_mailq.md +++ b/docs/checks/commands/check_mailq.md @@ -1,15 +1,13 @@ --- -title: mailq +title: check_mailq comment: auto-generated by make docs, do not edit --- -## check_mailq - Checks the mailq. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the mailq. |:-------:|:------------------:|:------------------:|:------------------:| | | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_mailq - OK - postfix: active 0 / deferred 0 |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_mailq - use generic-service - check_command check_nrpe!check_mailq!warn='active > 5 || deferred > 0' crit='active > 10 || deferred > 10' - } - ## Argument Defaults | Argument | Default Value | @@ -55,9 +30,9 @@ Naemon Config ## Check Specific Arguments -| Argument | Description | -| -------- | -------------------------------------------------------------------------------- | -| mta | Set source mta for checking mailq instead of auto detect. Can be postfix or auto | +| Argument | Description | +| -------- | ----------------------------------------------------------------------------------------------------- | +| mta | Set the source MTA for checking the mail queue instead of automatic detection. Can be postfix or auto | ## Attributes @@ -67,9 +42,32 @@ these can be used in filters and thresholds (along with the default attributes): | Attribute | Description | | ------------- | ------------------------------- | -| mta | name of the mta | +| mta | name of the MTA | | folder | checked spool folder | | active | number of active mails | | active_size | size of active mails in bytes | | deferred | number of deferred mails | | deferred_size | size of deferred mails in bytes | + +## Examples + +### Default Check + + check_mailq + OK - postfix: active 0 / deferred 0 |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_mailq + use generic-service + check_command check_nrpe!check_mailq!warn='active > 5 || deferred > 0' crit='active > 10 || deferred > 10' + } diff --git a/docs/checks/commands/check_memory.md b/docs/checks/commands/check_memory.md index 2ccf9515f..895ea3060 100644 --- a/docs/checks/commands/check_memory.md +++ b/docs/checks/commands/check_memory.md @@ -1,26 +1,24 @@ --- -title: memory +title: check_memory comment: auto-generated by make docs, do not edit --- -## check_memory - Checks the memory usage on the host. There are several types of memory that can be checked: physical: physical memory - swap: swap memory (pagefile on windows) - committed: committed memory as shown in the windows task manager (windows only, basically this is the physical + swap) - virtual: available windows virtual address space (windows only) + swap: swap memory (pagefile on Windows) + committed: committed memory as shown in the Windows task manager (Windows only, basically this is the physical + swap) + virtual: available Windows virtual address space (Windows only) -read more on windows virtual address space: +read more on Windows virtual address space: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -28,34 +26,6 @@ read more on windows virtual address space: |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_memory - OK - physical = 6.98 GiB, committed = 719.32 MiB|... - -Changing the return syntax to get more information: - - check_memory 'top-syntax=${list}' 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}' - physical free: 35.00 B used: 7.01 GiB size: 31.09 GiB, committed free: 27.00 B used: 705.57 MiB size: 977.00 MiB |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_memory - use generic-service - check_command check_nrpe!check_memory!'warn=used > 80%' 'crit=used > 90%' - } - ## Argument Defaults | Argument | Default Value | @@ -85,7 +55,7 @@ these can be used in filters and thresholds (along with the default attributes): | Attribute | Description | | ---------- | ---------------------------------------------------------------------------------- | | | used bytes with the type as key | -| type | checked type, either 'physical' or 'committed', 'swap' or 'virtual' (windows only) | +| type | checked type, either 'physical' or 'committed', 'swap' or 'virtual' (Windows only) | | used | Used memory in human readable bytes (IEC) | | used_bytes | Used memory in bytes (IEC) | | used_pct | Used memory in percent | @@ -94,3 +64,31 @@ these can be used in filters and thresholds (along with the default attributes): | free_pct | Free memory in percent | | size | Total memory in human readable bytes (IEC) | | size_bytes | Total memory in bytes (IEC) | + +## Examples + +### Default Check + + check_memory + OK - physical = 6.98 GiB, committed = 719.32 MiB|... + +Changing the return syntax to get more information: + + check_memory 'top-syntax=${list}' 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}' + physical free: 24.08 GiB used: 7.01 GiB size: 31.09 GiB, committed free: 271.43 MiB used: 705.57 MiB size: 977.00 MiB |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_memory + use generic-service + check_command check_nrpe!check_memory!'warn=used > 80%' 'crit=used > 90%' + } diff --git a/docs/checks/commands/check_mount.md b/docs/checks/commands/check_mount.md index 0c500fce3..f5538f191 100644 --- a/docs/checks/commands/check_mount.md +++ b/docs/checks/commands/check_mount.md @@ -1,15 +1,13 @@ --- -title: mount +title: check_mount comment: auto-generated by make docs, do not edit --- -## check_mount - Checks the status for a mounted filesystem -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,32 +15,6 @@ Checks the status for a mounted filesystem |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_mount mount=/ options=rw,relatime fstype=ext4 - OK - 1 mount(s) found - - check_mount mount=X: - CRITICAL - mount X: not mounted - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_mount - use generic-service - check_command check_nrpe!check_mount!'mount=/' 'options=rw,relatime' - } - ## Argument Defaults | Argument | Default Value | @@ -76,3 +48,29 @@ these can be used in filters and thresholds (along with the default attributes): | device | Device of this mount | | fstype | FS type for this mount | | issues | Issues found | + +## Examples + +### Default Check + + check_mount mount=/ options=rw,relatime fstype=ext4 + OK - 1 mount(s) found + + check_mount mount=X: + CRITICAL - mount X: not mounted + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_mount + use generic-service + check_command check_nrpe!check_mount!'mount=/' 'options=rw,relatime' + } diff --git a/docs/checks/commands/check_multi.md b/docs/checks/commands/check_multi.md index d136ddc66..0d160f95a 100644 --- a/docs/checks/commands/check_multi.md +++ b/docs/checks/commands/check_multi.md @@ -1,10 +1,8 @@ --- -title: multi +title: check_multi comment: auto-generated by make docs, do not edit --- -## check_multi - Runs multiple checks and aggregates their status, output and performance data. By default 'CheckMulti' is enabled, but you can disable it in the '[/modules]' section of the snclient_local.ini. @@ -29,9 +27,9 @@ Runs multiple checks and aggregates their status, output and performance data. This can be executed with 'check_multi "config=myscript"'. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -39,46 +37,6 @@ Runs multiple checks and aggregates their status, output and performance data. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_multi "command[check_process]=check_process 'process=firefox'" "command[check_memory]=check_memory 'type=physical' 'crit=used_pct gt 80%'" - OK - 2 plugins checked, 2 ok |'check_process::count'=1;;;0 ... 'check_memory::physical %'=78.7%;;;0;100 - [check_process] OK - all 1 processes are ok. - [check_memory] OK - physical = 12.59 GiB/16.00 GiB (78.7%) - - You can define 'warning' and 'critical' conditions based on the number of checks in a certain state (see attributes below): - - check_multi "command[check_dummy1]=check_dummy 0 'OK - check works'" "command[check_dummy2]=check_dummy 1 'WARNING - problem found'" "critical=problem_count gt 0" - CRITICAL - 2 plugins checked: 1 ok, 1 warning, 0 critical, 0 unknown - warning(check_dummy2: WARNING - problem found) - [check_dummy1] OK - check works - [check_dummy2] WARNING - problem found - - You can also override the 'top-syntax' and use IF ELSE statements to get a certain output based on the results: - - check_multi "command[check_dummy1]=check_dummy 0 'OK'" "command[check_dummy2]=check_dummy 2 'CRITICAL'" \ - "top-syntax={{ if ok_count gt 0 }}OK - %(ok_count)/%(count) checks are OK {{ ELSE }}CRITICAL - all checks failed{{ END }}" - OK - 1/2 checks are OK - [check_dummy1] OK - [check_dummy2] CRITICAL - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_multi - use generic-service - check_command check_nrpe!check_multi!"command[check_cpu]=check_cpu" "command[check_memory]=check_memory" - } - ## Argument Defaults | Argument | Default Value | @@ -121,3 +79,43 @@ these can be used in filters and thresholds (along with the default attributes): | status | Status text of the check (OK, WARNING, CRITICAL, UNKNOWN) | | output | Check output | | shortoutput | First line of the check output | + +## Examples + +### Default Check + + check_multi "command[check_process]=check_process 'process=firefox'" "command[check_memory]=check_memory 'type=physical' 'crit=used_pct gt 80%'" + OK - 2 plugins checked, 2 ok |'check_process::count'=1;;;0 ... 'check_memory::physical %'=78.7%;;;0;100 + [check_process] OK - all 1 processes are ok. + [check_memory] OK - physical = 12.59 GiB/16.00 GiB (78.7%) + + You can define 'warning' and 'critical' conditions based on the number of checks in a certain state (see attributes above): + + check_multi "command[check_dummy1]=check_dummy 0 'OK - check works'" "command[check_dummy2]=check_dummy 1 'WARNING - problem found'" "critical=problem_count gt 0" + CRITICAL - 2 plugins checked: 1 ok, 1 warning, 0 critical, 0 unknown - warning(check_dummy2: WARNING - problem found) + [check_dummy1] OK - check works + [check_dummy2] WARNING - problem found + + You can also override the 'top-syntax' and use IF ELSE statements to get a certain output based on the results: + + check_multi "command[check_dummy1]=check_dummy 0 'OK'" "command[check_dummy2]=check_dummy 2 'CRITICAL'" \ + "top-syntax={{ if ok_count gt 0 }}OK - %(ok_count)/%(count) checks are OK {{ ELSE }}CRITICAL - all checks failed{{ END }}" + OK - 1/2 checks are OK + [check_dummy1] OK + [check_dummy2] CRITICAL + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_multi + use generic-service + check_command check_nrpe!check_multi!"command[check_cpu]=check_cpu" "command[check_memory]=check_memory" + } diff --git a/docs/checks/commands/check_network.md b/docs/checks/commands/check_network.md index 82c1c1fe8..fa156cf63 100644 --- a/docs/checks/commands/check_network.md +++ b/docs/checks/commands/check_network.md @@ -1,15 +1,13 @@ --- -title: network +title: check_network comment: auto-generated by make docs, do not edit --- -## check_network - Checks the state and metrics of network interfaces. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the state and metrics of network interfaces. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_network device=eth0 - OK - eth0 >12 kB/s <28 kB/s |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_network - use generic-service - check_command check_nrpe!check_network! - } - ## Argument Defaults | Argument | Default Value | @@ -85,3 +60,26 @@ these can be used in filters and thresholds (along with the default attributes): | flags | Interface flags | | total | Sum of send and receive rates in bytes per second (calculated over the last 30s). In humanized format | | total_bytes | Sum of sent and received bytes in the rate calculation over the last 30s | + +## Examples + +### Default Check + + check_network device=eth0 + OK - eth0 >12 kB/s <28 kB/s |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_network + use generic-service + check_command check_nrpe!check_network! + } diff --git a/docs/checks/commands/check_nsc_web.md b/docs/checks/commands/check_nsc_web.md index f447ffc6e..25fa66e33 100644 --- a/docs/checks/commands/check_nsc_web.md +++ b/docs/checks/commands/check_nsc_web.md @@ -1,5 +1,6 @@ --- -title: nsc_web +title: check_nsc_web +comment: manually created --- -check_nsc_web is a built-in check plugin. Its documentation is in the [plugins section](../plugins/check_snclient/). +check_nsc_web is an alias for check_snclient. See the [check_snclient](../plugins/check_snclient) documentation. diff --git a/docs/checks/commands/check_ntp_offset.md b/docs/checks/commands/check_ntp_offset.md index 35c569c9f..83f90771b 100644 --- a/docs/checks/commands/check_ntp_offset.md +++ b/docs/checks/commands/check_ntp_offset.md @@ -1,15 +1,13 @@ --- -title: ntp_offset +title: check_ntp_offset comment: auto-generated by make docs, do not edit --- -## check_ntp_offset +Checks the NTP offset. -Checks the ntp offset. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the ntp offset. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_ntp_offset - OK - offset 2.1ms from 1.2.3.4 (debian.pool.ntp.org) |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_ntp_offset - use generic-service - check_command check_nrpe!check_ntp_offset!'warn=offset > 50 || offset < -50' 'crit=offset > 100 || offset < -100' - } - ## Argument Defaults | Argument | Default Value | @@ -57,8 +32,8 @@ Naemon Config | Argument | Description | | -------- | ---------------------------------------------------------------------------------------------------------- | -| server | Fetch offset from this ntp server(s). First valid response is used. | -| source | Set source of time data instead of auto detect. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm. | +| server | Fetch offset from these NTP servers. First valid response is used. | +| source | Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm. | ## Attributes @@ -68,9 +43,32 @@ these can be used in filters and thresholds (along with the default attributes): | Attribute | Description | | -------------- | ---------------------------------------------------------------------------------------------------- | -| source | source of the ntp metrics | -| server | ntp server name | -| stratum | stratum value (distance to root ntp server) | +| source | source of the NTP metrics | +| server | NTP server name | +| stratum | stratum value (distance to root NTP server) | | jitter | jitter of the clock in milliseconds | -| offset | time offset to ntp server in milliseconds. This will be added as a metric. | -| offset_seconds | time offset to ntp server in seconds. This will not be added as a metric. Any thresholds using 'offset_seconds' will be converted to 'offset' silently. | +| offset | time offset to NTP server in milliseconds. This will be added as a metric. | +| offset_seconds | time offset to NTP server in seconds. This will not be added as a metric. Any thresholds using 'offset_seconds' will be converted to 'offset' silently. | + +## Examples + +### Default Check + + check_ntp_offset + OK - offset 2.1ms from 1.2.3.4 (debian.pool.ntp.org) |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_ntp_offset + use generic-service + check_command check_nrpe!check_ntp_offset!'warn=offset > 50 || offset < -50' 'crit=offset > 100 || offset < -100' + } diff --git a/docs/checks/commands/check_omd.md b/docs/checks/commands/check_omd.md index b2d1d6825..89b40c81a 100644 --- a/docs/checks/commands/check_omd.md +++ b/docs/checks/commands/check_omd.md @@ -1,15 +1,13 @@ --- -title: omd +title: check_omd comment: auto-generated by make docs, do not edit --- -## check_omd +Check OMD site status. -Check omd site status. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,34 +15,6 @@ Check omd site status. |:-------:|:------------------:|:-------:|:------:| | | :white_check_mark: | | | -## Examples - -### Default Check - - check_omd - OK - site demo: running |... - -Check **specific** site by site filter: - - check_omd site=demo - OK - site demo: running |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_omd - use generic-service - check_command check_nrpe!check_omd! - } - ## Argument Defaults | Argument | Default Value | @@ -62,7 +32,7 @@ Naemon Config | Argument | Description | | -------- | --------------------- | -| exclude | Skip this omd service | +| exclude | Skip this OMD service | | site | Show this site only | ## Attributes @@ -75,7 +45,35 @@ these can be used in filters and thresholds (along with the default attributes): | ------------------- | --------------------------------------------------------------------------------------- | | site | OMD site name | | autostart | Configuration value of 'autostart': 0/1 | -| state | Return code of omd status, 0 - running, 1 - partially running, 2 - stopped, 3 - unknown | +| state | Return code of OMD status, 0 - running, 1 - partially running, 2 - stopped, 3 - unknown | | status | Text status: (running, partially running, stopped, unknown) | | failed_services | List of failed services | | failed_services_txt | More usable form of failed services list | + +## Examples + +### Default Check + + check_omd + OK - site demo: running |... + +Check **specific** site by site filter: + + check_omd site=demo + OK - site demo: running |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_omd + use generic-service + check_command check_nrpe!check_omd! + } diff --git a/docs/checks/commands/check_os_updates.md b/docs/checks/commands/check_os_updates.md index 1146afb46..0b4efa035 100644 --- a/docs/checks/commands/check_os_updates.md +++ b/docs/checks/commands/check_os_updates.md @@ -1,15 +1,13 @@ --- -title: os_updates +title: check_os_updates comment: auto-generated by make docs, do not edit --- -## check_os_updates - Checks for OS system updates. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,6 +15,38 @@ Checks for OS system updates. |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | +## Argument Defaults + +| Argument | Default Value | +| ------------- | ------------------------------------------------------------------------------------- | +| warning | count > 0 | +| critical | count_security > 0 | +| empty-state | 0 (OK) | +| empty-syntax | %(status) - no updates available | +| top-syntax | %(status) - %{count_security} security updates / %{count} updates available.\n%{list} | +| ok-syntax | | +| detail-syntax | \${prefix}\${package}: \${version} | + +## Check Specific Arguments + +| Argument | Description | +| ---------------------- | -------------------------------------------------------------------------------------------- | +| -m\|--max-metadata-age | Fail with UNKNOWN if the repository metadata (apt/yum/dnf) is older than this duration, e.g. 48h (default: 24h) | +| -s\|--system | Package system: auto, apt, yum, osx and windows (default: auto) | +| -u\|--update | Update package list (if supported, e.g. apt-get update) | + +## Attributes + +### Filter Keywords + +these can be used in filters and thresholds (along with the default attributes): + +| Attribute | Description | +| --------- | -------------------------------- | +| package | package name | +| security | is this a security update: 0 / 1 | +| version | version string of package | + ## Examples ### Default Check @@ -36,7 +66,7 @@ The DNF check returns **UNKNOWN** if an enabled repository is unavailable, becau otherwise an incomplete repository set could be reported as having no updates. Use **--max-metadata-age** to make the check return **UNKNOWN** if the repository -metadata has not been refreshed within the given duration, ex.: --max-metadata-age=24h +metadata has not been refreshed within the given duration, e.g. --max-metadata-age=24h ### Example using NRPE and Naemon @@ -53,35 +83,3 @@ Naemon Config use generic-service check_command check_nrpe!check_os_updates!warn='count > 0' crit='count_security > 0' } - -## Argument Defaults - -| Argument | Default Value | -| ------------- | ------------------------------------------------------------------------------------- | -| warning | count > 0 | -| critical | count_security > 0 | -| empty-state | 0 (OK) | -| empty-syntax | %(status) - no updates available | -| top-syntax | %(status) - %{count_security} security updates / %{count} updates available.\n%{list} | -| ok-syntax | | -| detail-syntax | \${prefix}\${package}: \${version} | - -## Check Specific Arguments - -| Argument | Description | -| ---------------------- | -------------------------------------------------------------------------------------------- | -| -m\|--max-metadata-age | Fail with UNKNOWN if the repository metadata (apt/yum/dnf) is older than this duration, ex.: 48h (default: 24h) | -| -s\|--system | Package system: auto, apt, yum, osx and windows (default: auto) | -| -u\|--update | Update package list (if supported, ex.: apt-get update) | - -## Attributes - -### Filter Keywords - -these can be used in filters and thresholds (along with the default attributes): - -| Attribute | Description | -| --------- | -------------------------------- | -| package | package name | -| security | is this a security update: 0 / 1 | -| version | version string of package | diff --git a/docs/checks/commands/check_os_version.md b/docs/checks/commands/check_os_version.md index 0e4242d41..5cfe0b42f 100644 --- a/docs/checks/commands/check_os_version.md +++ b/docs/checks/commands/check_os_version.md @@ -1,15 +1,13 @@ --- -title: os_version +title: check_os_version comment: auto-generated by make docs, do not edit --- -## check_os_version - Checks the os system version. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the os system version. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_os_version - OK - Microsoft Windows 10 Pro 10.0.19045.2728 Build 19045.2728 (arch: amd64) - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_os_version - use generic-service - check_command check_nrpe!check_os_version! - } - ## Argument Defaults | Argument | Default Value | @@ -65,8 +40,31 @@ these can be used in filters and thresholds (along with the default attributes): | platform | Platform of the OS | | family | OS Family | | version | Full version number | -| arch | OS architecture (go arch, ex.: amd64) | +| arch | OS architecture (go arch, e.g. amd64) | | os | OS name | -| hostname | hostname (probably without fqdn) | -| kernel_arch | kernel architecture, ex.: x86_64 | +| hostname | hostname (probably without FQDN) | +| kernel_arch | kernel architecture, e.g. x86_64 | | kernel_version | kernel version | + +## Examples + +### Default Check + + check_os_version + OK - Microsoft Windows 10 Pro 10.0.19045.2728 Build 19045.2728 (arch: amd64) + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_os_version + use generic-service + check_command check_nrpe!check_os_version! + } diff --git a/docs/checks/commands/check_pagefile.md b/docs/checks/commands/check_pagefile.md index e461cb163..085a28e57 100644 --- a/docs/checks/commands/check_pagefile.md +++ b/docs/checks/commands/check_pagefile.md @@ -1,15 +1,13 @@ --- -title: pagefile +title: check_pagefile comment: auto-generated by make docs, do not edit --- -## check_pagefile - Checks the pagefile usage. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the pagefile usage. |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | -## Examples - -### Default Check - - check_pagefile - OK - total 39.10 MiB/671.39 MiB (5.8%) |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_pagefile - use generic-service - check_command check_nrpe!check_pagefile!'warn=used > 80%' 'crit=used > 95%' - } - ## Argument Defaults | Argument | Default Value | @@ -77,3 +52,26 @@ these can be used in filters and thresholds (along with the default attributes): | peak_pct | Peak memory in percent | | size | Total size of pagefile (human readable) | | size_bytes | Total size of pagefile in bytes | + +## Examples + +### Default Check + + check_pagefile + OK - total 39.10 MiB/671.39 MiB (5.8%) |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_pagefile + use generic-service + check_command check_nrpe!check_pagefile!'warn=used > 80%' 'crit=used > 95%' + } diff --git a/docs/checks/commands/check_pdh.md b/docs/checks/commands/check_pdh.md index 837d705c7..f1fb56b14 100644 --- a/docs/checks/commands/check_pdh.md +++ b/docs/checks/commands/check_pdh.md @@ -1,14 +1,12 @@ --- -title: pdh +title: check_pdh comment: auto-generated by make docs, do not edit --- -## check_pdh +Checks PDH paths and handles wildcard expansion. -Checks pdh paths and handles wildcard expansion. - -- [Examples](#examples) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -16,37 +14,13 @@ Checks pdh paths and handles wildcard expansion. |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | -## Examples - -### Default Check - - check_pdh "counter=foo" "warn=value > 80" "crit=value > 90" - Everything looks good - 'foo value'=18;80;90 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_pdh - use generic-service - check_command check_nrpe!check_pdh!counter=\\System\\System Up Time" "warn=value > 5" "crit=value > 9999 - } - ## Check Specific Arguments | Argument | Description | | ------------ | -------------------------------------------------------------------------------------------------- | | Counter | The fully qualified counter name | | counter | The fully qualified counter name | -| english | Using english names regardless of system language (requires Windows Vista or higher) | +| english | Use English names regardless of system language (requires Windows Vista or higher) | | expand-index | Should indices be translated? | | host | The name of the machine in the network where the counter should be searched, defaults to localhost | | instances | Expand wildcards and fetch all instances | @@ -62,3 +36,26 @@ these can be used in filters and thresholds (along with the default attributes): | --------- | ------------------------------------------------------------------ | | count | Number of items matching the filter. Common option for all checks. | | value | The counter value (either float or int) | + +## Examples + +### Default Check + + check_pdh "counter=\System\System Up Time" "warn=value < 60" "crit=value < 30" english + OK - All 1 counter values are ok |'\System\System Up Time_value'=3600;60:;30:;0 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_pdh + use generic-service + check_command check_nrpe!check_pdh!'counter=\System\System Up Time' 'warn=value < 60' 'crit=value < 30' english + } diff --git a/docs/checks/commands/check_ping.md b/docs/checks/commands/check_ping.md index fcf08e727..71d963bc5 100644 --- a/docs/checks/commands/check_ping.md +++ b/docs/checks/commands/check_ping.md @@ -1,15 +1,13 @@ --- -title: ping +title: check_ping comment: auto-generated by make docs, do not edit --- -## check_ping +Checks the ICMP ping connection. -Checks the icmp ping connection. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the icmp ping connection. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_ping host=localhost - OK - Packet loss = 0%, RTA = 0.113ms |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_ping - use generic-service - check_command check_nrpe!check_ping!'warn=rta > 1000 || pl > 30' 'crit=rta > 5000 || pl > 80' - } - ## Argument Defaults | Argument | Default Value | @@ -60,7 +35,7 @@ Naemon Config | -4 | Force using IPv4. | | -6 | Force using IPv6. | | -t | timeout in seconds for each ICMP ECHO packet | -| host | host name or ip address to ping | +| host | host name or IP address to ping | | packets | number of ICMP ECHO packets to send (default: 5) | ## Attributes @@ -77,3 +52,26 @@ these can be used in filters and thresholds (along with the default attributes): | received | number of packets received. | | rta | average round trip time in milliseconds. | | pl | packet loss in percent. | + +## Examples + +### Default Check + + check_ping host=localhost + OK - Packet loss = 0%, RTA = 0.113ms |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_ping + use generic-service + check_command check_nrpe!check_ping!'host=localhost' 'warn=rta > 1000 || pl > 30' 'crit=rta > 5000 || pl > 80' + } diff --git a/docs/checks/commands/check_process.md b/docs/checks/commands/check_process.md index d9038083f..203503133 100644 --- a/docs/checks/commands/check_process.md +++ b/docs/checks/commands/check_process.md @@ -1,15 +1,13 @@ --- -title: process +title: check_process comment: auto-generated by make docs, do not edit --- -## check_process - Checks the state and metrics of one or multiple processes. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,48 +15,6 @@ Checks the state and metrics of one or multiple processes. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_process - OK - 417 processes. |'count'=417;;;0 - -Check specific process(es) by name (adding some metrics as well) - - check_process \ - process=httpd \ - warn='count < 1 || count > 10' \ - crit='count < 0 || count > 20' \ - top-syntax='%{status} - %{count} processes, memory %{rss|h}B, cpu %{cpu:fmt=%.1f}%, started %{oldest:age|duration} ago' - WARNING - 12 processes, memory 62.58 MB, started 01:11h ago |... - -If zero is a valid threshold, set thresholds accordingly - - check_process process=qemu warn='count < 0 || count > 10' crit='count < 0 || count > 20' - OK - no processes found with this filter. - -In case you want to check if a given process is NOT running use something like: - - check_process process=must_not_run.exe 'crit=count>0' warn=none - OK - no processes found with this filter. - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_process - use generic-service - check_command check_nrpe!check_process!warn='count <= 0 || count > 10' crit='count <= 0 || count > 20' - } - ## Argument Defaults | Argument | Default Value | @@ -90,22 +46,64 @@ these can be used in filters and thresholds (along with the default attributes): | exe | Name of the executable (without path) | | filename | Name of the executable with path | | command_line | Full command line of process | -| state | Current state (windows: started, stopped, hung - linux: idle, lock, running, sleep, stop, wait and zombie) | +| state | Current state (Windows: started, stopped, hung - Linux: idle, lock, running, sleep, stop, wait and zombie) | | creation | Start time of process | | pid | Process id | | ppid | Parent process id | -| uid | User id of process owner (linux only) | -| username | User name of process owner (linux only) | +| uid | User id of process owner (Linux only) | +| username | User name of process owner (Linux only) | | cpu | CPU usage in percent (over total lifetime of process) | | cpu_seconds | CPU usage in seconds | | virtual | Virtual memory usage in bytes | | rss | Resident memory usage in bytes | | pagefile | Swap memory usage in bytes | | oldest | Unix timestamp of oldest process | -| peak_pagefile | Peak swap memory usage in bytes (windows only) | -| handles | Number of handles (windows only) | -| kernel | Kernel time in seconds (windows only) | -| peak_virtual | Peak virtual size in bytes (windows only) | -| peak_working_set | Peak working set in bytes (windows only) | -| user | User time in seconds (windows only) | -| working_set | Working set in bytes (windows only) | +| peak_pagefile | Peak swap memory usage in bytes (Windows only) | +| handles | Number of handles (Windows only) | +| kernel | Kernel time in seconds (Windows only) | +| peak_virtual | Peak virtual size in bytes (Windows only) | +| peak_working_set | Peak working set in bytes (Windows only) | +| user | User time in seconds (Windows only) | +| working_set | Working set in bytes (Windows only) | + +## Examples + +### Default Check + + check_process + OK - 417 processes. |'count'=417;;;0 + +Check specific process(es) by name (adding some metrics as well) + + check_process \ + process=httpd \ + warn='count < 1 || count > 10' \ + crit='count < 0 || count > 20' \ + top-syntax='%{status} - %{count} processes, memory %{rss|h}B, cpu %{cpu:fmt=%.1f}%, started %{oldest:age|duration} ago' + WARNING - 12 processes, memory 62.58 MB, cpu 0.7%, started 01:11h ago |... + +If zero is a valid threshold, set thresholds accordingly + + check_process process=qemu warn='count < 0 || count > 10' crit='count < 0 || count > 20' + OK - no processes found with this filter. + +In case you want to check if a given process is NOT running use something like: + + check_process process=must_not_run.exe 'crit=count>0' warn=none + OK - no processes found with this filter. + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_process + use generic-service + check_command check_nrpe!check_process!warn='count <= 0 || count > 10' crit='count <= 0 || count > 20' + } diff --git a/docs/checks/commands/check_service_linux.md b/docs/checks/commands/check_service_linux.md index 8fe084513..4a08dfcd0 100644 --- a/docs/checks/commands/check_service_linux.md +++ b/docs/checks/commands/check_service_linux.md @@ -1,17 +1,15 @@ --- -title: service (linux) +title: check_service (linux) comment: auto-generated by make docs, do not edit --- -## check_service +Checks the state of one or multiple Linux (systemctl) services. -Checks the state of one or multiple linux (systemctl) services. +There is a specific [check_service for Windows](../check_service_windows) as well. -There is a specific [check_service for windows](../check_service_windows) as well. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -19,41 +17,6 @@ There is a specific [check_service for windows](../check_service_windows) as wel |:-------:|:------------------:|:-------:|:------:| | | :white_check_mark: | | | -## Examples - -### Default Check - -Checking all services except some excluded ones: - - check_service exclude=bluetooth - OK - All 74 service(s) are ok. - -Or check a specific service and get some metrics: - - check_service service=docker ok-syntax='${top-syntax}' top-syntax='%(status) - %(list)' detail-syntax='%(name) %(state) - memory: %(rss:h)B - age: %(age:duration)' - OK - docker running - memory: 805.2MB - created: Fri 2023-11-17 20:34:01 CET |'docker'=4 'docker rss'=805200000B - -Check memory usage of specific service: - - check_service service=docker warn='rss > 1GB' warn='rss > 2GB' - OK - All 1 service(s) are ok. |'docker'=4 'docker rss'=59691008B;;;0 'docker vms'=3166244864B;;;0 'docker cpu'=0.7%;;;0 'docker tasks'=20;;;0 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_service - use generic-service - check_command check_nrpe!check_service!service=docker - } - ## Argument Defaults | Argument | Default Value | @@ -86,11 +49,46 @@ these can be used in filters and thresholds (along with the default attributes): | desc | Description of the service | | active | The active attribute of a service, one of: active, inactive or failed | | state | The state of the service, one of: stopped, starting, oneshot, running, static or unknown | -| pid | The pid of the service | +| pid | The PID of the service | | created | Date when service was started | | age | Seconds since service was started | -| rss | Memory rss in bytes (main process) | -| vms | Memory vms in bytes (main process) | +| rss | Memory RSS in bytes (main process) | +| vms | Memory VMS in bytes (main process) | | cpu | CPU usage in percent (main process) | | preset | The preset attribute of the service, one of: enabled or disabled | | tasks | Number of tasks for this service | + +## Examples + +### Default Check + +Checking all services except some excluded ones: + + check_service exclude=bluetooth + OK - All 74 service(s) are ok. + +Or check a specific service and get some metrics: + + check_service service=docker ok-syntax='${top-syntax}' top-syntax='%(status) - %(list)' detail-syntax='%(name) %(state) - memory: %(rss:h)B - age: %(age:duration)' + OK - docker running - memory: 805.2MB - age: 01:11h |'docker'=4 'docker rss'=805200000B + +Check memory usage of specific service: + + check_service service=docker warn='rss > 1GB' crit='rss > 2GB' + OK - All 1 service(s) are ok. |'docker'=4 'docker rss'=59691008B;;;0 'docker vms'=3166244864B;;;0 'docker cpu'=0.7%;;;0 'docker tasks'=20;;;0 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_service + use generic-service + check_command check_nrpe!check_service!service=docker + } diff --git a/docs/checks/commands/check_service_windows.md b/docs/checks/commands/check_service_windows.md index f77604da6..65b1529b6 100755 --- a/docs/checks/commands/check_service_windows.md +++ b/docs/checks/commands/check_service_windows.md @@ -1,17 +1,15 @@ --- -title: service (windows) +title: check_service (windows) comment: auto-generated by make docs, do not edit --- -## check_service +Checks the state of one or multiple Windows services. -Checks the state of one or multiple windows services. +There is a specific [check_service for Linux](../check_service_linux) as well. -There is a specific [check_service for linux](../check_service_linux) as well. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -19,36 +17,6 @@ There is a specific [check_service for linux](../check_service_linux) as well. |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | -## Examples - -### Default Check - -Checking all services except some excluded ones: - - check_service exclude=edgeupdate exclude=RemoteRegistry - OK - All 15 service(s) are ok |'count'=15;;;0 'failed'=0;;;0 - -Checking a single service: - - check_service service=dhcp - OK - All 1 service(s) are ok. - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_service - use generic-service - check_command check_nrpe!check_service!service=dhcp - } - ## Argument Defaults | Argument | Default Value | @@ -83,12 +51,42 @@ these can be used in filters and thresholds (along with the default attributes): | desc | Alias for display (not a typo). When used as filter, looks only in display. | | description | Description of the service | | state | The state of the service, one of: stopped, starting, stopping, running, continuing, pausing, paused or unknown | -| pid | The pid of the service | +| pid | The PID of the service | | created | Date when service was started | | age | Seconds since service was started | -| rss | Memory rss in bytes | -| vms | Memory vms in bytes | +| rss | Memory RSS in bytes | +| vms | Memory VMS in bytes | | cpu | CPU usage in percent | | delayed | If the service is delayed, can be 0 or 1 | | classification | Classification of the service, one of: kernel-driver, system-driver, service-adapter, driver, service-own-process, service-shared-process, service or interactive | | start_type | The configured start type, one of: boot, system, delayed, auto, demand, disabled or unknown | + +## Examples + +### Default Check + +Checking all services except some excluded ones: + + check_service exclude=edgeupdate exclude=RemoteRegistry + OK - All 15 service(s) are ok |'count'=15;;;0 'failed'=0;;;0 + +Checking a single service: + + check_service service=dhcp + OK - All 1 service(s) are ok. + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_service + use generic-service + check_command check_nrpe!check_service!service=dhcp + } diff --git a/docs/checks/commands/check_snclient.md b/docs/checks/commands/check_snclient.md index 74d2096aa..fe0aab6f9 100644 --- a/docs/checks/commands/check_snclient.md +++ b/docs/checks/commands/check_snclient.md @@ -1,5 +1,5 @@ --- -title: snclient +title: check_snclient comment: auto-generated by make docs, do not edit --- diff --git a/docs/checks/commands/check_snclient_version.md b/docs/checks/commands/check_snclient_version.md index 301650c29..418f9b928 100644 --- a/docs/checks/commands/check_snclient_version.md +++ b/docs/checks/commands/check_snclient_version.md @@ -1,15 +1,13 @@ --- -title: snclient_version +title: check_snclient_version comment: auto-generated by make docs, do not edit --- -## check_snclient_version +Check and return SNClient version. -Check and return snclient version. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,31 +15,6 @@ Check and return snclient version. |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_snclient_version - SNClient v0.12.0036 (Build: 5e351bb, go1.21.6) - -There is an alias 'check_nscp_version' for this command. - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_snclient_version - use generic-service - check_command check_nrpe!check_snclient_version! - } - ## Argument Defaults | Argument | Default Value | @@ -67,3 +40,28 @@ these can be used in filters and thresholds (along with the default attributes): | name | The name of this agent | | version | Version string | | build | git commit id of this build | + +## Examples + +### Default Check + + check_snclient_version + SNClient v0.12.0036 (Build: 5e351bb, go1.21.6) + +There is an alias 'check_nscp_version' for this command. + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_snclient_version + use generic-service + check_command check_nrpe!check_snclient_version! + } diff --git a/docs/checks/commands/check_ssh.md b/docs/checks/commands/check_ssh.md index 2acac2447..71b03f048 100644 --- a/docs/checks/commands/check_ssh.md +++ b/docs/checks/commands/check_ssh.md @@ -1,5 +1,5 @@ --- -title: ssh +title: check_ssh comment: auto-generated by make docs, do not edit --- diff --git a/docs/checks/commands/check_swap_io.md b/docs/checks/commands/check_swap_io.md index 3aea8ecc1..ae28d7b73 100644 --- a/docs/checks/commands/check_swap_io.md +++ b/docs/checks/commands/check_swap_io.md @@ -1,15 +1,13 @@ --- -title: swap_io +title: check_swap_io comment: auto-generated by make docs, do not edit --- -## check_swap_io +Checks the swap I/O rate on the host. -Checks the swap Input / Output rate on the host. - -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Checks the swap Input / Output rate on the host. |:-------:|:------------------:|:------------------:|:------------------:| | | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_swap_io - OK - 1 swaps >22.98 KiB/s <18.58 MiB/s |'swap_in'=54024851456c;;;0; 'swap_out'=179375353856c;;;0; - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_swap_io - use generic-service - check_command check_nrpe!check_swap_io! - } - ## Argument Defaults | Argument | Default Value | @@ -62,10 +37,33 @@ Naemon Config these can be used in filters and thresholds (along with the default attributes): -| Attribute | Description | -| ------------------- | --------------------------- | -| swap_count | Count of swap partitions | -| swap_in_rate_bytes | Swap/Pages being brought in | -| swap_in_rate | Swap/Pages being sent out | -| swap_out_rate_bytes | Swap/Pages being brought in | -| swap_out_rate | Swap/Pages being sent out | +| Attribute | Description | +| ------------------- | ----------------------------------------------------- | +| swap_count | Count of swap partitions | +| swap_in_rate_bytes | Bytes swapped in per second | +| swap_in_rate | Bytes swapped in per second in human-readable format | +| swap_out_rate_bytes | Bytes swapped out per second | +| swap_out_rate | Bytes swapped out per second in human-readable format | + +## Examples + +### Default Check + + check_swap_io + OK - 1 swaps >22.98 KiB/s <18.58 MiB/s |'swap_in'=54024851456c;;;0; 'swap_out'=179375353856c;;;0; + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_swap_io + use generic-service + check_command check_nrpe!check_swap_io! + } diff --git a/docs/checks/commands/check_tasksched.md b/docs/checks/commands/check_tasksched.md index 5f1766ca6..19408c47b 100644 --- a/docs/checks/commands/check_tasksched.md +++ b/docs/checks/commands/check_tasksched.md @@ -1,15 +1,13 @@ --- -title: tasksched +title: check_tasksched comment: auto-generated by make docs, do not edit --- -## check_tasksched - Check status of scheduled jobs -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Check status of scheduled jobs |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | -## Examples - -### Default Check - - check_tasksched - OK - All tasks are ok - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_tasksched - use generic-service - check_command check_nrpe!check_tasksched!'crit=exit_code != 0' - } - ## Argument Defaults | Argument | Default Value | @@ -75,8 +50,8 @@ these can be used in filters and thresholds (along with the default attributes): | comment | Comment or description for the work item | | creator | Creator of the work item | | enabled | Flag whether this job is enabled (true/false) | -| exit_code | The last jobs exit code | -| exit_string | The last jobs exit code as string | +| exit_code | The last job's exit code | +| exit_string | The last job's exit code as string | | folder | Task folder | | uri | Fully qualified path to the task, includes folder and the task title | | uri_clean | Remove the leading backslash from the URI, only for tasks directly saved at root and not for ones saved inside folders. | @@ -89,6 +64,29 @@ these can be used in filters and thresholds (along with the default attributes): | missed_runs | Number of times the registered task has missed a scheduled run | | task_status | Task status as string | | next_run_time | Time when the registered task is next scheduled to run | -| parameters | Last actions command line parameters | -| execute | Last actions executed program | -| working_directory | Last actions working directory | +| parameters | Last action's command line parameters | +| execute | Last action's executed program | +| working_directory | Last action's working directory | + +## Examples + +### Default Check + + check_tasksched + OK - All tasks are ok + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_tasksched + use generic-service + check_command check_nrpe!check_tasksched!'crit=exit_code != 0' + } diff --git a/docs/checks/commands/check_tcp.md b/docs/checks/commands/check_tcp.md index a1aa37c1d..9f8c08a81 100644 --- a/docs/checks/commands/check_tcp.md +++ b/docs/checks/commands/check_tcp.md @@ -1,5 +1,5 @@ --- -title: tcp +title: check_tcp comment: auto-generated by make docs, do not edit --- diff --git a/docs/checks/commands/check_temperature.md b/docs/checks/commands/check_temperature.md index b1764476a..15dd4c983 100644 --- a/docs/checks/commands/check_temperature.md +++ b/docs/checks/commands/check_temperature.md @@ -1,15 +1,13 @@ --- -title: temperature +title: check_temperature comment: auto-generated by make docs, do not edit --- -## check_temperature - Check temperature sensors. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,34 +15,6 @@ Check temperature sensors. |:------------------:|:------------------:|:-------:|:------------------:| | :white_check_mark: | :white_check_mark: | | :white_check_mark: | -## Examples - -### Default Check - - check_temperature - OK - Package id 0: 65.0 °C, Core 0: 62.0 °C, Core 1: 61.0 °C, Core 2: 65.0 °C |... - -Show all temperature sensors and apply custom thresholds: - - check_temperature filter=none warn="temperature > 85" crit="temperature > 90" - OK - Package id 0: 65.0 °C, Core 0: 62.0 °C, Core 1: 61.0 °C, Core 2: 65.0 °C |... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_temperature - use generic-service - check_command check_nrpe!check_temperature! - } - ## Argument Defaults | Argument | Default Value | @@ -72,10 +42,38 @@ these can be used in filters and thresholds (along with the default attributes): | Attribute | Description | | ----------- | ---------------------------------------------- | -| sensor | full name of this sensor, ex.: coretemp_core_0 | -| name | name of this sensor, ex.: coretemp | -| label | label for this sensor, ex.: core 0 | +| sensor | full name of this sensor, e.g. coretemp_core_0 | +| name | name of this sensor, e.g. coretemp | +| label | label for this sensor, e.g. core 0 | | temperature | current temperature | | crit | critical value supplied from sensor | | max | max value supplied from sensor | | min | min value supplied from sensor | + +## Examples + +### Default Check + + check_temperature + OK - Package id 0: 65.0 °C, Core 0: 62.0 °C, Core 1: 61.0 °C, Core 2: 65.0 °C |... + +Show all temperature sensors and apply custom thresholds: + + check_temperature filter=none warn="temperature > 85" crit="temperature > 90" + OK - Package id 0: 65.0 °C, Core 0: 62.0 °C, Core 1: 61.0 °C, Core 2: 65.0 °C |... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_temperature + use generic-service + check_command check_nrpe!check_temperature! + } diff --git a/docs/checks/commands/check_uptime.md b/docs/checks/commands/check_uptime.md index 7207861ba..61d25e4a7 100644 --- a/docs/checks/commands/check_uptime.md +++ b/docs/checks/commands/check_uptime.md @@ -1,15 +1,13 @@ --- -title: uptime +title: check_uptime comment: auto-generated by make docs, do not edit --- -## check_uptime - Check computer uptime (time since last reboot). -- [Examples](#examples) - [Argument Defaults](#argument-defaults) - [Attributes](#attributes) +- [Examples](#examples) ## Implementation @@ -17,29 +15,6 @@ Check computer uptime (time since last reboot). |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_uptime - OK - uptime: 3d 02:30h, boot: 2023-11-17 19:33:46 UTC |'uptime'=268241s;172800:;86400: - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_uptime - use generic-service - check_command check_nrpe!check_uptime!'warn=uptime < 180s' 'crit=uptime < 60s' - } - ## Argument Defaults | Argument | Default Value | @@ -67,3 +42,26 @@ these can be used in filters and thresholds (along with the default attributes): | uptime | Human readable time since last boot | | uptime_value | Uptime in seconds | | boot | Unix timestamp of last boot | + +## Examples + +### Default Check + + check_uptime + OK - uptime: 3d 02:30h, boot: 2023-11-17 19:33:46 UTC |'uptime'=268241s;172800:;86400: + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_uptime + use generic-service + check_command check_nrpe!check_uptime!'warn=uptime < 180s' 'crit=uptime < 60s' + } diff --git a/docs/checks/commands/check_wmi.md b/docs/checks/commands/check_wmi.md index aa6a60a9c..2f48c25c3 100644 --- a/docs/checks/commands/check_wmi.md +++ b/docs/checks/commands/check_wmi.md @@ -1,17 +1,15 @@ --- -title: wmi +title: check_wmi comment: auto-generated by make docs, do not edit --- -## check_wmi - -Check status and metrics by running wmi queries. +Check status and metrics by running WMI queries. In order to use this plugin, you need to enable 'CheckWMI' in the '[/modules]' section of the snclient_local.ini. -- [Examples](#examples) - [Argument Defaults](#argument-defaults) +- [Examples](#examples) ## Implementation @@ -19,6 +17,26 @@ Check status and metrics by running wmi queries. |:------------------:|:-----:|:-------:|:------:| | :white_check_mark: | | | | +## Argument Defaults + +| Argument | Default Value | +| ------------- | ------------------------------------ | +| empty-state | 3 (UNKNOWN) | +| empty-syntax | query did not return any result row. | +| top-syntax | \${list} | +| ok-syntax | | +| detail-syntax | %(line) | + +## Check Specific Arguments + +| Argument | Description | +| --------- | ------------------------------------------------ | +| namespace | The WMI namespace to query (default: root\cimv2) | +| password | Unused and not supported for now | +| query | The WMI query to execute | +| target | Unused and not supported for now | +| user | Unused and not supported for now | + ## Examples ### Default Check @@ -56,23 +74,3 @@ Naemon Config use generic-service check_command check_nrpe!check_wmi! } - -## Argument Defaults - -| Argument | Default Value | -| ------------- | ------------------------------------ | -| empty-state | 3 (UNKNOWN) | -| empty-syntax | query did not return any result row. | -| top-syntax | \${list} | -| ok-syntax | | -| detail-syntax | %(line) | - -## Check Specific Arguments - -| Argument | Description | -| --------- | ------------------------------------------------ | -| namespace | The WMI namespace to query (default: root\cimv2) | -| password | Unused and not supported for now | -| query | The WMI query to execute | -| target | Unused and not supported for now | -| user | Unused and not supported for now | diff --git a/docs/checks/external_commands/_index.md b/docs/checks/external_commands/_index.md index 88a46b42d..21a0aa014 100644 --- a/docs/checks/external_commands/_index.md +++ b/docs/checks/external_commands/_index.md @@ -1,5 +1,5 @@ --- -title: External Check Commands +title: External scripts weight: 2000 --- diff --git a/docs/checks/macros/_index.md b/docs/checks/macros/_index.md new file mode 100644 index 000000000..1b4dfad33 --- /dev/null +++ b/docs/checks/macros/_index.md @@ -0,0 +1,46 @@ +--- +title: Macros +--- + +Macros can be used to modify raw SNClient values. + +## Macro Operators + +Values can be altered by adding a colon separated suffix. + +Supported operators are: + +| Suffix | Example | Description | +| --------------------- | ------------------------------------- | ------------| +| `:lc` | Word -> word | make value lowercase | +| `:uc` | test -> TEST | make value uppercase | +| `:h` | 1000 -> 1k | make a number more human readably | +| `:duration` | 125 -> 2m 5s | convert amount of seconds into human readable duration | +| `:age` | 1700834034 -> 374 | subtract value from current unix timestamp to get the age in seconds | +| `:date` | 1700834034 -> 2023-11-24 14:53:54 CET | convert unix timestamp into human readable date (local timezone) | +| `:utc` | 1700834034 -> 2023-11-24 13:53:54 UTC | convert unix timestamp into human readable date (utc timezone) | +| `:fmt=` | 123.45 -> 123.5 | apply format, ex.: $(total \| fmt=%.1f) (using GOs fmt.Sprintf) | +| `:s/regexp/replace/` | C:\ % -> C | apply regexp replacement, ex.: $(name \| 's/\\W//' ) (using GOs regexp.Compile) | +| `:ascii` | C:\ % -> C | remove any none-ascii characters | +| `:trim` | " test " -> "test" | remove leading and trailing whitespace | +| `:chomp` | " test " -> " test" | remove trailing whitespace only | + +Operators can be put together (spaces are optional): + +```txt +$(datemacro:date : uc) +``` + +This converts $(datemacro) to a human readable date and makes everything uppercase. + +You can also use the pipe symbol to use multiple operators in a row, for example: + +```txt +$(macroname | date | uc) +``` + +Use the generic fmt operator to apply any format on numbers, for example: + +```txt +$(used_pct | fmt=%d) +``` diff --git a/docs/checks/plugins/_index.md b/docs/checks/plugins/_index.md index 1f0f121eb..99bb68367 100644 --- a/docs/checks/plugins/_index.md +++ b/docs/checks/plugins/_index.md @@ -1,5 +1,5 @@ --- -title: Check Plugins +title: Built-in plugins weight: 2000 --- diff --git a/docs/checks/plugins/check_dns.md b/docs/checks/plugins/check_dns.md index a80d77e08..fce65f10d 100644 --- a/docs/checks/plugins/check_dns.md +++ b/docs/checks/plugins/check_dns.md @@ -3,13 +3,11 @@ title: check_dns comment: auto-generated by make docs, do not edit --- -## check_dns - Runs check_dns to perform nameserver checks. It basically wraps the plugin from https://github.com/mackerelio/go-check-plugins/tree/master/check-dns -- [Examples](#examples) - [Usage](#usage) +- [Examples](#examples) ## Implementation @@ -17,36 +15,6 @@ It basically wraps the plugin from https://github.com/mackerelio/go-check-plugin |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - -Alert if dns server does not respond: - - check_dns -H labs.consol.de - OK - labs.consol.de returns 94.185.89.33 (A) - -Check for specific type from specific server: - - check_dns -H consol.de -q MX -s 1.1.1.1 - OK - consol.de returns mail.consol.de. (MX) - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_dns - use generic-service - check_command check_nrpe!check_dns!'-H' 'omd.consol.de' - } - ## Usage ```Usage: @@ -59,8 +27,8 @@ Application Options: -q, --querytype= DNS record query type (default: A) --norec Clears the Recursion Desired flag, DNS server answers only from its authoritative data or cache, does not ask other nameservers. - -e, --expected-string= IP-ADDRESS string you expect the DNS server to return. If multiple IP-ADDRESS are returned at - once, you have to specify whole string + -e, --expected-string= IP-ADDRESS string you expect the DNS server to return. If multiple IP addresses are returned + at once, you have to specify the whole string --search-path= Search paths to add to domains before sending a DNS query. This can be specified multiple times. --resolv-conf-file= Path to the resolv.conf file to use. Is not used in Windows. (default: /etc/resolv.conf) @@ -80,3 +48,33 @@ Application Options: Help Options: -h, --help Show this help message ``` + +## Examples + +### Default Check + +Alert if DNS server does not respond: + + check_dns -H labs.consol.de + OK - labs.consol.de returns 94.185.89.33 (A) + +Check for specific type from specific server: + + check_dns -H consol.de -q MX -s 1.1.1.1 + OK - consol.de returns mail.consol.de. (MX) + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_dns + use generic-service + check_command check_nrpe!check_dns!'-H' 'omd.consol.de' + } diff --git a/docs/checks/plugins/check_http.md b/docs/checks/plugins/check_http.md index 0caeb58fb..f02804648 100644 --- a/docs/checks/plugins/check_http.md +++ b/docs/checks/plugins/check_http.md @@ -3,13 +3,11 @@ title: check_http comment: auto-generated by make docs, do not edit --- -## check_http - -Runs check_http to perform http(s) checks +Runs check_http to perform HTTP(s) checks It basically wraps the plugin from https://github.com/sni/check_http_go -- [Examples](#examples) - [Usage](#usage) +- [Examples](#examples) ## Implementation @@ -17,41 +15,6 @@ It basically wraps the plugin from https://github.com/sni/check_http_go |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - -Alert if http server does not respond: - - check_http -H omd.consol.de - HTTP OK - HTTP/1.1 200 OK - 573 bytes in 0.001 second response time | ... - -Check for specific string and response code: - - check_http -H omd.consol.de -S -u "/docs/snclient/" -e 200,304 -s "consol" -vvv - HTTP OK - Status line output "HTTP/2.0 200 OK" matched "200,304", Response body matched "consol"... - -It can be a bit tricky to set the -u/--uri on windows, since the / is considered as start of -a command line parameter. - -To avoid this issue, simply use the long form --uri=/path.. so the parameter does not start with a slash. - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_http - use generic-service - check_command check_nrpe!check_http!'-H' 'omd.consol.de' '--uri=/docs' '-S' - } - ## Usage ```Usage: @@ -66,17 +29,17 @@ Application Options: status. By default, 1XX, 2XX are OK, 3XX depends on --onredirect option, 4XX are WARNING, 5XX are CRITICAL -s, --string= String to expect in the content - --base64-string= Base64 Encoded string to expect the content + --base64-string= Base64-encoded string to expect in the content -A, --useragent= UserAgent to be sent (default: check_http) -a, --authorization= Pass '[username]:[password]' formatted string to be used as basic authorization header - -k, --header= Any other tags to be sent in http header. Use + -k, --header= Any other tags to be sent in HTTP header. Use multiple times for additional headers -C, --certificate= Check certificates instead of content. Specified in mandatory days left to warn and optional days to crit with a comma: warn_days[,] --tls-min=[1.0|1.0+|1.1|1.1+|1.2|1.2+|1.3] Minimum supported TLS version. Values with plus set - the max tls version as well to latest version: 1.3 + the maximum TLS version as well to latest version: 1.3 --tls-max=[1.0|1.1|1.2|1.3] Maximum supported TLS version --proxy= Proxy that should be used -r, --regex= Search page for case-sensitive regex string @@ -84,21 +47,22 @@ Application Options: -f, --onredirect=[ok|warning|critical|follow|sticky|stickyport] What strategy to use when encountering a redirect. ok/warning/critical returns immediately. follow uses the new URL returned by golang HTTP client. Sticky - keeps the hostname to be same after redirect, and + keeps the hostname the same after redirect, and stickyport persists the port as well. --max-buffer-size= Max buffer size to read response body (max.: 100MB) (default: 1MB) -t, --timeout= Timeout to wait for connection. If no time unit is given at the end, default of seconds is assumed (default: 10) - -w, --warning= If the request+response takes longer specified - warning threshold, raises a warning. If no time unit - is given at the end, default of seconds is assumed. - Value is truncated to milliseconds. (default: 30) - -c, --critical= If the request+response takes longer specified - critical threshold, raises a critical. If no time - unit is given at the end, default of seconds is + -w, --warning= If the request+response takes longer than the + specified warning threshold, raises a warning. If no + time unit is given at the end, default of seconds is assumed. Value is truncated to milliseconds. + (default: 30) + -c, --critical= If the request+response takes longer than the + specified critical threshold, raises a critical. If + no time unit is given at the end, default of seconds + is assumed. Value is truncated to milliseconds. (default: 60) --wait-for-interval= Retry interval (default: 2s) --wait-for-max= Time to wait for success (max.: 180s) @@ -108,10 +72,10 @@ Application Options: (max.: 5) (default: 1) -p, --port= Port number --max-redirs= Maximum redirects before giving up on following - --no-discard Raise error when the response body is larger then + --no-discard Raise error when the response body is larger than max-buffer-size --wait-for Retry until successful when enabled - -S, --ssl Use https + -S, --ssl Use HTTPS --sni Enable SNI -4 Use tcp4 only -6 Use tcp6 only @@ -146,3 +110,38 @@ Application Options: Help Options: -h, --help Show this help message ``` + +## Examples + +### Default Check + +Alert if HTTP server does not respond: + + check_http -H omd.consol.de + HTTP OK - HTTP/1.1 200 OK - 573 bytes in 0.001 second response time | ... + +Check for specific string and response code: + + check_http -H omd.consol.de -S -u "/docs/snclient/" -e 200,304 -s "consol" -vvv + HTTP OK - Status line output "HTTP/2.0 200 OK" matched "200,304", Response body matched "consol"... + +It can be a bit tricky to set the -u/--uri on Windows, since the / is considered as the start of +a command line parameter. + +To avoid this issue, simply use the long form --uri=/path so the parameter does not start with a slash. + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_http + use generic-service + check_command check_nrpe!check_http!'-H' 'omd.consol.de' '--uri=/docs' '-S' + } diff --git a/docs/checks/plugins/check_nsc_web.md b/docs/checks/plugins/check_nsc_web.md index 9b4f4dfda..4efd4345c 100644 --- a/docs/checks/plugins/check_nsc_web.md +++ b/docs/checks/plugins/check_nsc_web.md @@ -1,5 +1,6 @@ --- title: check_nsc_web +comment: manually created --- check_nsc_web is an alias for check_snclient. See the [check_snclient](check_snclient) documentation. diff --git a/docs/checks/plugins/check_snclient.md b/docs/checks/plugins/check_snclient.md index f9b593852..2f8b85f66 100644 --- a/docs/checks/plugins/check_snclient.md +++ b/docs/checks/plugins/check_snclient.md @@ -3,13 +3,11 @@ title: check_snclient comment: auto-generated by make docs, do not edit --- -## check_snclient - -Runs check_snclient (formerly check_nsc_web) to perform checks on other snclient agents. +Runs check_snclient (formerly check_nsc_web) to perform checks on other SNClient agents. It basically wraps the plugin from https://github.com/ConSol-Monitoring/check_snclient -- [Examples](#examples) - [Usage](#usage) +- [Examples](#examples) ## Implementation @@ -17,34 +15,6 @@ It basically wraps the plugin from https://github.com/ConSol-Monitoring/check_sn |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_snclient -p ... -u https://localhost:8443 - OK - REST API reachable on https://localhost:8443 - -Check specific plugin: - - check_snclient -p ... -u https://localhost:8443 -c check_process process=snclient.exe - OK - all 1 processes are ok. | ... - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_snclient - use generic-service - check_command check_nrpe!check_snclient!'-H' 'omd.consol.de' '--uri=/docs' '-S' - } - ## Usage ```Usage: @@ -112,3 +82,31 @@ Output Options: -r Print raw result without pre/post processing -query Placeholder for query string from config file ``` + +## Examples + +### Default Check + + check_snclient -p ... -u https://localhost:8443 + OK - REST API reachable on https://localhost:8443 + +Check specific plugin: + + check_snclient -p ... -u https://localhost:8443 -c check_process process=snclient.exe + OK - all 1 processes are ok. | ... + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_snclient + use generic-service + check_command check_nrpe!check_snclient!'-p' 'PASSWORD' '-u' 'https://localhost:8443' '-c' 'check_process' 'process=snclient.exe' + } diff --git a/docs/checks/plugins/check_ssh.md b/docs/checks/plugins/check_ssh.md index 81e5e5b08..b684b615c 100644 --- a/docs/checks/plugins/check_ssh.md +++ b/docs/checks/plugins/check_ssh.md @@ -3,13 +3,11 @@ title: check_ssh comment: auto-generated by make docs, do not edit --- -## check_ssh - -Runs check_tcp with an SSH configururation to check for a running SSH server. +Runs check_tcp with an SSH configuration to check for a running SSH server. It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tree/master/check-tcp -- [Examples](#examples) - [Usage](#usage) +- [Examples](#examples) ## Implementation @@ -17,32 +15,6 @@ It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tr |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - - check_ssh github.com -SSH OK - 0.234 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.234029s;;;0.000000;10.000000 - - check_ssh --hostname github.com --warning 1 -SSH OK - 0.262 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.262048s;;;1.000000;10.000000 - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_ssh - use generic-service - check_command check_nrpe!check_ssh!'-H' '192.168.178.100' '-p' '2323' - } - ## Usage ```Usage: @@ -50,7 +22,7 @@ Naemon Config Application Options: --service= Service name. e.g. ftp, smtp, pop, imap and so on - -H, --hostname= Host name or IP Address + -H, --hostname= Host name or IP address -4, --ipv4 Resolve and connect using IPv4 only -6, --ipv6 Resolve and connect using IPv6 only -p, --port= Port number @@ -67,8 +39,8 @@ Application Options: -c, --critical= Response time to result in critical status (seconds) (default: 10) -E, --escape Can use \n, \r, \t or \ in send or quit string. Must come before send or quit option. By default, nothing added to send, \r\n added to end of quit - -W, --error-warning Set the error level to warning when exiting with unexpected error (default: critical). In - the case of request succeeded, evaluation result of -c option eval takes priority. + -W, --error-warning Set the error level to warning when exiting with unexpected error (default: critical). If + the request succeeds, evaluation of the -c option takes priority. -C, --expect-closed Verify that the port/unixsock is closed. If the port/unixsock is closed, OK; if open, follow the ErrWarning flag. This option only verifies the connection. -v, --verbose Enables verbose logging of the actions taken. @@ -76,3 +48,29 @@ Application Options: Help Options: -h, --help Show this help message ``` + +## Examples + +### Default Check + + check_ssh github.com + SSH OK - 0.234 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.234029s;;;0.000000;10.000000 + + check_ssh --hostname github.com --warning 1 + SSH OK - 0.262 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.262048s;;;1.000000;10.000000 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_ssh + use generic-service + check_command check_nrpe!check_ssh!'-H' '192.168.178.100' '-p' '2323' + } diff --git a/docs/checks/plugins/check_tcp.md b/docs/checks/plugins/check_tcp.md index 0174c3e70..140e18267 100644 --- a/docs/checks/plugins/check_tcp.md +++ b/docs/checks/plugins/check_tcp.md @@ -3,13 +3,11 @@ title: check_tcp comment: auto-generated by make docs, do not edit --- -## check_tcp - -Runs check_tcp to perform tcp connection checks. +Runs check_tcp to perform TCP connection checks. It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tree/master/check-tcp -- [Examples](#examples) - [Usage](#usage) +- [Examples](#examples) ## Implementation @@ -17,41 +15,6 @@ It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tr |:------------------:|:------------------:|:------------------:|:------------------:| | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -## Examples - -### Default Check - -Alert if tcp connection fails: - - check_tcp -H omd.consol.de -p 80 - TCP OK - 0.003 seconds response time on omd.consol.de port 80 - -Send something and expect specific string: - - check_tcp -H outlook.com -p 25 -s "HELO" -e "Microsoft ESMTP MAIL Service ready" -q "QUIT - TCP OK - 0.197 seconds response time on outlook.com port 25 - -It can be a bit tricky to set the -u/--uri on windows, since the / is considered as start of -a command line parameter. - -To avoid this issue, simply use the long form --uri=/path.. so the parameter does not start with a slash. - -### Example using NRPE and Naemon - -Naemon Config - - define command{ - command_name check_nrpe - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ - } - - define service { - host_name testhost - service_description check_tcp - use generic-service - check_command check_nrpe!check_tcp!'-H' 'omd.consol.de' '-p' '80' - } - ## Usage ```Usage: @@ -59,7 +22,7 @@ Naemon Config Application Options: --service= Service name. e.g. ftp, smtp, pop, imap and so on - -H, --hostname= Host name or IP Address + -H, --hostname= Host name or IP address -4, --ipv4 Resolve and connect using IPv4 only -6, --ipv6 Resolve and connect using IPv6 only -p, --port= Port number @@ -76,8 +39,8 @@ Application Options: -c, --critical= Response time to result in critical status (seconds) (default: 10) -E, --escape Can use \n, \r, \t or \ in send or quit string. Must come before send or quit option. By default, nothing added to send, \r\n added to end of quit - -W, --error-warning Set the error level to warning when exiting with unexpected error (default: critical). In - the case of request succeeded, evaluation result of -c option eval takes priority. + -W, --error-warning Set the error level to warning when exiting with unexpected error (default: critical). If + the request succeeds, evaluation of the -c option takes priority. -C, --expect-closed Verify that the port/unixsock is closed. If the port/unixsock is closed, OK; if open, follow the ErrWarning flag. This option only verifies the connection. -v, --verbose Enables verbose logging of the actions taken. @@ -85,3 +48,33 @@ Application Options: Help Options: -h, --help Show this help message ``` + +## Examples + +### Default Check + +Alert if TCP connection fails: + + check_tcp -H omd.consol.de -p 80 + TCP OK - 0.003 seconds response time on omd.consol.de port 80 + +Send something and expect specific string: + + check_tcp -H outlook.com -p 25 -s "HELO" -e "Microsoft ESMTP MAIL Service ready" -q "QUIT" + TCP OK - 0.197 seconds response time on outlook.com port 25 + +### Example using NRPE and Naemon + +Naemon Config + + define command{ + command_name check_nrpe + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$ + } + + define service { + host_name testhost + service_description check_tcp + use generic-service + check_command check_nrpe!check_tcp!'-H' 'omd.consol.de' '-p' '80' + } diff --git a/docs/configuration/_index.md b/docs/configuration/_index.md index dbeb89e1c..2bb8ad82f 100644 --- a/docs/configuration/_index.md +++ b/docs/configuration/_index.md @@ -252,48 +252,11 @@ not be used for plugin arguments for security reasons. ## Macro Operators -Macro values can be altered by adding a colon separated suffix. - -Support operators are: - -| Suffix | Example | Description | -| --------------------- | ------------------------------------- | ------------| -| `:lc` | Word -> word | make value lowercase | -| `:uc` | test -> TEST | make value uppercase | -| `:h` | 1000 -> 1k | make a number more human readably | -| `:duration` | 125 -> 2m 5s | convert amount of seconds into human readable duration | -| `:age` | 1700834034 -> 374 | subtract value from current unix timestamp to get the age in seconds | -| `:date` | 1700834034 -> 2023-11-24 14:53:54 CET | convert unix timestamp into human readable date (local timezone) | -| `:utc` | 1700834034 -> 2023-11-24 13:53:54 UTC | convert unix timestamp into human readable date (utc timezone) | -| `:fmt=` | 123.45 -> 123.5 | apply format, ex.: $(total \| fmt=%.1f) (using GOs fmt.Sprintf) | -| `:s/regexp/replace/` | C:\ % -> C | apply regexp replacement, ex.: $(name \| 's/\\W//' ) (using GOs regexp.Compile) | -| `:ascii` | C:\ % -> C | remove any none-ascii characters | -| `:trim` | " test " -> "test" | remove leading and trailing whitespace | -| `:chomp` | " test " -> " test" | remove trailing whitespace only | - -for example, define a dummy command which prints the hostname in lower case letters: +The list of available macro operators is defined [here](../checks/macros/) + +For example, to define a dummy command which prints the hostname in lower case letters: ```ini [/settings/external scripts/alias] alias_hostname = check_dummy 0 "host:${hostname:lc}" ``` - -Operators can be put together (spaces are optional): - -```txt -$(datemacro:date : uc) -``` - -This converts $(datemacro) to a human readable date and make everything uppercase. - -You can also use the pipe symbol to use multiple operators in a row, ex.: - -```txt -$(macroname | date | uc) -``` - -Use the generic fmt operator to apply any format on numbers, ex.: - -```txt -$(used_pct | fmt=%d) -``` diff --git a/pkg/check_dns/check_dns.go b/pkg/check_dns/check_dns.go index 2c8aea9c7..d89cac1b7 100644 --- a/pkg/check_dns/check_dns.go +++ b/pkg/check_dns/check_dns.go @@ -45,7 +45,7 @@ type dnsOpts struct { Port int `short:"p" long:"port" default:"53" description:"Port number you want to use"` QueryType string `short:"q" long:"querytype" default:"A" description:"DNS record query type"` Norec bool `long:"norec" description:"Clears the Recursion Desired flag, DNS server answers only from its authoritative data or cache, does not ask other nameservers."` - ExpectedString []string `short:"e" long:"expected-string" description:"IP-ADDRESS string you expect the DNS server to return. If multiple IP-ADDRESS are returned at once, you have to specify whole string"` + ExpectedString []string `short:"e" long:"expected-string" description:"IP-ADDRESS string you expect the DNS server to return. If multiple IP addresses are returned at once, you have to specify the whole string"` SearchPaths []string `long:"search-path" description:"Search paths to add to domains before sending a DNS query. This can be specified multiple times."` ResolvConfFile string `long:"resolv-conf-file" default:"/etc/resolv.conf" description:"Path to the resolv.conf file to use. Is not used in Windows."` Verbose bool `short:"v" long:"vv" long:"vvv" long:"verbose" description:"Show verbose output."` diff --git a/pkg/check_http/check_http.go b/pkg/check_http/check_http.go index 7f8fc074e..54914730b 100644 --- a/pkg/check_http/check_http.go +++ b/pkg/check_http/check_http.go @@ -66,30 +66,30 @@ type commandOpts struct { URI string `short:"u" long:"uri" default:"/" description:"URI to request"` ExpectStr string `short:"e" long:"expect" default:"" description:"Comma-delimited list of expected HTTP response status. By default, 1XX, 2XX are OK, 3XX depends on --onredirect option, 4XX are WARNING, 5XX are CRITICAL"` ExpectContent string `short:"s" long:"string" description:"String to expect in the content"` - Base64ExpectContent string ` long:"base64-string" description:"Base64 Encoded string to expect the content"` + Base64ExpectContent string ` long:"base64-string" description:"Base64-encoded string to expect in the content"` UserAgent string `short:"A" long:"useragent" default:"check_http" description:"UserAgent to be sent"` Authorization string `short:"a" long:"authorization" description:"Pass '[username]:[password]' formatted string to be used as basic authorization header"` - Header []string `short:"k" long:"header" description:"Any other tags to be sent in http header. Use multiple times for additional headers"` + Header []string `short:"k" long:"header" description:"Any other tags to be sent in HTTP header. Use multiple times for additional headers"` Certificate string `short:"C" long:"certificate" description:"Check certificates instead of content. Specified in mandatory days left to warn and optional days to crit with a comma: warn_days[,]" ` - TLSMinVersion string ` long:"tls-min" description:"Minimum supported TLS version. Values with plus set the max tls version as well to latest version: 1.3" choice:"1.0" choice:"1.0+" choice:"1.1" choice:"1.1+" choice:"1.2" choice:"1.2+" choice:"1.3"` + TLSMinVersion string ` long:"tls-min" description:"Minimum supported TLS version. Values with plus set the maximum TLS version as well to latest version: 1.3" choice:"1.0" choice:"1.0+" choice:"1.1" choice:"1.1+" choice:"1.2" choice:"1.2+" choice:"1.3"` TLSMaxVersion string ` long:"tls-max" description:"Maximum supported TLS version" choice:"1.0" choice:"1.1" choice:"1.2" choice:"1.3"` Proxy string ` long:"proxy" description:"Proxy that should be used"` RegexStr string `short:"r" long:"regex" description:"Search page for case-sensitive regex string"` RegexiStr string `short:"R" long:"regexi" description:"Search page for case-insensitive regex string"` - Onredirect string `short:"f" long:"onredirect" description:"What strategy to use when encountering a redirect. ok/warning/critical returns immediately. follow uses the new URL returned by golang HTTP client. Sticky keeps the hostname to be same after redirect, and stickyport persists the port as well." choice:"ok" choice:"warning" choice:"critical" choice:"follow" choice:"sticky" choice:"stickyport"` + Onredirect string `short:"f" long:"onredirect" description:"What strategy to use when encountering a redirect. ok/warning/critical returns immediately. follow uses the new URL returned by golang HTTP client. Sticky keeps the hostname the same after redirect, and stickyport persists the port as well." choice:"ok" choice:"warning" choice:"critical" choice:"follow" choice:"sticky" choice:"stickyport"` MaxBufferSize string ` long:"max-buffer-size" default:"1MB" description:"Max buffer size to read response body (max.: 100MB)"` TimeoutStr string `short:"t" long:"timeout" default:"10" description:"Timeout to wait for connection. If no time unit is given at the end, default of seconds is assumed"` - WarningThresholdStr string `short:"w" long:"warning" default:"30" description:"If the request+response takes longer specified warning threshold, raises a warning. If no time unit is given at the end, default of seconds is assumed. Value is truncated to milliseconds."` - CriticalThresholdStr string `short:"c" long:"critical" default:"60" description:"If the request+response takes longer specified critical threshold, raises a critical. If no time unit is given at the end, default of seconds is assumed. Value is truncated to milliseconds."` + WarningThresholdStr string `short:"w" long:"warning" default:"30" description:"If the request+response takes longer than the specified warning threshold, raises a warning. If no time unit is given at the end, default of seconds is assumed. Value is truncated to milliseconds."` + CriticalThresholdStr string `short:"c" long:"critical" default:"60" description:"If the request+response takes longer than the specified critical threshold, raises a critical. If no time unit is given at the end, default of seconds is assumed. Value is truncated to milliseconds."` WaitForInterval time.Duration ` long:"wait-for-interval" default:"2s" description:"Retry interval"` WaitForMax time.Duration ` long:"wait-for-max" description:"Time to wait for success (max.: 180s)"` Interim time.Duration ` long:"interim" default:"1s" description:"Interval time after successful request for consecutive mode"` Consecutive int ` long:"consecutive" default:"1" description:"Number of consecutive successful requests required (max.: 5)"` Port int `short:"p" long:"port" description:"Port number"` MaxRedirects int ` long:"max-redirs" description:"Maximum redirects before giving up on following"` - NoDiscard bool ` long:"no-discard" description:"Raise error when the response body is larger then max-buffer-size"` + NoDiscard bool ` long:"no-discard" description:"Raise error when the response body is larger than max-buffer-size"` WaitFor bool ` long:"wait-for" description:"Retry until successful when enabled"` - SSL bool `short:"S" long:"ssl" description:"Use https"` + SSL bool `short:"S" long:"ssl" description:"Use HTTPS"` SNI bool ` long:"sni" description:"Enable SNI"` TCP4 bool `short:"4" description:"Use tcp4 only"` TCP6 bool `short:"6" description:"Use tcp6 only"` diff --git a/pkg/check_tcp/check_tcp.go b/pkg/check_tcp/check_tcp.go index b03f5f935..c3db5b1c2 100644 --- a/pkg/check_tcp/check_tcp.go +++ b/pkg/check_tcp/check_tcp.go @@ -64,7 +64,7 @@ func Check(ctx context.Context, output io.Writer, args []string) int { // Apache-2.0 license type tcpOpts struct { Service string `long:"service" description:"Service name. e.g. ftp, smtp, pop, imap and so on"` - Hostname string `short:"H" long:"hostname" description:"Host name or IP Address"` + Hostname string `short:"H" long:"hostname" description:"Host name or IP address"` IPv4 bool `short:"4" long:"ipv4" description:"Resolve and connect using IPv4 only"` IPv6 bool `short:"6" long:"ipv6" description:"Resolve and connect using IPv6 only"` exchange @@ -74,7 +74,7 @@ type tcpOpts struct { Warning float64 `short:"w" long:"warning" description:"Response time to result in warning status (seconds)"` Critical float64 `short:"c" long:"critical" description:"Response time to result in critical status (seconds)" default:"10"` Escape bool `short:"E" long:"escape" description:"Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. By default, nothing added to send, \\r\\n added to end of quit"` - ErrWarning bool `short:"W" long:"error-warning" description:"Set the error level to warning when exiting with unexpected error (default: critical). In the case of request succeeded, evaluation result of -c option eval takes priority."` + ErrWarning bool `short:"W" long:"error-warning" description:"Set the error level to warning when exiting with unexpected error (default: critical). If the request succeeds, evaluation of the -c option takes priority."` ExpectClosed bool `short:"C" long:"expect-closed" description:"Verify that the port/unixsock is closed. If the port/unixsock is closed, OK; if open, follow the ErrWarning flag. This option only verifies the connection."` Verbose bool `short:"v" long:"verbose" description:"Enables verbose logging of the actions taken."` } diff --git a/pkg/snclient/builtin_check.go b/pkg/snclient/builtin_check.go index bc1d32f1f..ab721f48c 100644 --- a/pkg/snclient/builtin_check.go +++ b/pkg/snclient/builtin_check.go @@ -96,6 +96,7 @@ func (l *CheckBuiltin) Help(ctx context.Context, snc *Agent, check *CheckData, f out += "```" out += usage out += "```\n" + out += "\n" + check.helpExamplesMarkdown() } else { out += "Usage:\n\n " usage = " " + strings.Join(strings.Split(usage, "\n"), "\n ") diff --git a/pkg/snclient/check_connections.go b/pkg/snclient/check_connections.go index b44641978..ceb4b2767 100644 --- a/pkg/snclient/check_connections.go +++ b/pkg/snclient/check_connections.go @@ -80,7 +80,7 @@ func NewCheckConnections() CheckHandler { func (l *CheckConnections) Build() *CheckData { return &CheckData{ name: "check_connections", - description: "Checks the number of tcp connections.", + description: "Checks the number of TCP connections.", implemented: Linux | Windows | Darwin, hasInventory: ListInventory, result: &CheckResult{ diff --git a/pkg/snclient/check_cpu.go b/pkg/snclient/check_cpu.go index 9067d8c6e..7abf22e5e 100644 --- a/pkg/snclient/check_cpu.go +++ b/pkg/snclient/check_cpu.go @@ -30,7 +30,7 @@ func NewCheckCPU() CheckHandler { func (l *CheckCPU) Build() *CheckData { return &CheckData{ name: "check_cpu", - description: "Checks the cpu usage metrics.", + description: "Checks the CPU usage metrics.", implemented: ALL, hasInventory: ListInventory, result: &CheckResult{ diff --git a/pkg/snclient/check_cpu_utilization.go b/pkg/snclient/check_cpu_utilization.go index a5daefd87..194cf5f54 100644 --- a/pkg/snclient/check_cpu_utilization.go +++ b/pkg/snclient/check_cpu_utilization.go @@ -42,7 +42,7 @@ func NewCheckCPUUtilization() CheckHandler { func (l *CheckCPUUtilization) Build() *CheckData { return &CheckData{ name: "check_cpu_utilization", - description: "Checks the cpu utilization metrics.", + description: "Checks the CPU utilization metrics.", implemented: ALL, hasInventory: ListInventory, result: &CheckResult{ @@ -58,17 +58,17 @@ func (l *CheckCPUUtilization) Build() *CheckData { topSyntax: "${status} - ${list}", detailSyntax: "user: ${user}% - system: ${system}% - iowait: ${iowait}% - steal: ${steal}% - guest: ${guest} - idle: %{idle}%", attributes: []CheckAttribute{ - {name: "total", description: "Sum of user,system,iowait,steal and guest in percent", unit: UPercent}, - {name: "user", description: "User cpu utilization in percent", unit: UPercent}, - {name: "system", description: "System cpu utilization in percent", unit: UPercent}, - {name: "iowait", description: "IOWait cpu utilization in percent", unit: UPercent}, - {name: "steal", description: "Steal cpu utilization in percent", unit: UPercent}, - {name: "guest", description: "Guest cpu utilization in percent", unit: UPercent}, - {name: "idle", description: "Idle cpu utilization in percent", unit: UPercent}, + {name: "total", description: "Sum of user, system, iowait, steal and guest in percent", unit: UPercent}, + {name: "user", description: "User CPU utilization in percent", unit: UPercent}, + {name: "system", description: "System CPU utilization in percent", unit: UPercent}, + {name: "iowait", description: "IOWait CPU utilization in percent", unit: UPercent}, + {name: "steal", description: "Steal CPU utilization in percent", unit: UPercent}, + {name: "guest", description: "Guest CPU utilization in percent", unit: UPercent}, + {name: "idle", description: "Idle CPU utilization in percent", unit: UPercent}, }, exampleDefault: ` - check_cpu_utilization -OK - user: 2% - system: 1% - iowait: 0% - steal: 0% - guest: 0 - idle: 96% |'total'=3.4%;90;95;0; 'user'=2.11%;;;0;... + check_cpu_utilization + OK - user: 2% - system: 1% - iowait: 0% - steal: 0% - guest: 0 - idle: 96% |'total'=3.4%;90;95;0; 'user'=2.11%;;;0;... `, exampleArgs: `'warn=total > 90%' 'crit=total > 95%'`, } diff --git a/pkg/snclient/check_dns.go b/pkg/snclient/check_dns.go index ac5143557..c7752e7ff 100644 --- a/pkg/snclient/check_dns.go +++ b/pkg/snclient/check_dns.go @@ -15,7 +15,7 @@ It basically wraps the plugin from https://github.com/mackerelio/go-check-plugin docTitle: `check_dns`, usage: `check_dns []`, exampleDefault: ` -Alert if dns server does not respond: +Alert if DNS server does not respond: check_dns -H labs.consol.de OK - labs.consol.de returns 94.185.89.33 (A) diff --git a/pkg/snclient/check_drive_io.go b/pkg/snclient/check_drive_io.go index 17b047f13..2a2c4451f 100644 --- a/pkg/snclient/check_drive_io.go +++ b/pkg/snclient/check_drive_io.go @@ -36,14 +36,14 @@ func NewCheckDriveIO() CheckHandler { func (l *CheckDriveIO) Build() *CheckData { return &CheckData{ name: "check_drive_io", - description: "Checks the disk Input / Output on the host.", + description: "Checks the disk I/O on the host.", implemented: ALL, hasInventory: ListInventory, result: &CheckResult{ State: CheckExitOK, }, args: map[string]CheckArgument{ - "drive": {value: &l.drives, isFilter: true, description: "Name(s) of the drives to check the IO stats for ex.: c: or / .If left empty, it will check all drives"}, + "drive": {value: &l.drives, isFilter: true, description: "Names of the drives to check I/O stats for, e.g. C: or sda. If left empty, all drives are checked"}, "lookback": { value: &l.lookback, isFilter: true, description: fmt.Sprintf("Lookback period for value change rate and utilization calculations, given in seconds. Default: %d", defaultLookbackDriveIO), @@ -57,9 +57,9 @@ func (l *CheckDriveIO) Build() *CheckData { emptyState: CheckExitUnknown, emptySyntax: "%(status) - No drives found", attributes: []CheckAttribute{ - {name: "drive", description: "Name(s) of the drives to check the io stats for. If left empty, it will check all drives. " + + {name: "drive", description: "Names of the drives to check I/O stats for. If left empty, it will check all drives. " + "For Windows this is the drive letter. For UNIX it is the logical name of the drive."}, - {name: "lookback", description: "Lookback period for which the value change rate and utilization is calculated."}, + {name: "lookback", description: "Lookback period for which the value change rate and utilization are calculated."}, {name: "read_count", description: "Total number of read operations completed successfully"}, {name: "read_count_rate", description: "Number of read operations per second during the lookback period"}, {name: "read_bytes", description: "Total number of bytes read from the disk", unit: UByte}, @@ -70,7 +70,7 @@ func (l *CheckDriveIO) Build() *CheckData { {name: "write_count_rate", description: "Number of write operations per second during the lookback period"}, {name: "write_bytes", description: "Total number of bytes written to the disk", unit: UByte}, {name: "write_bytes_rate", description: "Average bytes written per second during the lookback period", unit: UByte}, - {name: "write_bytes_rate_humanized", description: "Average bytes read per second during the lookback period, written in humanized format"}, + {name: "write_bytes_rate_humanized", description: "Average bytes written per second during the lookback period, written in humanized format"}, {name: "write_time", description: "Total time spent on write operations (milliseconds)."}, // Windows does not report these @@ -87,8 +87,8 @@ func (l *CheckDriveIO) Build() *CheckData { {name: "idle_time", description: "Count of the 100 ns periods the disk was idle. Windows only"}, {name: "query_time", description: "The time the performance query was sent. Count of 100 ns periods since the Win32 epoch of 01.01.1601. Windows only"}, - {name: "queue_depth", description: "The depth of the IO queue. Windows only."}, - {name: "split_count", description: "The cumulative count of IOs that are associated IOs. Windows only."}, + {name: "queue_depth", description: "The depth of the I/O queue. Windows only."}, + {name: "split_count", description: "The cumulative count of I/Os that are associated I/Os. Windows only."}, // note to future: currently only the utilization is calculated by adding io_time to the counter // if more stats are saved in the counters, one can calculate relatively useful metrics as well @@ -106,13 +106,12 @@ func (l *CheckDriveIO) Build() *CheckData { //nolint:lll // the output is long exampleDefault: ` check_drive_io - OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C -_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; + OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; -Check a UNIX drive and alert if for the last 30 seconds written bytes/second is above 10 Mb/s . Dm-0 is the name of the encrypted volume, it could be nvme0n1 or sdb as well +Check a UNIX drive and alert if the average write rate over the last 30 seconds exceeds 10 MB/s. Here, dm-0 is the encrypted volume; it could be nvme0n1 or sdb instead. - check_drivesize lookback=30 warn="write_bytes_rate > 10Mb" - OK - dm-0 >1.8 MiB/s/s <815.0 B/s/s 0.0%, sda1 >0 B/s/s <0 B/s/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; 'sda1_read_count'=3178c;;;0; 'sda1_read_bytes'=67430400c;;;0; 'sda1_read_time'=13572ms;;;0; 'sda1_write_count'=3193c;;;0; 'sda1_write_bytes'=282012672c;;;0; 'sda1_write_time'=9446ms;;;0; 'sda1_utilization'=0%;95;;0; 'sda1_io_time'=10832ms;;;0; 'sda1_weighted_io'=23019;;;0; 'sda1_iops_in_progress'=0;;;0; + check_drive_io drive=dm-0 lookback=30 warn="write_bytes_rate > 10MB" + OK - dm-0 >1.8 MiB/s <815.0 B/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; `, exampleArgs: "", } diff --git a/pkg/snclient/check_drivesize.go b/pkg/snclient/check_drivesize.go index 19b94af61..ecb638307 100644 --- a/pkg/snclient/check_drivesize.go +++ b/pkg/snclient/check_drivesize.go @@ -138,7 +138,7 @@ func (l *CheckDrivesize) Build() *CheckData { {name: "inodes_free", description: "Number of free inodes"}, {name: "inodes_free_pct", description: "Number of free inodes in percent", unit: UPercent}, - {name: "inodes_total", description: "Number of total free inodes"}, + {name: "inodes_total", description: "Total number of inodes"}, {name: "inodes_used", description: "Number of used inodes"}, {name: "inodes_used_pct", description: "Number of used inodes in percent", unit: UPercent}, @@ -147,8 +147,8 @@ func (l *CheckDrivesize) Build() *CheckData { {name: "readable", description: "Windows only: flag drive is readable (0/1)", unit: UBool}, {name: "writable", description: "Windows only: flag drive is writable (0/1)", unit: UBool}, {name: "removable", description: "Windows only: flag drive is removable (0/1)", unit: UBool}, - {name: "erasable", description: "Windows only: flag whether if drive is erasable (0/1)", unit: UBool}, - {name: "hotplug", description: "Windows only: flag drive is hotplugable (0/1)", unit: UBool}, + {name: "erasable", description: "Windows only: flag whether the drive is erasable (0/1)", unit: UBool}, + {name: "hotplug", description: "Windows only: flag drive is hot-pluggable (0/1)", unit: UBool}, {name: "remote_name", description: "Windows only: the remote name of the drive, if it uses a network name"}, {name: "persistent", description: "Windows only: if the network drive is mounted as persistent (0/1)", unit: UBool}, diff --git a/pkg/snclient/check_drivesize_other.go b/pkg/snclient/check_drivesize_other.go index 76bee46d1..b12a84329 100644 --- a/pkg/snclient/check_drivesize_other.go +++ b/pkg/snclient/check_drivesize_other.go @@ -21,17 +21,17 @@ func (l *CheckDrivesize) getDefaultFilter() string { func (l *CheckDrivesize) getExample() string { return ` check_drivesize drive=/ show-all - OK - / 280.155 GiB/455.948 GiB (64.7%) |... + OK - / 280.155 GiB/455.948 GiB (61.4%) |... Check drive including inodes: check_drivesize drive=/ warn="used > 90%" "crit=used > 95%" "warn=inodes > 90%" "crit=inodes > 95%" OK - All 1 drive(s) are ok |'/ used'=307515822080B;440613398938;465091921101;0;489570443264 '/ used %'=62.8%;90;95;0;100 '/ inodes'=12.1%;90;95;0;100 -Check folder, no matter if its a mountpoint itself or not: +Check folder, no matter if it's a mount point itself or not: check_drivesize folder=/tmp show-all - OK - /tmp 280.155 GiB/455.948 GiB (64.7%) |... + OK - /tmp 280.155 GiB/455.948 GiB (61.4%) |... This check supports specifying different usage thresholds for each drive. Use '[drive] used_pct' or '[drive] used %' in the condition: check_drivesize "drive=/" "drive=/tmp" "warn='/ used_pct' gt 70" "crit='/tmp used %' > 1" diff --git a/pkg/snclient/check_drivesize_windows.go b/pkg/snclient/check_drivesize_windows.go index 1989320f7..d3996e3a4 100644 --- a/pkg/snclient/check_drivesize_windows.go +++ b/pkg/snclient/check_drivesize_windows.go @@ -50,8 +50,8 @@ Check a network share directly via its UNC path, no drive letter mapping require check_drivesize drive=\\server\C$ show-all OK - \\server\C$ 100.000 GiB/500.000 GiB (20.0%) |'\\server\C$ used'=... -Shares in general are only accessible if the snclient has sufficient credentials on the remote server. Otherwise the check reports an error for that drive. -The connection has to be established beforehand, the snclient does not authenticate on its own. +Shares in general are only accessible if SNClient has sufficient credentials on the remote server. Otherwise the check reports an error for that drive. +The connection has to be established beforehand, SNClient does not authenticate on its own. If the UNC path is mapped to a drive letter, the mapped drive is used and the localised path is available in the localised_remote_path attribute: diff --git a/pkg/snclient/check_eventlog.go b/pkg/snclient/check_eventlog.go index 8db8b6864..91e5a66f7 100644 --- a/pkg/snclient/check_eventlog.go +++ b/pkg/snclient/check_eventlog.go @@ -24,9 +24,9 @@ func NewCheckEventlog() CheckHandler { func (l *CheckEventlog) Build() *CheckData { return &CheckData{ name: "check_eventlog", - description: `Checks the windows eventlog entries. + description: `Checks the Windows eventlog entries. -Basically, this check wraps this wmi query: +Basically, this check wraps this WMI query: SELECT ComputerName, LogFile, @@ -45,7 +45,7 @@ FROM See https://learn.microsoft.com/en-us/previous-versions/windows/desktop/eventlogprov/win32-ntlogevent for a description of the provided fields. -Filter conditions on id are added to the WHERE clause of the wmi query when possible, +Filter conditions on id are added to the WHERE clause of the WMI query when possible, the filter is still applied to the returned events. `, implemented: Windows, @@ -82,7 +82,7 @@ the filter is still applied to the returned events. {name: "message", description: "The message as a string"}, {name: "source", description: "The source system (SourceName)"}, {name: "provider", description: "Alias for source"}, - {name: "written", description: "Time of the message being written( TimeWritten)", unit: UDate}, + {name: "written", description: "Time of the message being written (TimeWritten)", unit: UDate}, }, exampleDefault: ` check_eventlog diff --git a/pkg/snclient/check_files.go b/pkg/snclient/check_files.go index a34c38594..133463a21 100644 --- a/pkg/snclient/check_files.go +++ b/pkg/snclient/check_files.go @@ -82,7 +82,7 @@ func (l *CheckFiles) Build() *CheckData { "file": {value: &l.paths, description: "Alias for path", isFilter: true}, "paths": {value: &l.pathList, description: "A comma separated list of paths", isFilter: true}, "pattern": {value: &l.pattern, description: "Pattern of files to search for", isFilter: true}, - "max-depth": {value: &l.maxDepth, description: fmt.Sprintf("Maximum recursion depth. '0' and '1' disable recursion into subfolders and only include files/directories directly under path."+ + "max-depth": {value: &l.maxDepth, description: fmt.Sprintf("Maximum recursion depth. '0' and '1' disable recursion into subfolders and only include files/directories directly under path"+ ", '2' starts to include files/directories of subdirectories with given depth. '%d' disables depth checks. Default: %d ", CheckFilesMaxDepthUnlimited, CheckFilesDefaultMaxDepth)}, "timezone": {description: "Sets the timezone for time metrics (default is local time)"}, "follow-symlinks": {value: &l.followSymlinks, description: fmt.Sprintf("Follow symlinks of files and subdirectories while traversing. "+ @@ -115,7 +115,7 @@ func (l *CheckFiles) Build() *CheckData { {name: "written", description: "Unix timestamp when file was last written to", unit: UDate}, {name: "write", description: "Alias for written", unit: UDate}, {name: "age", description: "Seconds since file was last written", unit: UDuration}, - {name: "version", description: "Windows exe/dll file version (windows only)"}, + {name: "version", description: "Windows exe/dll file version (Windows only)"}, {name: "line_count", description: "Number of lines in the files (text files)"}, {name: "total_bytes", description: "Total size over all files in bytes", unit: UByte}, {name: "total_size", description: "Total size over all files as human readable bytes", unit: UByte}, @@ -131,8 +131,8 @@ func (l *CheckFiles) Build() *CheckData { exampleDefault: ` Alert if there are logs older than 1 hour in /tmp: - check_files path="/tmp" pattern="*.log" "filter=age > 1h" crit="count > 0" empty-state=0 empty-syntax="no old files found" top-syntax="found %(count) too old logs" - OK - All 138 files are ok: (29.22 MiB) |'count'=138;500;600;0 'size'=30642669B;;;0 + check_files path="/tmp" pattern="*.log" "filter=age > 1h" crit="count > 0" empty-state=0 empty-syntax="no old files found" top-syntax="%(status) - found %(count) old log files" + CRITICAL - found 138 old log files |'count'=138;;0;0 'size'=30642669B;;;0 Check for folder size: diff --git a/pkg/snclient/check_http.go b/pkg/snclient/check_http.go index 4d7aa5798..49b3ea922 100644 --- a/pkg/snclient/check_http.go +++ b/pkg/snclient/check_http.go @@ -9,13 +9,13 @@ func init() { func NewCheckHTTP() CheckHandler { return &CheckBuiltin{ name: "check_http", - description: `Runs check_http to perform http(s) checks + description: `Runs check_http to perform HTTP(s) checks It basically wraps the plugin from https://github.com/sni/check_http_go`, check: check_http.Check, docTitle: `check_http`, usage: `check_http []`, exampleDefault: ` -Alert if http server does not respond: +Alert if HTTP server does not respond: check_http -H omd.consol.de HTTP OK - HTTP/1.1 200 OK - 573 bytes in 0.001 second response time | ... @@ -25,10 +25,10 @@ Check for specific string and response code: check_http -H omd.consol.de -S -u "/docs/snclient/" -e 200,304 -s "consol" -vvv HTTP OK - Status line output "HTTP/2.0 200 OK" matched "200,304", Response body matched "consol"... -It can be a bit tricky to set the -u/--uri on windows, since the / is considered as start of +It can be a bit tricky to set the -u/--uri on Windows, since the / is considered as the start of a command line parameter. -To avoid this issue, simply use the long form --uri=/path.. so the parameter does not start with a slash. +To avoid this issue, simply use the long form --uri=/path so the parameter does not start with a slash. `, exampleArgs: `'-H' 'omd.consol.de' '--uri=/docs' '-S'`, } diff --git a/pkg/snclient/check_index.go b/pkg/snclient/check_index.go index 2fcd182a7..a216f5fda 100644 --- a/pkg/snclient/check_index.go +++ b/pkg/snclient/check_index.go @@ -21,7 +21,7 @@ func NewCheckIndex() CheckHandler { func (l *CheckIndex) Build() *CheckData { return &CheckData{ name: "check_index", - description: "returns list of known checks.", + description: "Returns list of all known checks.", implemented: ALL, detailSyntax: "${name}", topSyntax: "${list}", @@ -33,10 +33,10 @@ func (l *CheckIndex) Build() *CheckData { {name: "name", description: "name of the check"}, {name: "description", description: "description of the check"}, {name: "implemented", description: "check is available on current platform: 0 / 1"}, - {name: "windows", description: "check is available on windows: 0 / 1"}, - {name: "linux", description: "check is available on linux: 0 / 1"}, - {name: "osx", description: "check is available on mac osx: 0 / 1"}, - {name: "freebsd", description: "check is available on freebsd: 0 / 1"}, + {name: "windows", description: "check is available on Windows: 0 / 1"}, + {name: "linux", description: "check is available on Linux: 0 / 1"}, + {name: "osx", description: "check is available on macOS: 0 / 1"}, + {name: "freebsd", description: "check is available on FreeBSD: 0 / 1"}, {name: "alias", description: "check is an alias: 0 / 1"}, {name: "script", description: "check is a (wrapped) script: 0 / 1"}, }, diff --git a/pkg/snclient/check_kernel_stats_linux.go b/pkg/snclient/check_kernel_stats_linux.go index 63edb75d7..84afd38c9 100644 --- a/pkg/snclient/check_kernel_stats_linux.go +++ b/pkg/snclient/check_kernel_stats_linux.go @@ -33,7 +33,7 @@ func NewCheckKernelStats() CheckHandler { func (l *CheckKernelStats) Build() *CheckData { return &CheckData{ name: "check_kernel_stats", - description: "Checks some metrics of the linux kernel. Currently support context switches, process creations and total number of threads.", + description: "Checks some metrics of the Linux kernel. Currently supports context switches, process creations and total number of threads.", implemented: Linux, hasInventory: ListInventory, result: &CheckResult{ diff --git a/pkg/snclient/check_load.go b/pkg/snclient/check_load.go index 28767ab20..32db2d048 100644 --- a/pkg/snclient/check_load.go +++ b/pkg/snclient/check_load.go @@ -40,7 +40,7 @@ func NewCheckLoad() CheckHandler { func (l *CheckLoad) Build() *CheckData { return &CheckData{ name: "check_load", - description: "Checks the cpu load metrics.", + description: "Checks the CPU load metrics.", implemented: ALL, hasInventory: ListInventory, result: &CheckResult{ diff --git a/pkg/snclient/check_logfile.go b/pkg/snclient/check_logfile.go index 3148c9215..418d75173 100644 --- a/pkg/snclient/check_logfile.go +++ b/pkg/snclient/check_logfile.go @@ -96,22 +96,22 @@ func (c *CheckLogFile) Build() *CheckData { State: CheckExitOK, }, attributes: []CheckAttribute{ - {name: "count ", description: "Number of items matching the filter. Common option for all checks."}, - {name: "filename ", description: "The name of the file"}, + {name: "count", description: "Number of items matching the filter. Common option for all checks."}, + {name: "filename", description: "The name of the file"}, {name: "line", description: "Match the content of an entire line"}, - {name: "columnN", description: "Match the content of the N-th column only if enough columns exists"}, + {name: "columnN", description: "Match the content of the N-th column only if enough columns exist"}, }, extraFilterAttributes: []*regexp.Regexp{ regexp.MustCompile(`^column.*`), }, exampleDefault: ` -Alert if there are errors in the snclient log file: +Alert if there are errors in the SNClient log file: - check_files files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error'" + check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' OK - 134 line(s) found Non-OK output example - check_files files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error'" + check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' CRITICAL - 23/548 line(s) found `, exampleArgs: `'files=/var/log/snclient/snclient.log' 'warn=line like Warn'`, diff --git a/pkg/snclient/check_mailq.go b/pkg/snclient/check_mailq.go index 2a6f55af4..de45beec2 100644 --- a/pkg/snclient/check_mailq.go +++ b/pkg/snclient/check_mailq.go @@ -39,7 +39,7 @@ func (l *CheckMailq) Build() *CheckData { State: CheckExitOK, }, args: map[string]CheckArgument{ - "mta": {value: &l.mta, isFilter: true, description: "Set source mta for checking mailq instead of auto detect. Can be postfix or auto"}, + "mta": {value: &l.mta, isFilter: true, description: "Set the source MTA for checking the mail queue instead of automatic detection. Can be postfix or auto"}, }, defaultFilter: "none", defaultWarning: "active > 5 || active_size > 10MB || deferred > 0 || deferred_size > 10MB", @@ -49,7 +49,7 @@ func (l *CheckMailq) Build() *CheckData { emptyState: CheckExitUnknown, emptySyntax: "%(status) - could not get any mailq data", attributes: []CheckAttribute{ - {name: "mta", description: "name of the mta"}, + {name: "mta", description: "name of the MTA"}, {name: "folder", description: "checked spool folder"}, {name: "active", description: "number of active mails"}, {name: "active_size", description: "size of active mails in bytes", unit: UByte}, diff --git a/pkg/snclient/check_memory.go b/pkg/snclient/check_memory.go index 99a1e974d..1e9322ab6 100644 --- a/pkg/snclient/check_memory.go +++ b/pkg/snclient/check_memory.go @@ -44,11 +44,11 @@ func (l *CheckMemory) Build() *CheckData { There are several types of memory that can be checked: physical: physical memory - swap: swap memory (pagefile on windows) - committed: committed memory as shown in the windows task manager (windows only, basically this is the physical + swap) - virtual: available windows virtual address space (windows only) + swap: swap memory (pagefile on Windows) + committed: committed memory as shown in the Windows task manager (Windows only, basically this is the physical + swap) + virtual: available Windows virtual address space (Windows only) -read more on windows virtual address space: +read more on Windows virtual address space: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex`, implemented: ALL, @@ -67,7 +67,7 @@ read more on windows virtual address space: topSyntax: "%(status) - ${list}", attributes: []CheckAttribute{ {name: "", description: "used bytes with the type as key", unit: UByte}, - {name: "type", description: "checked type, either 'physical' or 'committed', 'swap' or 'virtual' (windows only)"}, + {name: "type", description: "checked type, either 'physical' or 'committed', 'swap' or 'virtual' (Windows only)"}, {name: "used", description: "Used memory in human readable bytes (IEC)", unit: UByte}, {name: "used_bytes", description: "Used memory in bytes (IEC)", unit: UByte}, {name: "used_pct", description: "Used memory in percent", unit: UPercent}, @@ -90,7 +90,7 @@ read more on windows virtual address space: Changing the return syntax to get more information: check_memory 'top-syntax=${list}' 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}' - physical free: 35.00 B used: 7.01 GiB size: 31.09 GiB, committed free: 27.00 B used: 705.57 MiB size: 977.00 MiB |... + physical free: 24.08 GiB used: 7.01 GiB size: 31.09 GiB, committed free: 271.43 MiB used: 705.57 MiB size: 977.00 MiB |... `, exampleArgs: `'warn=used > 80%' 'crit=used > 90%'`, } diff --git a/pkg/snclient/check_multi.go b/pkg/snclient/check_multi.go index a45ed3048..76f423d87 100644 --- a/pkg/snclient/check_multi.go +++ b/pkg/snclient/check_multi.go @@ -121,7 +121,7 @@ func (l *CheckMulti) Build() *CheckData { [check_process] OK - all 1 processes are ok. [check_memory] OK - physical = 12.59 GiB/16.00 GiB (78.7%) - You can define 'warning' and 'critical' conditions based on the number of checks in a certain state (see attributes below): + You can define 'warning' and 'critical' conditions based on the number of checks in a certain state (see attributes above): check_multi "command[check_dummy1]=check_dummy 0 'OK - check works'" "command[check_dummy2]=check_dummy 1 'WARNING - problem found'" "critical=problem_count gt 0" CRITICAL - 2 plugins checked: 1 ok, 1 warning, 0 critical, 0 unknown - warning(check_dummy2: WARNING - problem found) diff --git a/pkg/snclient/check_ntp_offset.go b/pkg/snclient/check_ntp_offset.go index 992bee24c..02f3d7d98 100644 --- a/pkg/snclient/check_ntp_offset.go +++ b/pkg/snclient/check_ntp_offset.go @@ -35,15 +35,15 @@ func NewCheckNTPOffset() CheckHandler { func (l *CheckNTPOffset) Build() *CheckData { return &CheckData{ name: "check_ntp_offset", - description: "Checks the ntp offset.", + description: "Checks the NTP offset.", implemented: ALL, hasInventory: ListInventory, result: &CheckResult{ State: CheckExitOK, }, args: map[string]CheckArgument{ - "server": {value: &l.ntpserver, description: "Fetch offset from this ntp server(s). First valid response is used."}, - "source": {value: &l.source, isFilter: true, description: "Set source of time data instead of auto detect. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm."}, + "server": {value: &l.ntpserver, description: "Fetch offset from these NTP servers. First valid response is used."}, + "source": {value: &l.source, isFilter: true, description: "Set source of time data instead of automatic detection. Valid values are: auto, timedatectl, ntpq, chronyc, osx, w32tm."}, }, defaultFilter: "none", defaultWarning: "offset > 50 || offset < -50", @@ -53,12 +53,12 @@ func (l *CheckNTPOffset) Build() *CheckData { emptyState: CheckExitUnknown, emptySyntax: "%(status) - could not get any ntp data", attributes: []CheckAttribute{ - {name: "source", description: "source of the ntp metrics"}, - {name: "server", description: "ntp server name"}, - {name: "stratum", description: "stratum value (distance to root ntp server)"}, + {name: "source", description: "source of the NTP metrics"}, + {name: "server", description: "NTP server name"}, + {name: "stratum", description: "stratum value (distance to root NTP server)"}, {name: "jitter", description: "jitter of the clock in milliseconds"}, - {name: "offset", description: "time offset to ntp server in milliseconds. This will be added as a metric."}, - {name: "offset_seconds", description: "time offset to ntp server in seconds. This will not be added as a metric. " + + {name: "offset", description: "time offset to NTP server in milliseconds. This will be added as a metric."}, + {name: "offset_seconds", description: "time offset to NTP server in seconds. This will not be added as a metric. " + " Any thresholds using 'offset_seconds' will be converted to 'offset' silently.", unit: UDuration}, }, exampleDefault: ` diff --git a/pkg/snclient/check_omd.go b/pkg/snclient/check_omd.go index 107531fa5..793c15f3c 100644 --- a/pkg/snclient/check_omd.go +++ b/pkg/snclient/check_omd.go @@ -35,12 +35,12 @@ func NewCheckOMD() CheckHandler { func (l *CheckOMD) Build() *CheckData { return &CheckData{ name: "check_omd", - description: "Check omd site status.", + description: "Check OMD site status.", implemented: Linux, hasInventory: ListInventory, args: map[string]CheckArgument{ "site": {value: &l.siteFilter, isFilter: true, description: "Show this site only"}, - "exclude": {value: &l.serviceFilter, description: "Skip this omd service"}, + "exclude": {value: &l.serviceFilter, description: "Skip this OMD service"}, }, result: &CheckResult{ State: CheckExitOK, @@ -55,7 +55,7 @@ func (l *CheckOMD) Build() *CheckData { attributes: []CheckAttribute{ {name: "site", description: "OMD site name"}, {name: "autostart", description: "Configuration value of 'autostart': 0/1"}, - {name: "state", description: "Return code of omd status, 0 - running, 1 - partially running, 2 - stopped, 3 - unknown"}, + {name: "state", description: "Return code of OMD status, 0 - running, 1 - partially running, 2 - stopped, 3 - unknown"}, {name: "status", description: "Text status: (running, partially running, stopped, unknown)"}, {name: "failed_services", description: "List of failed services"}, {name: "failed_services_txt", description: "More usable form of failed services list"}, diff --git a/pkg/snclient/check_os_updates.go b/pkg/snclient/check_os_updates.go index 159043c36..0daa4c096 100644 --- a/pkg/snclient/check_os_updates.go +++ b/pkg/snclient/check_os_updates.go @@ -38,10 +38,10 @@ func (l *CheckOSUpdates) Build() *CheckData { result: &CheckResult{}, args: map[string]CheckArgument{ "-s|--system": {value: &l.system, description: "Package system: auto, apt, yum, osx and windows (default: auto)"}, - "-u|--update": {value: &l.update, description: "Update package list (if supported, ex.: apt-get update)"}, + "-u|--update": {value: &l.update, description: "Update package list (if supported, e.g. apt-get update)"}, "-m|--max-metadata-age": { value: &l.maxMetadataAge, - description: "Fail with UNKNOWN if the repository metadata (apt/yum/dnf) is older than this duration, ex.: 48h (default: 24h)", + description: "Fail with UNKNOWN if the repository metadata (apt/yum/dnf) is older than this duration, e.g. 48h (default: 24h)", }, }, defaultWarning: "count > 0", @@ -78,7 +78,7 @@ The DNF check returns **UNKNOWN** if an enabled repository is unavailable, becau otherwise an incomplete repository set could be reported as having no updates. Use **--max-metadata-age** to make the check return **UNKNOWN** if the repository -metadata has not been refreshed within the given duration, ex.: --max-metadata-age=24h +metadata has not been refreshed within the given duration, e.g. --max-metadata-age=24h `, exampleArgs: `warn='count > 0' crit='count_security > 0'`, } diff --git a/pkg/snclient/check_os_version.go b/pkg/snclient/check_os_version.go index 091b84a2a..fa755f8d7 100644 --- a/pkg/snclient/check_os_version.go +++ b/pkg/snclient/check_os_version.go @@ -34,10 +34,10 @@ func (l *CheckOSVersion) Build() *CheckData { {name: "platform", description: "Platform of the OS"}, {name: "family", description: "OS Family"}, {name: "version", description: "Full version number"}, - {name: "arch", description: "OS architecture (go arch, ex.: amd64)"}, + {name: "arch", description: "OS architecture (go arch, e.g. amd64)"}, {name: "os", description: "OS name"}, - {name: "hostname", description: "hostname (probably without fqdn)"}, - {name: "kernel_arch", description: "kernel architecture, ex.: x86_64"}, + {name: "hostname", description: "hostname (probably without FQDN)"}, + {name: "kernel_arch", description: "kernel architecture, e.g. x86_64"}, {name: "kernel_version", description: "kernel version"}, }, exampleDefault: ` diff --git a/pkg/snclient/check_pdh.go b/pkg/snclient/check_pdh.go index f5ad662e5..a802785ea 100644 --- a/pkg/snclient/check_pdh.go +++ b/pkg/snclient/check_pdh.go @@ -27,7 +27,7 @@ func (c *CheckPDH) Build() *CheckData { return &CheckData{ implemented: Windows, name: "check_pdh", - description: "Checks pdh paths and handles wildcard expansion.", + description: "Checks PDH paths and handles wildcard expansion.", detailSyntax: "%(name)", okSyntax: "%(status) - All %(count) counter values are ok", topSyntax: "%(status) - %(problem_count)/%(count) counter (%(count)) %(problem_list)", @@ -40,24 +40,23 @@ func (c *CheckPDH) Build() *CheckData { "expand-index": {value: &c.ExpandIndex, description: "Should indices be translated?"}, "instances": {value: &c.Instances, description: "Expand wildcards and fetch all instances"}, "type": {value: &c.Type, description: "This can be large or float depending on what you expect, default is large "}, - "english": {value: &c.EnglishFallBackNames, description: "Using english names regardless of system language (requires Windows Vista or higher)"}, + "english": {value: &c.EnglishFallBackNames, description: "Use English names regardless of system language (requires Windows Vista or higher)"}, }, result: &CheckResult{ State: CheckExitOK, }, attributes: []CheckAttribute{ - {name: "count ", description: "Number of items matching the filter. Common option for all checks."}, - {name: "value ", description: "The counter value (either float or int)"}, + {name: "count", description: "Number of items matching the filter. Common option for all checks."}, + {name: "value", description: "The counter value (either float or int)"}, }, extraFilterAttributes: []*regexp.Regexp{ regexp.MustCompile(`^name$`), }, exampleDefault: ` - check_pdh "counter=foo" "warn=value > 80" "crit=value > 90" - Everything looks good - 'foo value'=18;80;90 + check_pdh "counter=\System\System Up Time" "warn=value < 60" "crit=value < 30" english + OK - All 1 counter values are ok |'\System\System Up Time_value'=3600;60:;30:;0 `, - exampleArgs: `counter=\\System\\System Up Time" "warn=value > 5" "crit=value > 9999`, + exampleArgs: `'counter=\System\System Up Time' 'warn=value < 60' 'crit=value < 30' english`, argsPassthrough: true, } } diff --git a/pkg/snclient/check_ping.go b/pkg/snclient/check_ping.go index 7409101bd..fd864fa7e 100644 --- a/pkg/snclient/check_ping.go +++ b/pkg/snclient/check_ping.go @@ -33,14 +33,14 @@ func NewCheckPing() CheckHandler { func (l *CheckPing) Build() *CheckData { return &CheckData{ name: "check_ping", - description: "Checks the icmp ping connection.", + description: "Checks the ICMP ping connection.", implemented: ALL, hasInventory: NoInventory, result: &CheckResult{ State: CheckExitOK, }, args: map[string]CheckArgument{ - "host": {value: &l.hostname, description: "host name or ip address to ping"}, + "host": {value: &l.hostname, description: "host name or IP address to ping"}, "packets": {value: &l.packets, description: "number of ICMP ECHO packets to send (default: 5)"}, "-t": {value: &l.timeout, description: "timeout in seconds for each ICMP ECHO packet"}, "-4": {value: &l.ipv4, description: "Force using IPv4."}, @@ -65,7 +65,7 @@ func (l *CheckPing) Build() *CheckData { check_ping host=localhost OK - Packet loss = 0%, RTA = 0.113ms |... `, - exampleArgs: `'warn=rta > 1000 || pl > 30' 'crit=rta > 5000 || pl > 80'`, + exampleArgs: `'host=localhost' 'warn=rta > 1000 || pl > 30' 'crit=rta > 5000 || pl > 80'`, } } diff --git a/pkg/snclient/check_process.go b/pkg/snclient/check_process.go index f34ab4c64..08e438821 100644 --- a/pkg/snclient/check_process.go +++ b/pkg/snclient/check_process.go @@ -47,25 +47,25 @@ func (l *CheckProcess) Build() *CheckData { {name: "exe", description: "Name of the executable (without path)"}, {name: "filename", description: "Name of the executable with path"}, {name: "command_line", description: "Full command line of process"}, - {name: "state", description: "Current state (windows: started, stopped, hung - linux: idle, lock, running, sleep, stop, wait and zombie)"}, + {name: "state", description: "Current state (Windows: started, stopped, hung - Linux: idle, lock, running, sleep, stop, wait and zombie)"}, {name: "creation", description: "Start time of process", unit: UDate}, {name: "pid", description: "Process id"}, {name: "ppid", description: "Parent process id"}, - {name: "uid", description: "User id of process owner (linux only)"}, - {name: "username", description: "User name of process owner (linux only)"}, + {name: "uid", description: "User id of process owner (Linux only)"}, + {name: "username", description: "User name of process owner (Linux only)"}, {name: "cpu", description: "CPU usage in percent (over total lifetime of process)", unit: UPercent}, {name: "cpu_seconds", description: "CPU usage in seconds", unit: UDuration}, {name: "virtual", description: "Virtual memory usage in bytes", unit: UByte}, {name: "rss", description: "Resident memory usage in bytes", unit: UByte}, {name: "pagefile", description: "Swap memory usage in bytes", unit: UByte}, {name: "oldest", description: "Unix timestamp of oldest process", unit: UTimestamp}, - {name: "peak_pagefile", description: "Peak swap memory usage in bytes (windows only)", unit: UByte}, - {name: "handles", description: "Number of handles (windows only)"}, - {name: "kernel", description: "Kernel time in seconds (windows only)", unit: UDuration}, - {name: "peak_virtual", description: "Peak virtual size in bytes (windows only)", unit: UByte}, - {name: "peak_working_set", description: "Peak working set in bytes (windows only)", unit: UByte}, - {name: "user", description: "User time in seconds (windows only)", unit: UDuration}, - {name: "working_set", description: "Working set in bytes (windows only)", unit: UByte}, + {name: "peak_pagefile", description: "Peak swap memory usage in bytes (Windows only)", unit: UByte}, + {name: "handles", description: "Number of handles (Windows only)"}, + {name: "kernel", description: "Kernel time in seconds (Windows only)", unit: UDuration}, + {name: "peak_virtual", description: "Peak virtual size in bytes (Windows only)", unit: UByte}, + {name: "peak_working_set", description: "Peak working set in bytes (Windows only)", unit: UByte}, + {name: "user", description: "User time in seconds (Windows only)", unit: UDuration}, + {name: "working_set", description: "Working set in bytes (Windows only)", unit: UByte}, }, exampleDefault: ` check_process @@ -78,7 +78,7 @@ Check specific process(es) by name (adding some metrics as well) warn='count < 1 || count > 10' \ crit='count < 0 || count > 20' \ top-syntax='%{status} - %{count} processes, memory %{rss|h}B, cpu %{cpu:fmt=%.1f}%, started %{oldest:age|duration} ago' - WARNING - 12 processes, memory 62.58 MB, started 01:11h ago |... + WARNING - 12 processes, memory 62.58 MB, cpu 0.7%, started 01:11h ago |... If zero is a valid threshold, set thresholds accordingly diff --git a/pkg/snclient/check_service_linux.go b/pkg/snclient/check_service_linux.go index 7d448e40a..676cc13d3 100644 --- a/pkg/snclient/check_service_linux.go +++ b/pkg/snclient/check_service_linux.go @@ -45,9 +45,9 @@ func (l *CheckService) Build() *CheckData { return &CheckData{ name: "check_service", - description: `Checks the state of one or multiple linux (systemctl) services. + description: `Checks the state of one or multiple Linux (systemctl) services. -There is a specific [check_service for windows](../check_service_windows) as well.`, +There is a specific [check_service for Windows](../check_service_windows) as well.`, implemented: Linux, docTitle: "service (linux)", hasInventory: ListInventory, @@ -81,11 +81,11 @@ There is a specific [check_service for windows](../check_service_windows) as wel {name: "desc", description: "Description of the service"}, {name: "active", description: "The active attribute of a service, one of: active, inactive or failed"}, {name: "state", description: "The state of the service, one of: stopped, starting, oneshot, running, static or unknown"}, - {name: "pid", description: "The pid of the service"}, + {name: "pid", description: "The PID of the service"}, {name: "created", description: "Date when service was started", unit: UDate}, {name: "age", description: "Seconds since service was started", unit: UDuration}, - {name: "rss", description: "Memory rss in bytes (main process)", unit: UByte}, - {name: "vms", description: "Memory vms in bytes (main process)", unit: UByte}, + {name: "rss", description: "Memory RSS in bytes (main process)", unit: UByte}, + {name: "vms", description: "Memory VMS in bytes (main process)", unit: UByte}, {name: "cpu", description: "CPU usage in percent (main process)", unit: UPercent}, {name: "preset", description: "The preset attribute of the service, one of: enabled or disabled"}, {name: "tasks", description: "Number of tasks for this service"}, @@ -99,11 +99,11 @@ Checking all services except some excluded ones: Or check a specific service and get some metrics: check_service service=docker ok-syntax='${top-syntax}' top-syntax='%(status) - %(list)' detail-syntax='%(name) %(state) - memory: %(rss:h)B - age: %(age:duration)' - OK - docker running - memory: 805.2MB - created: Fri 2023-11-17 20:34:01 CET |'docker'=4 'docker rss'=805200000B + OK - docker running - memory: 805.2MB - age: 01:11h |'docker'=4 'docker rss'=805200000B Check memory usage of specific service: - check_service service=docker warn='rss > 1GB' warn='rss > 2GB' + check_service service=docker warn='rss > 1GB' crit='rss > 2GB' OK - All 1 service(s) are ok. |'docker'=4 'docker rss'=59691008B;;;0 'docker vms'=3166244864B;;;0 'docker cpu'=0.7%;;;0 'docker tasks'=20;;;0 `, exampleArgs: "service=docker", diff --git a/pkg/snclient/check_service_windows.go b/pkg/snclient/check_service_windows.go index 642a6d9f9..e25c88c9b 100644 --- a/pkg/snclient/check_service_windows.go +++ b/pkg/snclient/check_service_windows.go @@ -40,9 +40,9 @@ func NewCheckService() CheckHandler { func (l *CheckService) Build() *CheckData { return &CheckData{ name: "check_service", - description: `Checks the state of one or multiple windows services. + description: `Checks the state of one or multiple Windows services. -There is a specific [check_service for linux](../check_service_linux) as well.`, +There is a specific [check_service for Linux](../check_service_linux) as well.`, implemented: Windows, docTitle: "service (windows)", hasInventory: ListInventory, @@ -85,11 +85,11 @@ There is a specific [check_service for linux](../check_service_linux) as well.`, {name: "desc", description: "Alias for display (not a typo). When used as filter, looks only in display."}, {name: "description", description: "Description of the service"}, {name: "state", description: "The state of the service, one of: stopped, starting, stopping, running, continuing, pausing, paused or unknown"}, - {name: "pid", description: "The pid of the service"}, + {name: "pid", description: "The PID of the service"}, {name: "created", description: "Date when service was started", unit: UDate}, {name: "age", description: "Seconds since service was started", unit: UDuration}, - {name: "rss", description: "Memory rss in bytes", unit: UByte}, - {name: "vms", description: "Memory vms in bytes", unit: UByte}, + {name: "rss", description: "Memory RSS in bytes", unit: UByte}, + {name: "vms", description: "Memory VMS in bytes", unit: UByte}, {name: "cpu", description: "CPU usage in percent", unit: UPercent}, {name: "delayed", description: "If the service is delayed, can be 0 or 1 "}, {name: "classification", description: "Classification of the service, one of: " + diff --git a/pkg/snclient/check_snclient.go b/pkg/snclient/check_snclient.go index 21124d4b8..ad9db4560 100644 --- a/pkg/snclient/check_snclient.go +++ b/pkg/snclient/check_snclient.go @@ -15,7 +15,7 @@ func init() { func NewCheckSNClient() CheckHandler { return &CheckBuiltin{ name: "check_snclient", - description: `Runs check_snclient (formerly check_nsc_web) to perform checks on other snclient agents. + description: `Runs check_snclient (formerly check_nsc_web) to perform checks on other SNClient agents. It basically wraps the plugin from https://github.com/ConSol-Monitoring/check_snclient`, check: checkSNClientWrapper, docTitle: `check_snclient`, @@ -29,7 +29,7 @@ Check specific plugin: check_snclient -p ... -u https://localhost:8443 -c check_process process=snclient.exe OK - all 1 processes are ok. | ... `, - exampleArgs: `'-H' 'omd.consol.de' '--uri=/docs' '-S'`, + exampleArgs: `'-p' 'PASSWORD' '-u' 'https://localhost:8443' '-c' 'check_process' 'process=snclient.exe'`, } } diff --git a/pkg/snclient/check_snclient_version.go b/pkg/snclient/check_snclient_version.go index 8700f2916..2b5481f0e 100644 --- a/pkg/snclient/check_snclient_version.go +++ b/pkg/snclient/check_snclient_version.go @@ -21,7 +21,7 @@ func NewCheckSNClientVersion() CheckHandler { func (l *CheckSNClientVersion) Build() *CheckData { return &CheckData{ name: "check_snclient_version", - description: "Check and return snclient version.", + description: "Check and return SNClient version.", implemented: ALL, result: &CheckResult{ State: CheckExitOK, diff --git a/pkg/snclient/check_ssh.go b/pkg/snclient/check_ssh.go index 2a7dd01a8..6fabcae63 100644 --- a/pkg/snclient/check_ssh.go +++ b/pkg/snclient/check_ssh.go @@ -17,17 +17,17 @@ func init() { func NewCheckSSH() CheckHandler { return &CheckBuiltin{ name: "check_ssh", - description: `Runs check_tcp with an SSH configururation to check for a running SSH server. + description: `Runs check_tcp with an SSH configuration to check for a running SSH server. It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tree/master/check-tcp`, check: checkSSH, docTitle: `check_ssh`, usage: `check_ssh []`, exampleDefault: ` - check_ssh github.com -SSH OK - 0.234 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.234029s;;;0.000000;10.000000 + check_ssh github.com + SSH OK - 0.234 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.234029s;;;0.000000;10.000000 - check_ssh --hostname github.com --warning 1 -SSH OK - 0.262 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.262048s;;;1.000000;10.000000 + check_ssh --hostname github.com --warning 1 + SSH OK - 0.262 seconds response time on github.com port 22 [SSH-2.0-8ad108e] | time=0.262048s;;;1.000000;10.000000 `, exampleArgs: `'-H' '192.168.178.100' '-p' '2323'`, } diff --git a/pkg/snclient/check_swap_io.go b/pkg/snclient/check_swap_io.go index 694442d20..8325f912f 100644 --- a/pkg/snclient/check_swap_io.go +++ b/pkg/snclient/check_swap_io.go @@ -34,7 +34,7 @@ func NewCheckSwapIO() CheckHandler { func (l *CheckSwapIO) Build() *CheckData { return &CheckData{ name: "check_swap_io", - description: `Checks the swap Input / Output rate on the host.`, + description: `Checks the swap I/O rate on the host.`, implemented: Linux | FreeBSD | Darwin, hasInventory: ListInventory, result: &CheckResult{ @@ -50,10 +50,10 @@ func (l *CheckSwapIO) Build() *CheckData { topSyntax: "%(status) - %(list)", attributes: []CheckAttribute{ {name: "swap_count", description: "Count of swap partitions"}, - {name: "swap_in_rate_bytes", description: "Swap/Pages being brought in", unit: UByte}, - {name: "swap_in_rate", description: "Swap/Pages being sent out", unit: UByte}, - {name: "swap_out_rate_bytes", description: "Swap/Pages being brought in", unit: UByte}, - {name: "swap_out_rate", description: "Swap/Pages being sent out", unit: UByte}, + {name: "swap_in_rate_bytes", description: "Bytes swapped in per second", unit: UByte}, + {name: "swap_in_rate", description: "Bytes swapped in per second in human-readable format", unit: UByte}, + {name: "swap_out_rate_bytes", description: "Bytes swapped out per second", unit: UByte}, + {name: "swap_out_rate", description: "Bytes swapped out per second in human-readable format", unit: UByte}, }, exampleDefault: ` check_swap_io diff --git a/pkg/snclient/check_tasksched.go b/pkg/snclient/check_tasksched.go index d4f3dff1c..131f57a97 100644 --- a/pkg/snclient/check_tasksched.go +++ b/pkg/snclient/check_tasksched.go @@ -74,8 +74,8 @@ func (l *CheckTasksched) Build() *CheckData { {name: "comment", description: "Comment or description for the work item"}, {name: "creator", description: "Creator of the work item"}, {name: "enabled", description: "Flag whether this job is enabled (true/false)", unit: UBool}, - {name: "exit_code", description: "The last jobs exit code"}, - {name: "exit_string", description: "The last jobs exit code as string"}, + {name: "exit_code", description: "The last job's exit code"}, + {name: "exit_string", description: "The last job's exit code as string"}, {name: "folder", description: "Task folder"}, {name: "uri", description: "Fully qualified path to the task, includes folder and the task title"}, {name: "uri_clean", description: "Remove the leading backslash from the URI, only for tasks directly saved at root and not for ones saved inside folders."}, @@ -88,9 +88,9 @@ func (l *CheckTasksched) Build() *CheckData { {name: "missed_runs", description: "Number of times the registered task has missed a scheduled run"}, {name: "task_status", description: "Task status as string"}, {name: "next_run_time", description: "Time when the registered task is next scheduled to run", unit: UDate}, - {name: "parameters", description: "Last actions command line parameters"}, - {name: "execute", description: "Last actions executed program"}, - {name: "working_directory", description: "Last actions working directory"}, + {name: "parameters", description: "Last action's command line parameters"}, + {name: "execute", description: "Last action's executed program"}, + {name: "working_directory", description: "Last action's working directory"}, }, exampleDefault: ` check_tasksched diff --git a/pkg/snclient/check_tcp.go b/pkg/snclient/check_tcp.go index 61a72883d..680432974 100644 --- a/pkg/snclient/check_tcp.go +++ b/pkg/snclient/check_tcp.go @@ -9,26 +9,21 @@ func init() { func NewCheckTCP() CheckHandler { return &CheckBuiltin{ name: "check_tcp", - description: `Runs check_tcp to perform tcp connection checks. + description: `Runs check_tcp to perform TCP connection checks. It basically wraps the plugin from https://github.com/taku-k/go-check-plugins/tree/master/check-tcp`, check: check_tcp.Check, docTitle: `check_tcp`, usage: `check_tcp []`, exampleDefault: ` -Alert if tcp connection fails: +Alert if TCP connection fails: check_tcp -H omd.consol.de -p 80 TCP OK - 0.003 seconds response time on omd.consol.de port 80 Send something and expect specific string: - check_tcp -H outlook.com -p 25 -s "HELO" -e "Microsoft ESMTP MAIL Service ready" -q "QUIT + check_tcp -H outlook.com -p 25 -s "HELO" -e "Microsoft ESMTP MAIL Service ready" -q "QUIT" TCP OK - 0.197 seconds response time on outlook.com port 25 - -It can be a bit tricky to set the -u/--uri on windows, since the / is considered as start of -a command line parameter. - -To avoid this issue, simply use the long form --uri=/path.. so the parameter does not start with a slash. `, exampleArgs: `'-H' 'omd.consol.de' '-p' '80'`, } diff --git a/pkg/snclient/check_temperature.go b/pkg/snclient/check_temperature.go index 5dec728dd..eb03c6726 100644 --- a/pkg/snclient/check_temperature.go +++ b/pkg/snclient/check_temperature.go @@ -50,9 +50,9 @@ func (l *CheckTemperature) Build() *CheckData { emptyState: 3, emptySyntax: "check_temperature failed to find any sensors.", attributes: []CheckAttribute{ - {name: "sensor", description: "full name of this sensor, ex.: coretemp_core_0"}, - {name: "name", description: "name of this sensor, ex.: coretemp"}, - {name: "label", description: "label for this sensor, ex.: core 0"}, + {name: "sensor", description: "full name of this sensor, e.g. coretemp_core_0"}, + {name: "name", description: "name of this sensor, e.g. coretemp"}, + {name: "label", description: "label for this sensor, e.g. core 0"}, {name: "temperature", description: "current temperature"}, {name: "crit", description: "critical value supplied from sensor"}, {name: "max", description: "max value supplied from sensor"}, diff --git a/pkg/snclient/check_wmi.go b/pkg/snclient/check_wmi.go index aebc4e496..e3d4a0ea1 100644 --- a/pkg/snclient/check_wmi.go +++ b/pkg/snclient/check_wmi.go @@ -30,7 +30,7 @@ func NewCheckWMI() CheckHandler { func (l *CheckWMI) Build() *CheckData { return &CheckData{ name: "check_wmi", - description: `Check status and metrics by running wmi queries. + description: `Check status and metrics by running WMI queries. In order to use this plugin, you need to enable 'CheckWMI' in the '[/modules]' section of the snclient_local.ini. `, diff --git a/pkg/snclient/checkdata.go b/pkg/snclient/checkdata.go index 06edd09ef..e4589277b 100644 --- a/pkg/snclient/checkdata.go +++ b/pkg/snclient/checkdata.go @@ -1683,6 +1683,9 @@ func (cd *CheckData) Help(format ShowHelp) string { out += cd.helpDefaultArguments(format) out += cd.helpSpecificArguments(format) out += cd.helpAttributes(format) + if format == Markdown { + out += cd.helpExamplesMarkdown() + } out = strings.TrimSpace(out) @@ -1714,14 +1717,13 @@ func (cd *CheckData) helpHeader(format ShowHelp, usageHeader bool) string { func (cd *CheckData) helpHeaderMarkdown(format ShowHelp, usageHeader bool) string { out := "" - title := strings.TrimPrefix(cd.name, "check_") + title := cd.name if cd.docTitle != "" { title = cd.docTitle } + title = "check_" + strings.TrimPrefix(title, "check_") out += fmt.Sprintf("---\ntitle: %s\n---\n\n", strings.TrimSpace(title)) - out += fmt.Sprintf("## %s\n\n", cd.name) out += fmt.Sprintf("%s\n\n", cd.description) - out += "- [Examples](#examples)\n" if usageHeader { out += "- [Usage](#usage)\n" } @@ -1731,13 +1733,18 @@ func (cd *CheckData) helpHeaderMarkdown(format ShowHelp, usageHeader bool) strin if len(cd.attributes) > 0 { out += "- [Attributes](#attributes)\n" } + out += "- [Examples](#examples)\n" out += "\n" if cd.implemented > 0 { out += cd.helpImplemented(format) } - out += "## Examples\n\n" + return out +} + +func (cd *CheckData) helpExamplesMarkdown() string { + out := "## Examples\n\n" if cd.exampleDefault != "" { out += "### Default Check\n\n" out += fmt.Sprintf("%s\n\n", cd.exampleDefault) From 97fcfa65d85eb5dba588389b3b3e9d2d165eeb82 Mon Sep 17 00:00:00 2001 From: lorenzg Date: Fri, 16 Oct 2026 14:53:15 +0200 Subject: [PATCH 2/3] revert example change --- docs/checks/commands/check_drivesize.md | 4 ++-- pkg/snclient/check_drivesize_other.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/checks/commands/check_drivesize.md b/docs/checks/commands/check_drivesize.md index 44e446048..b42d8c7d1 100644 --- a/docs/checks/commands/check_drivesize.md +++ b/docs/checks/commands/check_drivesize.md @@ -95,7 +95,7 @@ these can be used in filters and thresholds (along with the default attributes): ### Default Check check_drivesize drive=/ show-all - OK - / 280.155 GiB/455.948 GiB (61.4%) |... + OK - / 280.155 GiB/455.948 GiB (64.7%) |... Check drive including inodes: @@ -105,7 +105,7 @@ Check drive including inodes: Check folder, no matter if it's a mount point itself or not: check_drivesize folder=/tmp show-all - OK - /tmp 280.155 GiB/455.948 GiB (61.4%) |... + OK - /tmp 280.155 GiB/455.948 GiB (64.7%) |... This check supports specifying different usage thresholds for each drive. Use '[drive] used_pct' or '[drive] used %' in the condition: check_drivesize "drive=/" "drive=/tmp" "warn='/ used_pct' gt 70" "crit='/tmp used %' > 1" diff --git a/pkg/snclient/check_drivesize_other.go b/pkg/snclient/check_drivesize_other.go index b12a84329..5c4aa02a5 100644 --- a/pkg/snclient/check_drivesize_other.go +++ b/pkg/snclient/check_drivesize_other.go @@ -21,7 +21,7 @@ func (l *CheckDrivesize) getDefaultFilter() string { func (l *CheckDrivesize) getExample() string { return ` check_drivesize drive=/ show-all - OK - / 280.155 GiB/455.948 GiB (61.4%) |... + OK - / 280.155 GiB/455.948 GiB (64.7%) |... Check drive including inodes: @@ -31,7 +31,7 @@ Check drive including inodes: Check folder, no matter if it's a mount point itself or not: check_drivesize folder=/tmp show-all - OK - /tmp 280.155 GiB/455.948 GiB (61.4%) |... + OK - /tmp 280.155 GiB/455.948 GiB (64.7%) |... This check supports specifying different usage thresholds for each drive. Use '[drive] used_pct' or '[drive] used %' in the condition: check_drivesize "drive=/" "drive=/tmp" "warn='/ used_pct' gt 70" "crit='/tmp used %' > 1" From 702d56b8d13fc02cad0cc601fa8380677cb91156 Mon Sep 17 00:00:00 2001 From: lorenzg Date: Fri, 16 Oct 2026 15:13:51 +0200 Subject: [PATCH 3/3] fix docs --- docs/checks/commands/check_drive_io.md | 9 +++++---- docs/checks/commands/check_logfile.md | 8 ++++---- docs/checks/commands/check_memory.md | 2 +- pkg/snclient/check_drive_io.go | 9 +++++---- pkg/snclient/check_logfile.go | 8 ++++---- pkg/snclient/check_memory.go | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/docs/checks/commands/check_drive_io.md b/docs/checks/commands/check_drive_io.md index 107da9dd1..ef7049e3c 100644 --- a/docs/checks/commands/check_drive_io.md +++ b/docs/checks/commands/check_drive_io.md @@ -71,12 +71,13 @@ these can be used in filters and thresholds (along with the default attributes): ### Default Check check_drive_io - OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; + OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C +_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; -Check a UNIX drive and alert if the average write rate over the last 30 seconds exceeds 10 MB/s. Here, dm-0 is the encrypted volume; it could be nvme0n1 or sdb instead. +Check a UNIX drive and alert if for the last 30 seconds written bytes/second is above 10 Mb/s . Dm-0 is the name of the encrypted volume, it could be nvme0n1 or sdb as well - check_drive_io drive=dm-0 lookback=30 warn="write_bytes_rate > 10MB" - OK - dm-0 >1.8 MiB/s <815.0 B/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; + check_drive_io lookback=30 warn="write_bytes_rate > 10Mb" + OK - dm-0 >1.8 MiB/s/s <815.0 B/s/s 0.0%, sda1 >0 B/s/s <0 B/s/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; 'sda1_read_count'=3178c;;;0; 'sda1_read_bytes'=67430400c;;;0; 'sda1_read_time'=13572ms;;;0; 'sda1_write_count'=3193c;;;0; 'sda1_write_bytes'=282012672c;;;0; 'sda1_write_time'=9446ms;;;0; 'sda1_utilization'=0%;95;;0; 'sda1_io_time'=10832ms;;;0; 'sda1_weighted_io'=23019;;;0; 'sda1_iops_in_progress'=0;;;0; ### Example using NRPE and Naemon diff --git a/docs/checks/commands/check_logfile.md b/docs/checks/commands/check_logfile.md index e8be72eeb..e85463187 100644 --- a/docs/checks/commands/check_logfile.md +++ b/docs/checks/commands/check_logfile.md @@ -70,12 +70,12 @@ these can be used in filters and thresholds (along with the default attributes): Alert if there are errors in the SNClient log file: - check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' + check_logfile files=/var/log/snclient/snclient.log "warn=line like 'Warn'" "crit=line like 'Error'" OK - 134 line(s) found Non-OK output example - check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' - CRITICAL - 23/548 line(s) found + check_logfile files=/var/log/snclient/snclient.log "warn=line like 'Warn'" "crit=line like 'Error'" + CRITICAL - 23/548 line(s) found ### Example using NRPE and Naemon @@ -90,5 +90,5 @@ Naemon Config host_name testhost service_description check_logfile use generic-service - check_command check_nrpe!check_logfile!'files=/var/log/snclient/snclient.log' 'warn=line like Warn' + check_command check_nrpe!check_logfile!'files=/var/log/snclient/snclient.log' "warn=line like 'Warn'" "crit=line like 'Error'" } diff --git a/docs/checks/commands/check_memory.md b/docs/checks/commands/check_memory.md index 895ea3060..06b9572d5 100644 --- a/docs/checks/commands/check_memory.md +++ b/docs/checks/commands/check_memory.md @@ -75,7 +75,7 @@ these can be used in filters and thresholds (along with the default attributes): Changing the return syntax to get more information: check_memory 'top-syntax=${list}' 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}' - physical free: 24.08 GiB used: 7.01 GiB size: 31.09 GiB, committed free: 271.43 MiB used: 705.57 MiB size: 977.00 MiB |... + physical free: 35.00 B used: 7.01 GiB size: 31.09 GiB, committed free: 27.00 B used: 705.57 MiB size: 977.00 MiB |... ### Example using NRPE and Naemon diff --git a/pkg/snclient/check_drive_io.go b/pkg/snclient/check_drive_io.go index 2a2c4451f..bec554ddb 100644 --- a/pkg/snclient/check_drive_io.go +++ b/pkg/snclient/check_drive_io.go @@ -106,12 +106,13 @@ func (l *CheckDriveIO) Build() *CheckData { //nolint:lll // the output is long exampleDefault: ` check_drive_io - OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; + OK - C >20.1 MiB/s <1.4 GiB/s 41.2% |'C_read_count'=4791920c;;;0; 'C_read_bytes'=1729039767552c;;;0; 'C_read_time'=119710.31709ms;;;0; 'C_write_count'=2260624c;;;0; 'C_write_bytes'=479384686592c;;;0; 'C_write_time'=89071.67515ms;;;0; 'C +_utilization'=41.2%;95;;0; 'C_queue_depth'=0;;;0; -Check a UNIX drive and alert if the average write rate over the last 30 seconds exceeds 10 MB/s. Here, dm-0 is the encrypted volume; it could be nvme0n1 or sdb instead. +Check a UNIX drive and alert if for the last 30 seconds written bytes/second is above 10 Mb/s . Dm-0 is the name of the encrypted volume, it could be nvme0n1 or sdb as well - check_drive_io drive=dm-0 lookback=30 warn="write_bytes_rate > 10MB" - OK - dm-0 >1.8 MiB/s <815.0 B/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; + check_drive_io lookback=30 warn="write_bytes_rate > 10Mb" + OK - dm-0 >1.8 MiB/s/s <815.0 B/s/s 0.0%, sda1 >0 B/s/s <0 B/s/s 0.0% |'dm-0_read_count'=396738362c;;;0; 'dm-0_read_bytes'=33871348975616c;;;0; 'dm-0_read_time'=2990729692ms;;;0; 'dm-0_write_count'=624158141c;;;0; 'dm-0_write_bytes'=36083702012416c;;;0; 'dm-0_write_time'=1412729952ms;;;0; 'dm-0_utilization'=0%;95;;0; 'dm-0_io_time'=738627512ms;;;0; 'dm-0_weighted_io'=108492348;;;0; 'dm-0_iops_in_progress'=0;;;0; 'sda1_read_count'=3178c;;;0; 'sda1_read_bytes'=67430400c;;;0; 'sda1_read_time'=13572ms;;;0; 'sda1_write_count'=3193c;;;0; 'sda1_write_bytes'=282012672c;;;0; 'sda1_write_time'=9446ms;;;0; 'sda1_utilization'=0%;95;;0; 'sda1_io_time'=10832ms;;;0; 'sda1_weighted_io'=23019;;;0; 'sda1_iops_in_progress'=0;;;0; `, exampleArgs: "", } diff --git a/pkg/snclient/check_logfile.go b/pkg/snclient/check_logfile.go index 418d75173..e75cb4740 100644 --- a/pkg/snclient/check_logfile.go +++ b/pkg/snclient/check_logfile.go @@ -107,14 +107,14 @@ func (c *CheckLogFile) Build() *CheckData { exampleDefault: ` Alert if there are errors in the SNClient log file: - check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' + check_logfile files=/var/log/snclient/snclient.log "warn=line like 'Warn'" "crit=line like 'Error'" OK - 134 line(s) found Non-OK output example - check_logfile files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error' - CRITICAL - 23/548 line(s) found + check_logfile files=/var/log/snclient/snclient.log "warn=line like 'Warn'" "crit=line like 'Error'" + CRITICAL - 23/548 line(s) found `, - exampleArgs: `'files=/var/log/snclient/snclient.log' 'warn=line like Warn'`, + exampleArgs: `'files=/var/log/snclient/snclient.log' "warn=line like 'Warn'" "crit=line like 'Error'"`, } } diff --git a/pkg/snclient/check_memory.go b/pkg/snclient/check_memory.go index 1e9322ab6..01bd9d1bd 100644 --- a/pkg/snclient/check_memory.go +++ b/pkg/snclient/check_memory.go @@ -90,7 +90,7 @@ read more on Windows virtual address space: Changing the return syntax to get more information: check_memory 'top-syntax=${list}' 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}' - physical free: 24.08 GiB used: 7.01 GiB size: 31.09 GiB, committed free: 271.43 MiB used: 705.57 MiB size: 977.00 MiB |... + physical free: 35.00 B used: 7.01 GiB size: 31.09 GiB, committed free: 27.00 B used: 705.57 MiB size: 977.00 MiB |... `, exampleArgs: `'warn=used > 80%' 'crit=used > 90%'`, }