SteScho / manubulon-snmp

Set of Icinga/Nagios plugins to check hosts and hardware with the SNMP protocol.
GNU General Public License v2.0
73 stars 71 forks source link

Better support for buffered/cached memory in Linux #49

Closed jimbobmcgee closed 6 years ago

jimbobmcgee commented 6 years ago

Exclude buffered memory from perfdata output, if -b option is specified

Status output show RAM usage as percentage, while perfdata output shows total literal ram usage. If -N -m options are given, cached memory is included in both the plugin status output and the perfdata. If -N -b options are given, buffered memory is excluded from the status output, but remains included in the perfdata.

This patch alters the behaviour of the -N -b option combination so that, if supplied, buffered memory is also excluded from the perfdata.

Add separate perfdata counters for cached and buffered memory, if -ff options is specified

Changed Getopt behaviour for -f so it can be specified more than once. If it is specified twice, perfdata is extended to include buffered and cached memory readings as separate perfdata values, e.g. ram_used=12345 buffered=1234 cached=1234. If using -ff, neither buffered nor cached memory are included in the perfdata value for RAM used.

jimbobmcgee commented 6 years ago

This is a resubmit of #46, so I can keep changes to individual files separate. This allows me to submit #50 separately, without a dependency on #49.