User Tools

Site Tools


Sidebar


Tags Cloud
la_checker

Скрипт проверки уровня LA

#!/usr/bin/perl

use strict;

my $email = '[email protected]';

open my $PROC, "/proc/loadavg" or die $!;

while (<$PROC>) {
    /(^\d{0,3}).\d{0,}\s(.*)/;
    my $la = $1;
    if($la gt 10) {
        system("top -b -n 2 | /usr/sbin/sendmail -sVPS_LA $email");
    }
}

close $PROC or die $!;
la_checker.txt · Last modified: 2015/03/18 14:07 by kyxap