|
|
|
|
АРХИВ :: nginx-ru
|
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: мониторинг
cacti - отмониторит все =)
#!/usr/bin/perl use LWP::UserAgent;
my $URL = "" . $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@xxxxxxx> написал:
Игорь,
Хотелось бы узнать есть или планируется когда-нибудь создавать тул для мониторинга
nginx?
С уважением,
Сергей Мелехов
|
|
|