Re: мониторинг
-=HaRius=-
rh at nobrend.ru
Mon Mar 30 23:04:40 MSD 2009
cacti - отмониторит все =)
#!/usr/bin/perl
use LWP::UserAgent;
my $URL = "http://" . $ARGV[0] . "/nginx_status";
my $ua = LWP::UserAgent->new(timeout => 30);
my $response = $ua->request(HTTP::Request->new('GET', $URL));
my $active = 0;
my $requests = 0;
my $reading = 0;
my $writing = 0;
my $waiting = 0;
my $accepts = 0;
my $handled = 0;
foreach (split(/\n/, $response->content)) {
$active = $1 if (/^Active connections:\s+(\d+)/);
if (/^Reading:\s+(\d+).*Writing:\s+(\d+).*Waiting:\s+(\d+)/) {
$reading = $1;
$writing = $2;
$waiting = $3;
}
if (/^\s+(\d+)\s+(\d+)\s+(\d+)/){
$accepts = $1;
$handled = $2;
$requests = $3;
}
}
print("active:".$active." reading:".$reading." writing:".$writing."
waiting:".$waiting." accepts:".$accepts." handled:".$handled."
requests:".$requests);
29 марта 2009 г. 20:37 пользователь Galina Fitness Club <kisulja2000 at mail.ru
> написал:
> Игорь,
>
> Хотелось бы узнать есть или планируется когда-нибудь создавать тул для
> мониторинга
> nginx?
>
> С уважением,
> Сергей Мелехов
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20090330/e263fa7d/attachment.html>
More information about the nginx-ru
mailing list