Projet

Général

Profil

Révision 2cbf4a93

ID2cbf4a93b690b62bac4768a1c38a7965ce32ead3
Parent e9ce5f96
Enfant 68b65c84

Ajouté par ricardo il y a plus de 13 ans

tomcat access plugin

Voir les différences:

plugins/tomcat/tomcat_access
43 43

  
44 44
=head1 LICENSE
45 45

  
46
Unknown license
46
GPL 2.
47 47

  
48 48
=head1 MAGIC MARKERS
49 49

  
......
66 66

  
67 67
my $URL      = exists $ENV{'url'}      ? $ENV{'url'}      : "http://%s:%s\@127.0.0.1:%d/manager/status?XML=true";
68 68
my $PORT     = exists $ENV{'ports'}    ? $ENV{'ports'}    : 8080;
69
my $PORTAJP  = exists $ENV{'portajp'}  ? $ENV{'portajp'}  : 8009;
69
my $PNAME    = exists $ENV{'pname'}    ? $ENV{'pname'}    : "http-8080";
70 70
my $USER     = exists $ENV{'user'}     ? $ENV{'user'}     : "munin";
71 71
my $PASSWORD = exists $ENV{'password'} ? $ENV{'password'} : "munin";
72 72
my $TIMEOUT  = exists $ENV{'timeout'}  ? $ENV{'timeout'}  : 30;
......
107 107
my %options = ( KeyAttr => { connector => 'name' }, ForceArray => 1 );
108 108
my $xml = $xs->XMLin($response->content, %options);
109 109

  
110
if($xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
111
    print "accesses.value " . $xml->{'connector'}->{"\"".$PORTAJP."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
110
if($xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'}) {
111
    print "accesses.value " . $xml->{'connector'}->{"\"".$PNAME."\""}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
112 112
} else {
113 113
    print "accesses.value U\n";
114 114
}

Formats disponibles : Unified diff