we would like to monitor the RAM on our Linux machines. For this you can copy the plugin check_mem.pl into the plugin directory. So far that’s fine and the output on the CLI works:
OK - 79.2% (6423364 kB) free-percentage.|TOTAL=8113196KB;;;; USED=1689832KB;7301877;7707537;; FREE=6423364KB;;;; CACHES=1292292KB;;;;
But how do we get an output in the director? The following forum article doesn’t really get us there: Memory check "check_mem" not working - #26 by unic
Is there a guide on how to correctly create such commands in the director in order to get an output? I can’t really find leather and I’m going in circles.
Ok, and how can i create a check? I’m not find a sulition for this.
check_mem.pl v1.0 - Nagios Plugin usage: check_mem.pl - -w -c options: -a Check AVAILABLE memory -f Check FREE memory -u Check USED memory -C Count OS caches as FREE memory -w PERCENTAGE Percent free/used/available when to warn -w SIZE K/M/G Absolute size free/used/available when to warn -c PERCENTAGE Percent free/used/available when critical -c SIZE K/M/G Absolute size free/used/available when critical -v Show verbose output example: check_mem.pl -C -f -w 20 -c .5 Returns 1 if less than 20% free memory. Returns 2 if less than 0.5% free memory. Takes caches into account. check_mem.pl -u -w 80 -c 95 Returns 1 if more than 80% memory in use. Returns 2 if more than 95% memory in use. check_mem.pl -C -f -w 2G -c 500M Returns 1 if less than 2G free memory. Returns 2 if less than 500M free memory. Takes caches into account. Copyright (C) 2000 Dan Larsson
added the fields mem_critical, mem_free and mem_warning to the service check
created the check_mem.pl on the host and given all rights with chmod a+x
Check command assigned to the service set
Roll out
My question is, how do the fields have to be filled correctly. Or what is still missing to get this output: “*** You must select to monitor USED, FREE or AVAILABLE memory! check_mem.pl v1.0 - Nagios Plugin usage: check_mem.pl - -w -c options: -a Check AVAILABLE memory -f Check FREE memory -u Check USED memory -C Count OS caches as FREE memory -w PERCENTAGE Percent free/used/available when to warn -w SIZE K/M/G Absolute size free/used/available when to warn -c PERCENTAGE Percent free/used/available when critical -c SIZE K/M/G Absolute size free/used/available when critical -v Show verbose output example: check_mem.pl -C -f -w 20 -c .5 Returns 1 if less than 20% free memory. Returns 2 if less than 0.5% free memory. Takes caches into account. check_mem.pl -u -w 80 -c 95 Returns 1 if more than 80% memory in use. Returns 2 if more than 95% memory in use. check_mem.pl -C -f -w 2G -c 500M Returns 1 if less than 2G free memory. Returns 2 if less than 500M free memory. Takes caches into account. Copyright (C) 2000 Dan Larsson”
It is clear that something is still missing. Only what, how and where is totally unclear. Unfortunately there are no instructions or a useful template to create this important Chek in Icinga2 via the director. I can’t imagine I’m the only one frustrated by this. And the other question I ask myself, why isn’t such an important check properly integrated in the Icinga from the ground up and only possible in a roundabout way? It also works with Windows machines. I don’t understand.