1
0
Fork 0
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:
ricardo 2012-08-28 11:26:00 +02:00
parent e9ce5f9633
commit 2cbf4a93b6

View file

@ -43,7 +43,7 @@ Rune Nordb
=head1 LICENSE
Unknown license
GPL 2.
=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 $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 $PASSWORD = exists $ENV{'password'} ? $ENV{'password'} : "munin";
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 $xml = $xs->XMLin($response->content, %options);
if($xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
print "accesses.value " . $xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
if($xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
print "accesses.value " . $xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
} else {
print "accesses.value U\n";
}