Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: 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?

,





  • Follow-Ups:
    • Re:
      • From: Ilya Novikov

 




Copyright © Lexa Software, 1996-2009.