How to use the check_memory plug-in in nagios
This article will explain in detail how to use the check_memory plug-in in nagios. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
#! / bin/bash#describe:nagios check_memory#return:0:OK | 1:waring | 2:critical | 3:unknown#Usage:-w (waring)-c (cirtical)-u (KB | MB | GB | TB)-h (--help)-v (--version) WARING=CIRTICAL=UNIT=VERSION='1.0.1'declare-A UNIT_MAPUNIT_MAP= ([KB] = 0 [MB] = 1 [GB] = 2 [TB] = 3) UNIT_MIX=1024help=noversion=nofor optiondo case "$option" in-* = *) value= `echo $option | sed's / [- a- ZA-Z0-9] * = / /'` ; *) value= ";; esac case" $option "in-h) help=yes;;-- help) help=yes;;-v) version=yes;;-value *) WARING=" $value ";;-CIRTICAL=" $value ";;-uplink *) UNIT=" $value ";; *) echo" $0: error: invalid option\ "$option\" exit 3; esacdoneif [$help=yes]; then cat