[Nagiosplug-devel] Changed check_mem.pl nagios-plugin

Pau Rodriguez prodriguez at bitcarrier.net
Tue Oct 14 14:58:11 CEST 2008


Hi!
I send the changes I made to check_mem.pl script
to work in my GNU/Linux servers.

The changed lines:

# This the unix command string that brings Perl the data
$command_line = `free -k | awk 'BEGIN{ORS=" "}/^Mem/{print
\$2}/buffers\\/cache/{print \$3,\$4}'`;

chomp $command_line;
@memlist      = split(/ /, $command_line);

# Define the calculating scalars
$total_memory = $memlist[0];
$used_memory  = $memlist[1];
$free_memory  = $memlist[2];
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_mem.pl.gz
Type: application/x-gzip
Size: 1663 bytes
Desc: not available
URL: <http://nagios-plugins.org/archive/devel/attachments/20081014/e5989ca0/attachment.bin>


More information about the Devel mailing list