I grabbed the tomcat plugins from Ticket #74 for munin, specifically tomcat-plugins.tar.2.gz. I then made small changes to the URL and xml lines to work with our jboss install.
-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/status?XML=true";
-if($xml->{'connector'}->{'http'.$PORT}->{'requestInfo'}->{'bytesSent'}) {
- print "volume.value " . $xml->{'connector'}->{'http'.$PORT}->{'requestInfo'}->{'bytesSent'} . "\n";
+if($xml->{'connector'}->{'http-0.0.0.0-'.$PORT}->{'requestInfo'}->{'bytesSent'}) {
+ print "volume.value " . $xml->{'connector'}->{'http-0.0.0.0-'.$PORT}->{'requestInfo'}->{'bytesSent'} . "\n";
Do this for each xml entry and you’ll be all set:
$ for file in `ls` ; do ./$file ; done accesses.value 550 free.value 201360024 used.value 317947240 max.value 1037959168 busy.value 4 idle.value 5 volume.value 4574821
Nice post!
Just a note though, when modifying default ROOT.war, use the following line instead:
my $URL = exists $ENV{‘url’} ? $ENV{‘url’} : “http://%s:%s\@127.0.0.1:%d/web-console/status?XML=true”;
for file in *; do ./$file; done
No need for `ls`
Hi thank you for this article
I got these errors:
2012/01/20-10:35:03 [19576] File does not exist: at /etc/munin/plugins/jboss_volume line 126
2012/01/20-10:35:03 [19576] Service ‘jboss_volume’ exited with status 2/0.
2012/01/20-10:35:05 [19518] Error output from jboss_threads:
2012/01/20-10:35:05 [19518] File does not exist: at /etc/munin/plugins/jboss_threads line 107
2012/01/20-10:35:05 [19518] Service ‘jboss_threads’ exited with status 2/0.
2012/01/20-10:35:06 [19576] Error output from jboss_threads:
2012/01/20-10:35:06 [19576] File does not exist: at /etc/munin/plugins/jboss_threads line 107
2012/01/20-10:35:06 [19576] Service ‘jboss_threads’ exited with status 2/0.
2012/01/20-10:35:06 [19518] Error output from jboss_access:
2012/01/20-10:35:06 [19518] File does not exist: at /etc/munin/plugins/jboss_access line 106
2012/01/20-10:35:06 [19518] Service ‘jboss_access’ exited with status 2/0.
2012/01/20-10:35:06 [19576] Error output from jboss_access:
2012/01/20-10:35:06 [19576] File does not exist: at /etc/munin/plugins/jboss_access line 106
2012/01/20-10:35:06 [19576] Service ‘jboss_access’ exited with status 2/0.
2012/01/20-10:35:10 [19576] Error output from jboss_jvm:
2012/01/20-10:35:10 [19576] File does not exist: at /etc/munin/plugins/jboss_jvm line 120
2012/01/20-10:35:10 [19576] Service ‘jboss_jvm’ exited with status 2/0.
at:
my $xml = $xs->XMLin($response->content, %options);
any idea ?