in reply to Perl Server Load Check?
Sounds like a job for GTop.pm, which is a Perl interface to libgtop. I haven't used it myself, but it looks like you can write something to this effect:
#!/usr/bin/perl -w use strict; use GTop (); my $gtop = GTop->new; my $mem = $gtop->mem; my $total = $mem->total; my $free = $mem->free; if ($free / $total > .5) # Or whatever { # If there's enough free memory, execute your # code, etc. }
-Matt
|
|---|