mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-23 06:35:42 +00:00
tomcat access plugin
This commit is contained in:
parent
e9ce5f9633
commit
2cbf4a93b6
1 changed files with 4 additions and 4 deletions
|
@ -43,7 +43,7 @@ Rune Nordb
|
||||||
|
|
||||||
=head1 LICENSE
|
=head1 LICENSE
|
||||||
|
|
||||||
Unknown license
|
GPL 2.
|
||||||
|
|
||||||
=head1 MAGIC MARKERS
|
=head1 MAGIC MARKERS
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ if(!eval "require XML::Simple;") {
|
||||||
|
|
||||||
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://%s:%s\@127.0.0.1:%d/manager/status?XML=true";
|
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://%s:%s\@127.0.0.1:%d/manager/status?XML=true";
|
||||||
my $PORT = exists $ENV{'ports'} ? $ENV{'ports'} : 8080;
|
my $PORT = exists $ENV{'ports'} ? $ENV{'ports'} : 8080;
|
||||||
my $PORTAJP = exists $ENV{'portajp'} ? $ENV{'portajp'} : 8009;
|
my $PNAME = exists $ENV{'pname'} ? $ENV{'pname'} : "http-8080";
|
||||||
my $USER = exists $ENV{'user'} ? $ENV{'user'} : "munin";
|
my $USER = exists $ENV{'user'} ? $ENV{'user'} : "munin";
|
||||||
my $PASSWORD = exists $ENV{'password'} ? $ENV{'password'} : "munin";
|
my $PASSWORD = exists $ENV{'password'} ? $ENV{'password'} : "munin";
|
||||||
my $TIMEOUT = exists $ENV{'timeout'} ? $ENV{'timeout'} : 30;
|
my $TIMEOUT = exists $ENV{'timeout'} ? $ENV{'timeout'} : 30;
|
||||||
|
@ -107,8 +107,8 @@ my $response = $ua->request(HTTP::Request->new('GET',$url));
|
||||||
my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
|
my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
|
||||||
my $xml = $xs->XMLin($response->content, %options);
|
my $xml = $xs->XMLin($response->content, %options);
|
||||||
|
|
||||||
if($xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
|
if($xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
|
||||||
print "accesses.value " . $xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
|
print "accesses.value " . $xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
|
||||||
} else {
|
} else {
|
||||||
print "accesses.value U\n";
|
print "accesses.value U\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue