User Tools

Site Tools


Sidebar


Tags Cloud
la_checker

This is an old revision of the document!


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

#!/usr/bin/perl

use strict;

my $email = 'support@support.com';

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.1387127401.txt.gz · Last modified: 2013/12/15 17:10 by kyxap