From ae1fc8494fd8671c00f626315a4d148075932bca Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Tue, 31 Oct 2017 14:38:28 +0100 Subject: [PATCH] Imported Upstream version 1.12 --- Build.PL | 254 + CHANGES | 418 ++ LICENSE | 910 ++++ MANIFEST | 157 + META.json | 221 + META.yml | 150 + README | 148 + config/common.cfg | 34 + config/glassfish.cfg | 69 + config/jboss.cfg | 111 + config/jboss7.cfg | 203 + config/jetty.cfg | 191 + config/memory.cfg | 200 + config/metrics.cfg | 43 + config/threads.cfg | 37 + config/tomcat.cfg | 245 + config/weblogic.cfg | 95 + config/websphere.cfg | 30 + config/websphere/appstate.cfg | 13 + config/websphere/http.cfg | 129 + config/websphere/jca.cfg | 43 + config/websphere/jdbc.cfg | 88 + config/websphere/jms.cfg | 44 + config/websphere/threads.cfg | 45 + config/wildfly.cfg | 134 + docker/Dockerfile | 42 + docker/README.md | 43 + examples/jsr77.pl | 158 + examples/memory.pl | 11 + examples/memory.sh | 13 + examples/remote.pl | 31 + examples/threadDump.pl | 102 + inc/Module-Build/Module/Build.pm | 1098 ++++ inc/Module-Build/Module/Build/API.pod | 1927 +++++++ inc/Module-Build/Module/Build/Authoring.pod | 323 ++ inc/Module-Build/Module/Build/Base.pm | 4653 +++++++++++++++++ inc/Module-Build/Module/Build/Compat.pm | 578 ++ inc/Module-Build/Module/Build/Config.pm | 59 + inc/Module-Build/Module/Build/ConfigData.pm | 201 + inc/Module-Build/Module/Build/Cookbook.pm | 529 ++ inc/Module-Build/Module/Build/Dumper.pm | 19 + inc/Module-Build/Module/Build/ModuleInfo.pm | 471 ++ inc/Module-Build/Module/Build/Notes.pm | 296 ++ inc/Module-Build/Module/Build/PPMMaker.pm | 196 + .../Module/Build/Platform/Amiga.pm | 34 + .../Module/Build/Platform/Default.pm | 33 + .../Module/Build/Platform/EBCDIC.pm | 34 + .../Module/Build/Platform/MPEiX.pm | 34 + .../Module/Build/Platform/MacOS.pm | 152 + .../Module/Build/Platform/RiscOS.pm | 34 + .../Module/Build/Platform/Unix.pm | 73 + inc/Module-Build/Module/Build/Platform/VMS.pm | 482 ++ inc/Module-Build/Module/Build/Platform/VOS.pm | 34 + .../Module/Build/Platform/Windows.pm | 299 ++ inc/Module-Build/Module/Build/Platform/aix.pm | 40 + .../Module/Build/Platform/cygwin.pm | 39 + .../Module/Build/Platform/darwin.pm | 40 + inc/Module-Build/Module/Build/Platform/os2.pm | 39 + inc/Module-Build/Module/Build/PodParser.pm | 106 + inc/Module-Build/Module/Build/Version.pm | 686 +++ inc/Module-Build/Module/Build/YAML.pm | 161 + it/check_jmx4perl/base.cfg | 19 + it/check_jmx4perl/base.pl | 50 + it/check_jmx4perl/checks.cfg | 195 + it/check_jmx4perl/multi_check.cfg | 64 + it/it.pl | 62 + it/t/01_version.t | 29 + it/t/02_http_header.t | 14 + it/t/10_base.t | 25 + it/t/30_naming.t | 59 + it/t/40_alias.t | 20 + it/t/50_check_base.t | 40 + it/t/51_check_relative.t | 37 + it/t/52_check_operation.t | 45 + it/t/53_check_non_numeric.t | 59 + it/t/54_check_unit.t | 50 + it/t/55_check_incremental.t | 47 + it/t/56_check_value.t | 32 + it/t/57_check_config.t | 113 + it/t/58_check_multi_config.t | 104 + it/t/59_check_timeout.t | 22 + it/t/60_bulk_request.t | 22 + it/t/64_check_perfdata.t | 59 + it/t/70_overloaded_method.t | 33 + it/t/80_read.t | 95 + it/t/83_write.t | 26 + it/t/84_exec.t | 24 + it/t/85_path_escaping.t | 38 + it/t/90_search.t | 18 + it/t/95_cors.t | 90 + it/t/99_discovery.t | 35 + lib/JMX/Jmx4Perl.pm | 1243 +++++ lib/JMX/Jmx4Perl/Agent.pm | 486 ++ .../Jmx4Perl/Agent/Jolokia/ArtifactHandler.pm | 322 ++ .../Jmx4Perl/Agent/Jolokia/DownloadAgent.pm | 150 + lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm | 167 + lib/JMX/Jmx4Perl/Agent/Jolokia/Meta.pm | 379 ++ lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier.pm | 162 + .../Jolokia/Verifier/ChecksumVerifier.pm | 89 + .../Agent/Jolokia/Verifier/GnuPGVerifier.pm | 170 + .../Agent/Jolokia/Verifier/MD5Verifier.pm | 60 + .../Agent/Jolokia/Verifier/OpenPGPVerifier.pm | 114 + .../Jmx4Perl/Agent/Jolokia/Verifier/PGPKey.pm | 35 + .../Agent/Jolokia/Verifier/SHA1Verifier.pm | 58 + .../Jmx4Perl/Agent/Jolokia/WebXmlHandler.pm | 452 ++ lib/JMX/Jmx4Perl/Agent/UserAgent.pm | 167 + lib/JMX/Jmx4Perl/Alias.pm | 328 ++ lib/JMX/Jmx4Perl/Alias/Object.pm | 100 + lib/JMX/Jmx4Perl/Config.pm | 223 + lib/JMX/Jmx4Perl/J4psh.pm | 327 ++ lib/JMX/Jmx4Perl/J4psh/Command.pm | 294 ++ lib/JMX/Jmx4Perl/J4psh/Command/Global.pm | 128 + lib/JMX/Jmx4Perl/J4psh/Command/MBean.pm | 721 +++ lib/JMX/Jmx4Perl/J4psh/Command/Server.pm | 125 + lib/JMX/Jmx4Perl/J4psh/CommandHandler.pm | 307 ++ lib/JMX/Jmx4Perl/J4psh/CompletionHandler.pm | 220 + lib/JMX/Jmx4Perl/J4psh/ServerHandler.pm | 207 + lib/JMX/Jmx4Perl/J4psh/Shell.pm | 284 + lib/JMX/Jmx4Perl/Manual.pod | 465 ++ lib/JMX/Jmx4Perl/Nagios/CactiJmx4Perl.pm | 96 + lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm | 979 ++++ lib/JMX/Jmx4Perl/Nagios/MessageHandler.pm | 60 + lib/JMX/Jmx4Perl/Nagios/SingleCheck.pm | 821 +++ lib/JMX/Jmx4Perl/Product/ActiveMQ.pm | 79 + lib/JMX/Jmx4Perl/Product/BaseHandler.pm | 647 +++ lib/JMX/Jmx4Perl/Product/Geronimo.pm | 90 + lib/JMX/Jmx4Perl/Product/Glassfish.pm | 99 + lib/JMX/Jmx4Perl/Product/Hadoop.pm | 78 + lib/JMX/Jmx4Perl/Product/JBoss.pm | 87 + lib/JMX/Jmx4Perl/Product/Jetty.pm | 106 + lib/JMX/Jmx4Perl/Product/Jonas.pm | 89 + lib/JMX/Jmx4Perl/Product/Resin.pm | 92 + lib/JMX/Jmx4Perl/Product/SpringDM.pm | 87 + lib/JMX/Jmx4Perl/Product/Terracotta.pm | 83 + lib/JMX/Jmx4Perl/Product/Tomcat.pm | 96 + lib/JMX/Jmx4Perl/Product/Unknown.pm | 89 + lib/JMX/Jmx4Perl/Product/Weblogic.pm | 131 + lib/JMX/Jmx4Perl/Product/Websphere.pm | 88 + lib/JMX/Jmx4Perl/Request.pm | 426 ++ lib/JMX/Jmx4Perl/Response.pm | 180 + lib/JMX/Jmx4Perl/Util.pm | 132 + scripts/cacti_jmx4perl | 110 + scripts/check_jmx4perl | 1911 +++++++ scripts/j4psh | 144 + scripts/jmx4perl | 779 +++ scripts/jolokia | 647 +++ t/10_handler.t | 35 + t/20_alias.t | 22 + t/30_request.t | 75 + t/40_check_jmx4perl.t | 72 + t/50_config.t | 23 + t/60_parse_name.t | 29 + t/70_pod_syntax.t | 13 + t/j4p_test.cfg | 19 + t/lib/It.pm | 53 + t/lib/ProductTest/Test1Handler.pm | 31 + t/lib/ProductTest/Test2Handler.pm | 27 + 157 files changed, 35016 insertions(+) create mode 100755 Build.PL create mode 100644 CHANGES create mode 100644 LICENSE create mode 100644 MANIFEST create mode 100644 META.json create mode 100644 META.yml create mode 100644 README create mode 100644 config/common.cfg create mode 100644 config/glassfish.cfg create mode 100644 config/jboss.cfg create mode 100644 config/jboss7.cfg create mode 100644 config/jetty.cfg create mode 100644 config/memory.cfg create mode 100644 config/metrics.cfg create mode 100644 config/threads.cfg create mode 100644 config/tomcat.cfg create mode 100644 config/weblogic.cfg create mode 100644 config/websphere.cfg create mode 100644 config/websphere/appstate.cfg create mode 100644 config/websphere/http.cfg create mode 100644 config/websphere/jca.cfg create mode 100644 config/websphere/jdbc.cfg create mode 100644 config/websphere/jms.cfg create mode 100644 config/websphere/threads.cfg create mode 100644 config/wildfly.cfg create mode 100644 docker/Dockerfile create mode 100644 docker/README.md create mode 100755 examples/jsr77.pl create mode 100644 examples/memory.pl create mode 100644 examples/memory.sh create mode 100644 examples/remote.pl create mode 100755 examples/threadDump.pl create mode 100644 inc/Module-Build/Module/Build.pm create mode 100644 inc/Module-Build/Module/Build/API.pod create mode 100644 inc/Module-Build/Module/Build/Authoring.pod create mode 100644 inc/Module-Build/Module/Build/Base.pm create mode 100644 inc/Module-Build/Module/Build/Compat.pm create mode 100644 inc/Module-Build/Module/Build/Config.pm create mode 100644 inc/Module-Build/Module/Build/ConfigData.pm create mode 100644 inc/Module-Build/Module/Build/Cookbook.pm create mode 100644 inc/Module-Build/Module/Build/Dumper.pm create mode 100644 inc/Module-Build/Module/Build/ModuleInfo.pm create mode 100644 inc/Module-Build/Module/Build/Notes.pm create mode 100644 inc/Module-Build/Module/Build/PPMMaker.pm create mode 100644 inc/Module-Build/Module/Build/Platform/Amiga.pm create mode 100644 inc/Module-Build/Module/Build/Platform/Default.pm create mode 100644 inc/Module-Build/Module/Build/Platform/EBCDIC.pm create mode 100644 inc/Module-Build/Module/Build/Platform/MPEiX.pm create mode 100644 inc/Module-Build/Module/Build/Platform/MacOS.pm create mode 100644 inc/Module-Build/Module/Build/Platform/RiscOS.pm create mode 100644 inc/Module-Build/Module/Build/Platform/Unix.pm create mode 100644 inc/Module-Build/Module/Build/Platform/VMS.pm create mode 100644 inc/Module-Build/Module/Build/Platform/VOS.pm create mode 100644 inc/Module-Build/Module/Build/Platform/Windows.pm create mode 100644 inc/Module-Build/Module/Build/Platform/aix.pm create mode 100644 inc/Module-Build/Module/Build/Platform/cygwin.pm create mode 100644 inc/Module-Build/Module/Build/Platform/darwin.pm create mode 100644 inc/Module-Build/Module/Build/Platform/os2.pm create mode 100644 inc/Module-Build/Module/Build/PodParser.pm create mode 100644 inc/Module-Build/Module/Build/Version.pm create mode 100644 inc/Module-Build/Module/Build/YAML.pm create mode 100644 it/check_jmx4perl/base.cfg create mode 100644 it/check_jmx4perl/base.pl create mode 100644 it/check_jmx4perl/checks.cfg create mode 100644 it/check_jmx4perl/multi_check.cfg create mode 100755 it/it.pl create mode 100644 it/t/01_version.t create mode 100644 it/t/02_http_header.t create mode 100644 it/t/10_base.t create mode 100644 it/t/30_naming.t create mode 100644 it/t/40_alias.t create mode 100644 it/t/50_check_base.t create mode 100644 it/t/51_check_relative.t create mode 100644 it/t/52_check_operation.t create mode 100644 it/t/53_check_non_numeric.t create mode 100644 it/t/54_check_unit.t create mode 100644 it/t/55_check_incremental.t create mode 100644 it/t/56_check_value.t create mode 100644 it/t/57_check_config.t create mode 100644 it/t/58_check_multi_config.t create mode 100644 it/t/59_check_timeout.t create mode 100644 it/t/60_bulk_request.t create mode 100644 it/t/64_check_perfdata.t create mode 100644 it/t/70_overloaded_method.t create mode 100644 it/t/80_read.t create mode 100644 it/t/83_write.t create mode 100644 it/t/84_exec.t create mode 100644 it/t/85_path_escaping.t create mode 100644 it/t/90_search.t create mode 100644 it/t/95_cors.t create mode 100644 it/t/99_discovery.t create mode 100644 lib/JMX/Jmx4Perl.pm create mode 100644 lib/JMX/Jmx4Perl/Agent.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/ArtifactHandler.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/DownloadAgent.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Meta.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/ChecksumVerifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/GnuPGVerifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/MD5Verifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/OpenPGPVerifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/PGPKey.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/SHA1Verifier.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/Jolokia/WebXmlHandler.pm create mode 100644 lib/JMX/Jmx4Perl/Agent/UserAgent.pm create mode 100644 lib/JMX/Jmx4Perl/Alias.pm create mode 100644 lib/JMX/Jmx4Perl/Alias/Object.pm create mode 100644 lib/JMX/Jmx4Perl/Config.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/Command.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/Command/Global.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/Command/MBean.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/Command/Server.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/CommandHandler.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/CompletionHandler.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/ServerHandler.pm create mode 100644 lib/JMX/Jmx4Perl/J4psh/Shell.pm create mode 100644 lib/JMX/Jmx4Perl/Manual.pod create mode 100644 lib/JMX/Jmx4Perl/Nagios/CactiJmx4Perl.pm create mode 100644 lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm create mode 100644 lib/JMX/Jmx4Perl/Nagios/MessageHandler.pm create mode 100644 lib/JMX/Jmx4Perl/Nagios/SingleCheck.pm create mode 100644 lib/JMX/Jmx4Perl/Product/ActiveMQ.pm create mode 100644 lib/JMX/Jmx4Perl/Product/BaseHandler.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Geronimo.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Glassfish.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Hadoop.pm create mode 100644 lib/JMX/Jmx4Perl/Product/JBoss.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Jetty.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Jonas.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Resin.pm create mode 100644 lib/JMX/Jmx4Perl/Product/SpringDM.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Terracotta.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Tomcat.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Unknown.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Weblogic.pm create mode 100644 lib/JMX/Jmx4Perl/Product/Websphere.pm create mode 100644 lib/JMX/Jmx4Perl/Request.pm create mode 100644 lib/JMX/Jmx4Perl/Response.pm create mode 100644 lib/JMX/Jmx4Perl/Util.pm create mode 100755 scripts/cacti_jmx4perl create mode 100755 scripts/check_jmx4perl create mode 100755 scripts/j4psh create mode 100755 scripts/jmx4perl create mode 100755 scripts/jolokia create mode 100644 t/10_handler.t create mode 100644 t/20_alias.t create mode 100644 t/30_request.t create mode 100644 t/40_check_jmx4perl.t create mode 100644 t/50_config.t create mode 100644 t/60_parse_name.t create mode 100644 t/70_pod_syntax.t create mode 100644 t/j4p_test.cfg create mode 100644 t/lib/It.pm create mode 100644 t/lib/ProductTest/Test1Handler.pm create mode 100644 t/lib/ProductTest/Test2Handler.pm diff --git a/Build.PL b/Build.PL new file mode 100755 index 0000000..539e0a5 --- /dev/null +++ b/Build.PL @@ -0,0 +1,254 @@ +#!/usr/bin/perl + +# Check for Module::Build at the right version or use or own bundled one +# if the available one does not fit. +my $Minimal_MB = 0.34; + +my $Installed_MB = + `$^X -e "eval q{require Module::Build; print Module::Build->VERSION} or exit 1"`; +chomp $Installed_MB; + +$Installed_MB = 0 if $?; + +# Use our bundled copy of Module::Build if it's newer than the installed. +unshift @INC, "inc/Module-Build" if $Minimal_MB > $Installed_MB; + +require Module::Build; +use strict; +use Data::Dumper; + +my %REQS = ( + "JSON" => "2.12", + "LWP::UserAgent" => 0, + "URI" => "1.35", + "Data::Dumper" => 0, + "Getopt::Long" => 0, + "Carp" => 0, + "Module::Find" => 0, + "Scalar::Util" => 0, + "base" => 0, + "Sys::SigAction" => 0, + "IO::Socket::Multicast" => 0 # opt + ); + +my %SCRIPTS = (); + +# Ask for various installation options: + +print < 0 # opt + ); + add_script("scripts/jmx4perl" => 1); +} + +my $msg = < "0.37", # req + "Text::ParseWords" => 0, # req + "Time::HiRes" => 0, # req + "Config::General" => "2.34",# req + "Pod::Usage" => 0, # opt + "Crypt::Blowfish_PP" => 0 # opt + ); + add_script("scripts/check_jmx4perl" => 1); +} + +$msg = < "0.37", # req + "Text::ParseWords" => 0, # req + "Config::General" => "2.34",# req + "Pod::Usage" => 0, # opt + "Crypt::Blowfish_PP" => 0 # opt + ); + add_script("scripts/cacti_jmx4perl" => 1); +} + +$msg = < 0, # req, GetOptionsFromArray must be exported + "Term::ShellUI" => 0, # req + "Term::Clui" => 0, # req + "Term::Size" => "0.207", # opt + "Config::General" => "2.34",# opt + "File::SearchPath" => 0, # opt + "Crypt::Blowfish_PP" => 0 # opt + ); + add_script("scripts/j4psh" => 1); + # check for Term::ReadLine::Gnu + my $has_gnu_readline = eval "require Term::ReadLine; require Term::ReadLine::Gnu; 1"; + my $has_perl_readline = eval "require Term::ReadLine::Perl; 1"; + if (!$has_gnu_readline) { + $msg = < 0); + } elsif (!$has_perl_readline) { + add_reqs("Term::ReadLine::Perl" => 0, + "Term::ReadKey" => 0); + } + } +} + +$msg = < 0, # req + "XML::LibXML" => 0, # req + "File::Temp" => 0, # req + "Digest::MD5" => 0, # opt + "Digest::SHA1" => 0, # opt + "XML::Twig" => 0, # opt + "Term::ProgressBar" => 0 # opt + ); + add_script("scripts/jolokia" => 1); + my $has_openpgp = eval "require Crypt::OpenPGP; 1"; + if (!$has_openpgp) { + my $check = `gpg --version`; + if ($?) { + $check = `gpg2 --version`; + if ($?) { + $msg = < 0); + } + } + } + } +} + +# Add extra requirements +sub add_reqs { + my %to_add = @_; + for my $k (keys %to_add) { + $REQS{$k} = $to_add{$k}; + } +} + +sub add_script { + my $script = shift; + $SCRIPTS{$script} = 1; +} + +sub y_n { + Module::Build->y_n(@_); +} + +# ================================================================================ + +my $build = Module::Build->new + ( + dist_name => "jmx4perl", + dist_version_from => "lib/JMX/Jmx4Perl.pm", + dist_author => 'Roland Huss (roland@cpan.org)', + dist_abstract => 'Easy JMX access to Java EE applications', + #sign => 1, + installdirs => 'site', + license => 'gpl', + + requires => \%REQS, + script_files => \%SCRIPTS, + + build_requires => { + "Module::Build" => "0.34", + "Test::More" => "0", + }, + configure_requires => { 'Module::Build' => 0.34 }, + keywords => [ "JMX", "JEE", "Management", "Nagios", "Java", "Jolokia", "OSGi", "Mule" ], + ); + +$build->create_build_script; + +# =================================================================================== + diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..94a1cd9 --- /dev/null +++ b/CHANGES @@ -0,0 +1,418 @@ +1.12 (2015-07-28) + + - Configuration can be also a directory in wich case /jmx4perl.cfg is tried + (e.g. ~/.j4p/jmx4perl.cfg) + - Added Docker build + - Fix boolean values to be strings "true"/"false" when deserialized. + - Changed from "Nagios::Plugin" to "Monitoring::Plugin" + +1.11 (2014-11-22) + + - When within a MultiCheck a single check causes an exception, the + other checks are now still present in the output of check_jmx4perl + and the overall check has the status UNKNWON (#40) + - Minor fixes on the WebSphere Checks + - Fixed issue when calling check_jmx4perl for an operation without argument (RT##98166) + +1.10 (2014-06-30) + + - Added WebSphere checks + +1.08 (2014-06-30) + - Fixed warning when using MBeanName (#31) + - Fixed BaseMBean and formatting + - Fixed relative checks when using MBean patterns + - Added formatter '%q' to include a ratio of value to base without + multiplying by 100 like for '%r' + - Disabled OpenPGPVerifier since it doesn't support the new digest + algorithms used for signing the Jolokia artefacts (#32) + - Don't set ssl_opts if on LWP < 6 (#28) + - Fixed BaseMBean and BaseAttribute config directives (#25) + - Fixed regexp for squeezing trailing slashes (RT#89108) + - Fixed check definition for 'wls_channel_connections (RT#89107) + - Changed check 'memory_gc_time' to be a relative check to measure the + relative amount taken for the GC. If you use this check (or a sub-check of this) + YOU NEED TO UPDATE YOUR THRESHOLDS (and regenerate the pn4p graphics) if you use this + check directly + - Fixed bug when using 0 thresholds in checks using parent checks (#38) + - Added support for '*' wildcard when navigation with cd for j4psh + - Fixed bug with check inheritance and check parameters which contain parantheses + - Added an option "MultiCheckPrefix" for "Checks" in order to specify the prefix + for multi checks + - Added config options "SummaryOk" and "SummaryFailure" for allowing to fine tune + multi check output (#24) + - "Argument" can be used in "Operation" config checks for providing arguments to + Nagios checks which are based on operations (#27) + +1.07 (2013-04-16) + - Added more robust timeout for the Jmx4Perl Agent (requires Sys::SigAction) + - SSL Host key verification switched off when connecting via SSL + - Fixed issue with quoting in j4psh (#14) + - 'cat' in j4psh is now caseinsensitive when using wildcards (#18) + - Added BaseMBean, BaseAttribute and BasePath as alternative to Base f + or check_jmx4perl (#16) + - "jolokia" can do 'repack' and 'info' also when not being connected + to the internet (#20) + - Multi-Checks can now reference other Multi-Checks either via + or (#19) + - Added new option '--perfdata true|false' (PerData false in configuration) for + switching of performance data. Also, for string checks performance data is + switched off always. (#22) + - Added %y and %z as placeholder for configured CRITICAL and WARNING thresholds + for the output provided with "Label" in check_jmx4perl (#13) + +1.06 (2012-10-13) + - A a scripting mode to check_jmx4perl which allows putting in arbitraty + Perl code for extracting the value to match against + - weblogic specific Nagios checks added + - Added name as optional parameter for Nagios checks in tomcat.cfg (thanks Wolfgang) + - When a multi checks fails, then the name of the check is added instead of its definition + key. This allows for better direct usage of predefined checks in own multi checks. + - If neither a CRITICAL nor a WARNING threshold is provided, then + the check always returns OK. This is especially useful when the + motivation is to only collect performance data. + +1.05 (2012-04-22) + - Added Time::HiRes as dependency to check_jmx4perl + - Replaced XML::Tidy with XML::Twig and relaxed version number + requirement on Module::Build + - RT#72413: Fixed configuration in threads.cfg + - Updated documentation for 'jmx4perl' (--method and --legacy-escape + explained) + - Bundled Module::Build 0.34 in order to improve the installation + experience + - j4psh: Added 'pwd' command + - j4psh: Added options -a (attributes) and -o (operatiosn) to the 'ls' + command which now also supports wildcards for filtering + +1.04 (2011-11-27) + - Fixed serious (and stupid) bug for jmx4perl and j4psh when printing + out scalar values. + +1.03 (2011-11-23) + - Fixed stupid last minute bug. + +1.02 (2011-11-23) + - Fix for threshold with 0 value in check_jmx4perl + - Fix automatic detection of the largest version number for Jolokia + agents in with the format 1.0.1 when downloading with 'jolokia' + - Fixed printing of boolean values for jmx4perl and j4psh for + complex data structures (finally) + - Added option '--option key=val' to jmx4perl and j4psh for tuning the + output format of these tools (known keys: format,booleans,indent) + - Added '--target' to j4psh so that it can operate against a JSR-160 + proxy + +1.01 (2011-10-25) + - Fixed 'jolokia' to load the new renamed jvm agent. + - Fixed issue when printing boolean values with jmx4perl + - Fixed issue with LWP as old as 5.805 + - Bumped required version of Module::Build to 0.38 in order to cope + with messed up version number of XML::Tidy. + - j4psh works now with Getopt::Long before 2.38 + +1.00 (2011-10-3) + - Changed escaping as introduced by Jolokia 1.0. If talking with + Jolokia < 1.0, use the option '--legacy-escape' must be used if + using GET requests with MBeans containing / in the + name. JMX::Jmx4Perl knows this option as well + ('legacy-escape'). j4psh does the detection automatically, + jmx4perl, check_jmx4perl and cacti_jmx4perl know about the new + configuration option. + - That's 1.0 + +0.95 (2011-8-21) + - Fixed Cacti output when labels contains spaces + - Tuned ancient Perl coding style (thanks, datamuc) + - Fixed problem with jolokia and PGP verification in non-english + environments. + - Fixed 'search' command which now really returns undef if nothing + is found (and not a ref to an empty array). That will also fix some + detectors when the 'info' command is used. + +0.92 (2011-5-9) + - Fixed bug in pack specification (encryption) which is not available for + Perl 5.8 (and which broke Jmx4Perl for Perl 5.8) + +0.91 (2011-5-6) + - Added --unknown-is-critical option to map all UNKNOWN to CRITICAL values (RT#67899) + - Added jmx4perl back to the build process, which was forgotten in 0.90 + - Fixed bug RT#67815 which was caused by an invalid replacement of placeholder + for certain cases (i.e. is during parent check definition resolving + ($0,$1) needs to be replaced by ($1,$2) which ended up falsely as ($2,$2)). + - Implemented --timeout option for check_jmx4perl, which is a pure HTTP timeout + for the communication between the Nagios checks and the Jolokia agent (RT#67821) + - Added a possibility to store encrypted passwords in the configuration file. + Please note, that this is *not* secure and only prevents casual attacks, since + the password needs to be symmetrically decrypted before passing it to the server. + In order to create an encrypted password, use 'jmx4perl encrypt '. + - Fixed RT#67772 which prevented the proper count of failed checks for non-relative + checks within multi checks + +0.90 (2011-4-11) + - Tuned Build.PL so that scripts can be added conditionally. + - Fixed normalization issue with negative delta check values. + - Support for new JSON serialization style of Jolokia 0.90 added. + (i.e numbers and booleans are not returned as plain strings anymore + but as Long, Double, true/false. Null is returned as JSON-null. + If you have trouble with boolean checks in check_jmx4perl, please + update to this jmx4perl version. + - Added 'jolokia' for downloading and managing Jolokia agents + - Removed jmx4perl Java agent source and agent since jmx4perl now uses + Jolokia as agents (www.jolokia.org) + - Added 'cacti_jmx4perl', a tool for gathering Cacti data (www.cacti.net) + It is heavily based on 'check_jmx4perl' (without threshold handling). + +0.75 (2011-2-4) + - Fixed typo in POD documentation which prevented a successful + build in some situations + +0.74 (2011-1-16) + - Fixed problem with multichecks including operation-checks with + arguments. Specifying them in a configuration has been falsely + ignored. + - Added '--method' command line option and 'Method' check + configuration option to check_jmx4perl for selecting the prefered + HTTP request method. + - Fixed normalization of time values (RT #63545) + - Improved default check_jmx4perl configuration (in hopefully a backward + compatible way) + - Multi check service summary now contains the name of failed services + - Fixed problems with a single '/' argument (RT #62915) + +0.73 (2010-11-03) + - Fixed RT #61903 which occurs when the same check is referenced + multiple times (with potentially different parameters) in a + multicheck scenario. + - Fixed RT #62342: Perl warning when using operations and not --name + in check_jmx4perl + - Added --method to jmx4perl, config option 'method' for JMX::Jmx4Perl + in order to allow a default HTTP Method to use. + - Changed request command constant 'VERSION' to 'AGENT_VERSION' in + order to avoid conflicts with the usual versioning conventions for + Perl Modules. This is an API change, so in case you are using requests + with the constant VERSION you should change this to AGENT_VERSION + - Fixed issues when browsing with less in j4psh + - Extended config handling in j4psh to allow includes + +0.72 (2010-9-24) + - Fixed problem with quotes in the config when using "Value" + and/or "Base". + - Adapted tomcat.cfg to be more flexible (e.g. replaced 'Catalina' + domain part by a wildcard). + - Fixed bug for merged MBeanServers when using multiple attributes + and/or MBean patterns for a READ request + - Fixed broken --target, --target-user and --target-password for + check_jmx4perl (same for --proxy and co.) + - Tuned output of complex data in j4psh + - Unwrap an MBeanException to use the target exception for an error + message + - Agent tested with Mule 3.0 + +0.71 (2010-8-16) + - Added 'ns' as unit (CpuThreadTime returns nano seconds) + - Fixed quoting of performance data in so far to let + Nagios::Plugin the complete control + - Fixed '--color' option and UseColor config directive + (section: ) to j4psh + - Added detection of a suitable pager for j4psh + - Fixed bug in server configuration when using old style syntax + +0.70 (2010-7-10) + - Extended configuration syntax for check_jmx4perl as an alternative to + command line options + + Parameterized checks + + Default values for parameters + + Multichecks (one HTTP request, many JMX requests) + + Check-Inheritance + + Predefined checks for certain environments (as sample configuration files) + + Added null value check, can be tuned with --null + - Added '--value' as a shortcut for --mbean/--attribute/--value + - Better documentation for check_jmx4perl (30 extra pages) + - sections are now named blocks, taking the server name as block + name (similar to ). The old syntax with an "Name" argument is + still support but must not be mixed with the new syntax. + - Path elements containing '/' can now be escaped with '\/' + - j4p-osgi-bundle including pax-web-bundle so only a single bundle + is needed for deploying (when no OSGi HttpService is installed) + - Relaxed version requirements on core and compendium OSGi classes + for j4p-osgi bundle. + - Changed access restrictions (j4p-access.xml): + + and + + Wildcards (*) for attribute and operation names + + WARNING: Semantics of MBean specification has changed. Please + read the comments in j4p-access.xml.template + + Add logging (level info) for printing out which security policy + is used + - Started to add a java client library + - j4psh beta version added + - Agent: + + Switched from JUnit to TestNG for testing because of + support of testing groups + + New servlet init parameter option 'mbeanQualifier' to allow + multiple j4p-servlet in a single application server + +0.65 (2010-3-30) + - A JDK 6 java agent added for exporting the j4p protocol via + HTTP/JSON. + - Extended READ operation to support MBean patternames and multiple + attributes with a single request + - Renamed 'max_depth', 'max_list_size','max_objects' as processing + configuration parameters to 'maxDepth', 'maxCollectionSize' and + 'maxObjects' respectively for consistencies sake. + - Bug fix: POST request respect these parameters as well now + - Added 'ignoreErrors' request option in order to allow a bulk read + to succeed even if single read fails. In this case, the valu will + - 'search' returns properly escaped MBean Names if unsafe characters + are used. + - For GET request, instead of pathinfo a query with parameter 'p' + can be used as alternative. This works around certain issues with + special path handling with certain app-servers (e.g. Tomcat). + - JMX::Jmx4Perl::Request and JMX::Jmx4Perl::Agent hardened in order + to be more smart with unsafe MBean Names and detect automatically + the most convenient HTTP Request method (if not explicitely set) + - Added more unit and integration tests. + - Added VERSION command to JMX::Jmx4Perl to get to agent and + protocol version + - Fixed error handling for bulk requests. Now each request object + will return an associated response object even in the error case. + - Fixed JMX::Jmx4Perl::info for IBM JVMs + - Added JMX::Jmx4Perl->parse_name() for splitting up a given MBean + object name into its parts + +0.60 (2009-02-28) + - OSGi bundle (including dependencies) for exposing JSON export via + the OSGi HTTP-Service. It's in agent/modules/j4p-osgi. + - Refined error handling + - Removed legacy JDK 1.4 support. 0.36 is the one and only version + for which the JDK 1.4 backport has been tested to some amount. + - Added support for overloaded JMX operations for 'list' and 'exec' + - 'read' operation can now be used without attribute name in which + case the value of all attributes is returned. This can be used + directly with JMX::Jmx4Perl and the frontend jmx4perl. + - Support for Resin 3.1 added + - 'exec' operation can now deal with simple array arguments. Within + the perl modules, give an array ref for an array argument. This + gets translated to a comma separated list of values in the + string. For string array this works only with simle content + (i.e. no element containing a ',') + +0.51 (2009-12-30) + - Quickfix for a badly packaged agent/j4p.war + +0.50 (2009-12-24) + - Protocol of j4p.war has been extended to enable proxy mode + - Added '--target' to check_jmx4perl for using proxy mode + - Added '--target' to jmx4perl + - Added Mule agent. Use maven to build it in agent/modules/j4p-mule + - 'get_war' and 'get_mule_agent' as actions for Build.PL for + fetching java artifacts from the labs.consol.de maven repository. + - Cleaned up and updated Manual.pod + +0.40 (2009-11-14) + - Extended protocol to allow for JSON requests via POST in addition + to pure URL based requests via GET + - Implemented bulk requests: JMX::Jmx4Perl->request() can now take a + list of JMX::Jmx4Perl::Request objects in which case it will + return a list of JMX::Jmx4Perl::Response objects (instead of a + single, scalar, response when used with a single request) + - Support for Glassfish V3 Preview, Jonas 5.1 and Jetty 7.0.0 + +0.36 (2009-10-30) + - Added to j4p-access.xml for restricting + access to certain hosts or subnets only. + - Added support for a JDK 1.4 agent war. The feature base for + this agent is frozen. It might even vanish in the future. + You need a JDK 1.4 agent for running within Weblogic 8.1 + - Cleaned up j4p agent with help of sonar and associated + metric checkers like PMD, check_style and FindBugs. + - Added support for config files in jmx4perl and JMX::Jmx4Perl + which allows for shortcuts for agent URL as well as storing + user and credentials information. + - Fixed some bugs + +0.35 (2009-08-15) + - Added example 'threadDump.pl' + - Fixed bug when serializing floats and doubles. + - check_jmx4perl: + * Added support for checking string and boolean values + * Escaping performance data + * Include units-of-measurement in the plugin output + * Custom labeling of plugin output + * Perfdata contains always absolute values, even when + used with --base + +0.30 (2009-07-31) + - Fixed permission issue while running 'Build dist' + - Fixed URL generation for Websphere + - Added support for generic Bean serialization + - Added 'search' command to jmx4perl + - Fixed bug when using pathes with multiple components + - Added additional parameters 'max_depth', 'max_list_size' and + 'max_objects' to restrict the size of the JSON answer. Protocol + has changed as well a bit. + - jmx4perl: URL now as first argument for easier workflow when using + bash history for repeated usage. + - Added support for restricting MBean access via a policy file + (j4p-access.xml) + +0.21 (2009-07-03) + - Added '--proxy' for check_jmx4perl and jmx4perl + - check_jmx4perl: + + Refactored to work within the embedded Nagios Perl interpreter + (ePN) + + use relative values in the range from 0 to 100% + (for --critical and --warning) instead of [0..1] + + Renamed '--base-value' to '--base' since it can take now + absolute values (numbers) or "mbean/alias/path" tuples as an + argument in addition to alias names. + + Added '--operation' which allows for using return values of + operations as check values + + Added ~ 50 integration tests + +0.20 (2009-06-28) + - Support for writing attributes and executing operations + - Documentation fixes + - Tested for WebLogic 9. New initial support for Websphere 6.1 and + 7.0 + - New "version" command to j4p-agent + - New "search" j4p-agent command for querying for MBean names + - Added '--base-alias' to check_jmx4perl for using relative + thresholds + - Added '--delta' to check_jmx4perl for using an incremental + mode + - Cleaned up check_jmx4perl perfdata output + - Added own j4p-agent MBean for configuration management + (history tracking and debugging info) + - JMX::Jmx4Perl has new request short-cuts 'set_attribute' and + 'execute' + - Renamed j4p-agent.war to j4p.war + - Started integration test suite below "it/" and "agent/modules/j4p-it" + for installing some test beans + - Cleaned up maven integration for the agent servlet + - Moved repository to git://github.com/rhuss/jmx4perl.git + +0.16 + - Switched off debugging in agent servlet + - Fixed syntax error when using 'jmx4perl -v attributes' + - Fixed Jetty Handler. + +0.15 + - Aliasing + - Autodetection + - Command line tool "jmx4perl" + * reading of attributes + * listing of all availabel attributes and operations. + * listing of all attribute values + * print server info + * print all available aliases + - Bug Fixes: + * Correct URL encoding for request URL + * Slash '/' needs to be custom encoded, since URI encoding doesn't + work for JBoss 4/5 due to a bug + - Tested to work on JBoss 4 & 5, Oracle WebLogic 10, Jonas 4, Geronimo 2, + Glassfish 2, Tomcat 4-6 and Jetty 5 & 6 + +0.1 + - Initial release + - check_jmx4perl diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c3c9516 --- /dev/null +++ b/LICENSE @@ -0,0 +1,910 @@ +jmx4perl is released under the GNU General Public License, Version 2 +or later (see below). + +Module::Build included for the best installation experience is released under the +same terms as Perl itself, i.e. GPL V1 or later or the Artistic License. The full +license for Module::Build is appended below. + +============================================================================== + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + +=========================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +=========================================================================== +License for Module::Build: +-------------------------- + +This software is copyright (c) 2009 by Ken Williams & Development questions, bug reports, and patches should be sent to the +Module-Build mailing list at .. + +This is free software; you can redistribute it and/or modify it under +the same terms as perl itself. + +Terms of Perl itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2009 by Ken Williams & Development questions, bug reports, and patches should be sent to the +Module-Build mailing list at .. + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2009 by Ken Williams & Development questions, bug reports, and patches should be sent to the +Module-Build mailing list at .. + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..396b958 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,157 @@ +Build.PL +CHANGES +config/common.cfg +config/jboss.cfg +config/jboss7.cfg +config/jetty.cfg +config/memory.cfg +config/threads.cfg +config/tomcat.cfg +config/weblogic.cfg +config/glassfish.cfg +config/metrics.cfg +config/wildfly.cfg +config/websphere.cfg +config/websphere/appstate.cfg +config/websphere/http.cfg +config/websphere/jca.cfg +config/websphere/jdbc.cfg +config/websphere/jms.cfg +config/websphere/threads.cfg +examples/jsr77.pl +examples/memory.pl +examples/memory.sh +examples/remote.pl +examples/threadDump.pl +inc/Module-Build/Module/Build.pm +inc/Module-Build/Module/Build/API.pod +inc/Module-Build/Module/Build/Authoring.pod +inc/Module-Build/Module/Build/Base.pm +inc/Module-Build/Module/Build/Compat.pm +inc/Module-Build/Module/Build/Config.pm +inc/Module-Build/Module/Build/ConfigData.pm +inc/Module-Build/Module/Build/Cookbook.pm +inc/Module-Build/Module/Build/Dumper.pm +inc/Module-Build/Module/Build/ModuleInfo.pm +inc/Module-Build/Module/Build/Notes.pm +inc/Module-Build/Module/Build/Platform/aix.pm +inc/Module-Build/Module/Build/Platform/Amiga.pm +inc/Module-Build/Module/Build/Platform/cygwin.pm +inc/Module-Build/Module/Build/Platform/darwin.pm +inc/Module-Build/Module/Build/Platform/Default.pm +inc/Module-Build/Module/Build/Platform/EBCDIC.pm +inc/Module-Build/Module/Build/Platform/MacOS.pm +inc/Module-Build/Module/Build/Platform/MPEiX.pm +inc/Module-Build/Module/Build/Platform/os2.pm +inc/Module-Build/Module/Build/Platform/RiscOS.pm +inc/Module-Build/Module/Build/Platform/Unix.pm +inc/Module-Build/Module/Build/Platform/VMS.pm +inc/Module-Build/Module/Build/Platform/VOS.pm +inc/Module-Build/Module/Build/Platform/Windows.pm +inc/Module-Build/Module/Build/PodParser.pm +inc/Module-Build/Module/Build/PPMMaker.pm +inc/Module-Build/Module/Build/Version.pm +inc/Module-Build/Module/Build/YAML.pm +it/check_jmx4perl/base.cfg +it/check_jmx4perl/base.pl +it/check_jmx4perl/checks.cfg +it/check_jmx4perl/multi_check.cfg +it/it.pl +it/t/01_version.t +it/t/02_http_header.t +it/t/10_base.t +it/t/30_naming.t +it/t/40_alias.t +it/t/50_check_base.t +it/t/51_check_relative.t +it/t/52_check_operation.t +it/t/53_check_non_numeric.t +it/t/54_check_unit.t +it/t/55_check_incremental.t +it/t/56_check_value.t +it/t/57_check_config.t +it/t/58_check_multi_config.t +it/t/59_check_timeout.t +it/t/60_bulk_request.t +it/t/70_overloaded_method.t +it/t/80_read.t +it/t/85_path_escaping.t +it/t/90_search.t +it/t/95_cors.t +it/t/83_write.t +it/t/84_exec.t +it/t/64_check_perfdata.t +lib/JMX/Jmx4Perl.pm +lib/JMX/Jmx4Perl/Agent.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/ArtifactHandler.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/DownloadAgent.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Meta.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/ChecksumVerifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/GnuPGVerifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/MD5Verifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/OpenPGPVerifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/PGPKey.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/SHA1Verifier.pm +lib/JMX/Jmx4Perl/Agent/Jolokia/WebXmlHandler.pm +lib/JMX/Jmx4Perl/Agent/UserAgent.pm +lib/JMX/Jmx4Perl/Alias.pm +lib/JMX/Jmx4Perl/Alias/Object.pm +lib/JMX/Jmx4Perl/Config.pm +lib/JMX/Jmx4Perl/J4psh.pm +lib/JMX/Jmx4Perl/J4psh/Command.pm +lib/JMX/Jmx4Perl/J4psh/Command/Global.pm +lib/JMX/Jmx4Perl/J4psh/Command/MBean.pm +lib/JMX/Jmx4Perl/J4psh/Command/Server.pm +lib/JMX/Jmx4Perl/J4psh/CommandHandler.pm +lib/JMX/Jmx4Perl/J4psh/CompletionHandler.pm +lib/JMX/Jmx4Perl/J4psh/ServerHandler.pm +lib/JMX/Jmx4Perl/J4psh/Shell.pm +lib/JMX/Jmx4Perl/Manual.pod +lib/JMX/Jmx4Perl/Nagios/CactiJmx4Perl.pm +lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm +lib/JMX/Jmx4Perl/Nagios/SingleCheck.pm +lib/JMX/Jmx4Perl/Nagios/MessageHandler.pm +lib/JMX/Jmx4Perl/Product/ActiveMQ.pm +lib/JMX/Jmx4Perl/Product/BaseHandler.pm +lib/JMX/Jmx4Perl/Product/Geronimo.pm +lib/JMX/Jmx4Perl/Product/Glassfish.pm +lib/JMX/Jmx4Perl/Product/Hadoop.pm +lib/JMX/Jmx4Perl/Product/JBoss.pm +lib/JMX/Jmx4Perl/Product/Jetty.pm +lib/JMX/Jmx4Perl/Product/Jonas.pm +lib/JMX/Jmx4Perl/Product/Resin.pm +lib/JMX/Jmx4Perl/Product/SpringDM.pm +lib/JMX/Jmx4Perl/Product/Terracotta.pm +lib/JMX/Jmx4Perl/Product/Tomcat.pm +lib/JMX/Jmx4Perl/Product/Unknown.pm +lib/JMX/Jmx4Perl/Product/Weblogic.pm +lib/JMX/Jmx4Perl/Product/Websphere.pm +lib/JMX/Jmx4Perl/Request.pm +lib/JMX/Jmx4Perl/Response.pm +lib/JMX/Jmx4Perl/Util.pm +LICENSE +MANIFEST This list of files +META.json +META.yml +README +scripts/cacti_jmx4perl +scripts/check_jmx4perl +scripts/j4psh +scripts/jmx4perl +scripts/jolokia +t/10_handler.t +t/20_alias.t +t/30_request.t +t/40_check_jmx4perl.t +t/50_config.t +t/60_parse_name.t +t/70_pod_syntax.t +it/t/99_discovery.t +t/j4p_test.cfg +t/lib/It.pm +t/lib/ProductTest/Test1Handler.pm +t/lib/ProductTest/Test2Handler.pm +docker/Dockerfile +docker/README.md diff --git a/META.json b/META.json new file mode 100644 index 0000000..1afc208 --- /dev/null +++ b/META.json @@ -0,0 +1,221 @@ +{ + "abstract" : "Easy JMX access to Java EE applications", + "author" : [ + "Roland Huss (roland@cpan.org)" + ], + "dynamic_config" : 1, + "generated_by" : "Module::Build version 0.4211", + "license" : [ + "gpl_1" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "jmx4perl", + "prereqs" : { + "build" : { + "requires" : { + "Module::Build" : "0.34", + "Test::More" : "0" + } + }, + "configure" : { + "requires" : { + "Module::Build" : "0.34" + } + }, + "runtime" : { + "requires" : { + "Archive::Zip" : "0", + "Carp" : "0", + "Config::General" : "2.34", + "Crypt::Blowfish_PP" : "0", + "Data::Dumper" : "0", + "Digest::MD5" : "0", + "Digest::SHA1" : "0", + "File::SearchPath" : "0", + "File::Temp" : "0", + "Getopt::Long" : "0", + "IO::Socket::Multicast" : "0", + "JSON" : "2.12", + "LWP::UserAgent" : "0", + "Module::Find" : "0", + "Monitoring::Plugin" : "0.37", + "Pod::Usage" : "0", + "Scalar::Util" : "0", + "Sys::SigAction" : "0", + "Term::Clui" : "0", + "Term::ProgressBar" : "0", + "Term::ShellUI" : "0", + "Term::Size" : "0.207", + "Text::ParseWords" : "0", + "Time::HiRes" : "0", + "URI" : "1.35", + "XML::LibXML" : "0", + "XML::Twig" : "0", + "base" : "0" + } + } + }, + "provides" : { + "JMX::Jmx4Perl" : { + "file" : "lib/JMX/Jmx4Perl.pm", + "version" : "1.12" + }, + "JMX::Jmx4Perl::Agent" : { + "file" : "lib/JMX/Jmx4Perl/Agent.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::ArtifactHandler" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/ArtifactHandler.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::DownloadAgent" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/DownloadAgent.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Logger" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Logger::None" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Meta" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Meta.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::ChecksumVerifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/ChecksumVerifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::GnuPGVerifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/GnuPGVerifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::MD5Verifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/MD5Verifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::OpenPGPVerifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/OpenPGPVerifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::PGPKey" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/PGPKey.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::Verifier::SHA1Verifier" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/SHA1Verifier.pm" + }, + "JMX::Jmx4Perl::Agent::Jolokia::WebXmlHandler" : { + "file" : "lib/JMX/Jmx4Perl/Agent/Jolokia/WebXmlHandler.pm" + }, + "JMX::Jmx4Perl::Agent::UserAgent" : { + "file" : "lib/JMX/Jmx4Perl/Agent/UserAgent.pm" + }, + "JMX::Jmx4Perl::Alias" : { + "file" : "lib/JMX/Jmx4Perl/Alias.pm" + }, + "JMX::Jmx4Perl::Alias::Object" : { + "file" : "lib/JMX/Jmx4Perl/Alias/Object.pm" + }, + "JMX::Jmx4Perl::Config" : { + "file" : "lib/JMX/Jmx4Perl/Config.pm" + }, + "JMX::Jmx4Perl::J4psh" : { + "file" : "lib/JMX/Jmx4Perl/J4psh.pm" + }, + "JMX::Jmx4Perl::J4psh::Command" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/Command.pm" + }, + "JMX::Jmx4Perl::J4psh::Command::Global" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/Command/Global.pm" + }, + "JMX::Jmx4Perl::J4psh::Command::MBean" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/Command/MBean.pm" + }, + "JMX::Jmx4Perl::J4psh::Command::Server" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/Command/Server.pm" + }, + "JMX::Jmx4Perl::J4psh::CommandHandler" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/CommandHandler.pm" + }, + "JMX::Jmx4Perl::J4psh::CompletionHandler" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/CompletionHandler.pm" + }, + "JMX::Jmx4Perl::J4psh::ServerHandler" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/ServerHandler.pm" + }, + "JMX::Jmx4Perl::J4psh::Shell" : { + "file" : "lib/JMX/Jmx4Perl/J4psh/Shell.pm" + }, + "JMX::Jmx4Perl::Nagios::CactiJmx4Perl" : { + "file" : "lib/JMX/Jmx4Perl/Nagios/CactiJmx4Perl.pm" + }, + "JMX::Jmx4Perl::Nagios::CheckJmx4Perl" : { + "file" : "lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm" + }, + "JMX::Jmx4Perl::Nagios::MessageHandler" : { + "file" : "lib/JMX/Jmx4Perl/Nagios/MessageHandler.pm" + }, + "JMX::Jmx4Perl::Nagios::SingleCheck" : { + "file" : "lib/JMX/Jmx4Perl/Nagios/SingleCheck.pm" + }, + "JMX::Jmx4Perl::Product::ActiveMQ" : { + "file" : "lib/JMX/Jmx4Perl/Product/ActiveMQ.pm" + }, + "JMX::Jmx4Perl::Product::BaseHandler" : { + "file" : "lib/JMX/Jmx4Perl/Product/BaseHandler.pm" + }, + "JMX::Jmx4Perl::Product::Geronimo" : { + "file" : "lib/JMX/Jmx4Perl/Product/Geronimo.pm" + }, + "JMX::Jmx4Perl::Product::Glassfish" : { + "file" : "lib/JMX/Jmx4Perl/Product/Glassfish.pm" + }, + "JMX::Jmx4Perl::Product::Hadoop" : { + "file" : "lib/JMX/Jmx4Perl/Product/Hadoop.pm" + }, + "JMX::Jmx4Perl::Product::JBoss" : { + "file" : "lib/JMX/Jmx4Perl/Product/JBoss.pm" + }, + "JMX::Jmx4Perl::Product::Jetty" : { + "file" : "lib/JMX/Jmx4Perl/Product/Jetty.pm" + }, + "JMX::Jmx4Perl::Product::Jonas" : { + "file" : "lib/JMX/Jmx4Perl/Product/Jonas.pm" + }, + "JMX::Jmx4Perl::Product::Resin" : { + "file" : "lib/JMX/Jmx4Perl/Product/Resin.pm" + }, + "JMX::Jmx4Perl::Product::SpringDM" : { + "file" : "lib/JMX/Jmx4Perl/Product/SpringDM.pm" + }, + "JMX::Jmx4Perl::Product::Terracotta" : { + "file" : "lib/JMX/Jmx4Perl/Product/Terracotta.pm" + }, + "JMX::Jmx4Perl::Product::Tomcat" : { + "file" : "lib/JMX/Jmx4Perl/Product/Tomcat.pm" + }, + "JMX::Jmx4Perl::Product::Unknown" : { + "file" : "lib/JMX/Jmx4Perl/Product/Unknown.pm" + }, + "JMX::Jmx4Perl::Product::Weblogic" : { + "file" : "lib/JMX/Jmx4Perl/Product/Weblogic.pm" + }, + "JMX::Jmx4Perl::Product::Websphere" : { + "file" : "lib/JMX/Jmx4Perl/Product/Websphere.pm" + }, + "JMX::Jmx4Perl::Request" : { + "file" : "lib/JMX/Jmx4Perl/Request.pm" + }, + "JMX::Jmx4Perl::Response" : { + "file" : "lib/JMX/Jmx4Perl/Response.pm" + }, + "JMX::Jmx4Perl::Util" : { + "file" : "lib/JMX/Jmx4Perl/Util.pm" + } + }, + "release_status" : "stable", + "resources" : { + "license" : [ + "http://opensource.org/licenses/gpl-license.php" + ] + }, + "version" : "1.12" +} diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..ecc258c --- /dev/null +++ b/META.yml @@ -0,0 +1,150 @@ +--- +abstract: 'Easy JMX access to Java EE applications' +author: + - 'Roland Huss (roland@cpan.org)' +build_requires: + Module::Build: '0.34' + Test::More: '0' +configure_requires: + Module::Build: '0.34' +dynamic_config: 1 +generated_by: 'Module::Build version 0.4211, CPAN::Meta::Converter version 2.150001' +license: gpl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: jmx4perl +provides: + JMX::Jmx4Perl: + file: lib/JMX/Jmx4Perl.pm + version: '1.12' + JMX::Jmx4Perl::Agent: + file: lib/JMX/Jmx4Perl/Agent.pm + JMX::Jmx4Perl::Agent::Jolokia::ArtifactHandler: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/ArtifactHandler.pm + JMX::Jmx4Perl::Agent::Jolokia::DownloadAgent: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/DownloadAgent.pm + JMX::Jmx4Perl::Agent::Jolokia::Logger: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm + JMX::Jmx4Perl::Agent::Jolokia::Logger::None: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Logger.pm + JMX::Jmx4Perl::Agent::Jolokia::Meta: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Meta.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::ChecksumVerifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/ChecksumVerifier.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::GnuPGVerifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/GnuPGVerifier.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::MD5Verifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/MD5Verifier.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::OpenPGPVerifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/OpenPGPVerifier.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::PGPKey: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/PGPKey.pm + JMX::Jmx4Perl::Agent::Jolokia::Verifier::SHA1Verifier: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/Verifier/SHA1Verifier.pm + JMX::Jmx4Perl::Agent::Jolokia::WebXmlHandler: + file: lib/JMX/Jmx4Perl/Agent/Jolokia/WebXmlHandler.pm + JMX::Jmx4Perl::Agent::UserAgent: + file: lib/JMX/Jmx4Perl/Agent/UserAgent.pm + JMX::Jmx4Perl::Alias: + file: lib/JMX/Jmx4Perl/Alias.pm + JMX::Jmx4Perl::Alias::Object: + file: lib/JMX/Jmx4Perl/Alias/Object.pm + JMX::Jmx4Perl::Config: + file: lib/JMX/Jmx4Perl/Config.pm + JMX::Jmx4Perl::J4psh: + file: lib/JMX/Jmx4Perl/J4psh.pm + JMX::Jmx4Perl::J4psh::Command: + file: lib/JMX/Jmx4Perl/J4psh/Command.pm + JMX::Jmx4Perl::J4psh::Command::Global: + file: lib/JMX/Jmx4Perl/J4psh/Command/Global.pm + JMX::Jmx4Perl::J4psh::Command::MBean: + file: lib/JMX/Jmx4Perl/J4psh/Command/MBean.pm + JMX::Jmx4Perl::J4psh::Command::Server: + file: lib/JMX/Jmx4Perl/J4psh/Command/Server.pm + JMX::Jmx4Perl::J4psh::CommandHandler: + file: lib/JMX/Jmx4Perl/J4psh/CommandHandler.pm + JMX::Jmx4Perl::J4psh::CompletionHandler: + file: lib/JMX/Jmx4Perl/J4psh/CompletionHandler.pm + JMX::Jmx4Perl::J4psh::ServerHandler: + file: lib/JMX/Jmx4Perl/J4psh/ServerHandler.pm + JMX::Jmx4Perl::J4psh::Shell: + file: lib/JMX/Jmx4Perl/J4psh/Shell.pm + JMX::Jmx4Perl::Nagios::CactiJmx4Perl: + file: lib/JMX/Jmx4Perl/Nagios/CactiJmx4Perl.pm + JMX::Jmx4Perl::Nagios::CheckJmx4Perl: + file: lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm + JMX::Jmx4Perl::Nagios::MessageHandler: + file: lib/JMX/Jmx4Perl/Nagios/MessageHandler.pm + JMX::Jmx4Perl::Nagios::SingleCheck: + file: lib/JMX/Jmx4Perl/Nagios/SingleCheck.pm + JMX::Jmx4Perl::Product::ActiveMQ: + file: lib/JMX/Jmx4Perl/Product/ActiveMQ.pm + JMX::Jmx4Perl::Product::BaseHandler: + file: lib/JMX/Jmx4Perl/Product/BaseHandler.pm + JMX::Jmx4Perl::Product::Geronimo: + file: lib/JMX/Jmx4Perl/Product/Geronimo.pm + JMX::Jmx4Perl::Product::Glassfish: + file: lib/JMX/Jmx4Perl/Product/Glassfish.pm + JMX::Jmx4Perl::Product::Hadoop: + file: lib/JMX/Jmx4Perl/Product/Hadoop.pm + JMX::Jmx4Perl::Product::JBoss: + file: lib/JMX/Jmx4Perl/Product/JBoss.pm + JMX::Jmx4Perl::Product::Jetty: + file: lib/JMX/Jmx4Perl/Product/Jetty.pm + JMX::Jmx4Perl::Product::Jonas: + file: lib/JMX/Jmx4Perl/Product/Jonas.pm + JMX::Jmx4Perl::Product::Resin: + file: lib/JMX/Jmx4Perl/Product/Resin.pm + JMX::Jmx4Perl::Product::SpringDM: + file: lib/JMX/Jmx4Perl/Product/SpringDM.pm + JMX::Jmx4Perl::Product::Terracotta: + file: lib/JMX/Jmx4Perl/Product/Terracotta.pm + JMX::Jmx4Perl::Product::Tomcat: + file: lib/JMX/Jmx4Perl/Product/Tomcat.pm + JMX::Jmx4Perl::Product::Unknown: + file: lib/JMX/Jmx4Perl/Product/Unknown.pm + JMX::Jmx4Perl::Product::Weblogic: + file: lib/JMX/Jmx4Perl/Product/Weblogic.pm + JMX::Jmx4Perl::Product::Websphere: + file: lib/JMX/Jmx4Perl/Product/Websphere.pm + JMX::Jmx4Perl::Request: + file: lib/JMX/Jmx4Perl/Request.pm + JMX::Jmx4Perl::Response: + file: lib/JMX/Jmx4Perl/Response.pm + JMX::Jmx4Perl::Util: + file: lib/JMX/Jmx4Perl/Util.pm +requires: + Archive::Zip: '0' + Carp: '0' + Config::General: '2.34' + Crypt::Blowfish_PP: '0' + Data::Dumper: '0' + Digest::MD5: '0' + Digest::SHA1: '0' + File::SearchPath: '0' + File::Temp: '0' + Getopt::Long: '0' + IO::Socket::Multicast: '0' + JSON: '2.12' + LWP::UserAgent: '0' + Module::Find: '0' + Monitoring::Plugin: '0.37' + Pod::Usage: '0' + Scalar::Util: '0' + Sys::SigAction: '0' + Term::Clui: '0' + Term::ProgressBar: '0' + Term::ShellUI: '0' + Term::Size: '0.207' + Text::ParseWords: '0' + Time::HiRes: '0' + URI: '1.35' + XML::LibXML: '0' + XML::Twig: '0' + base: '0' +resources: + license: http://opensource.org/licenses/gpl-license.php +version: '1.12' diff --git a/README b/README new file mode 100644 index 0000000..5a573e6 --- /dev/null +++ b/README @@ -0,0 +1,148 @@ + Jmx4Perl + ======== + +INTRODUCTION + + Jmx4Perl provides an alternate way for accessing Java JEE Server + management interfaces which are based on JMX (Java Management + Extensions). It is an agent based approach, where a small Java + Webapplication deployed on the application server provides an + HTTP/JSON based access to JMX MBeans registered within the + application server. + +HOW IT WORKS + + For the agent mode a small Java Agent WAR (web archive) needs to be + deployed on the Java application server. This agent is provided by + the Jolokia project (www.jolokia.org). There is no need to add any + startup parameters to the application server and to open any + additional ports. All communication takes places via HTTP where JSON + objects are exchanged. Additionally, the agent benefits from the + security infrastructure in place which every application server + provides for web application. More information about the agent can + be found at http://www.jolokia.org + + The Perl module JMX::Jmx4Perl accesses the deployed agent servlet + and transform the request's results from JSON into a simple Perl + object. + +TOOLS + + This distribution comes with several tools, which uses the + JMX::Jmx4Perl for accessing the server: + + jmx4perl - Command line tool for gathering JMX information + check_jmx4perl - Full featured Nagios Plugin + j4psh - Interactive, readline based JMX shell with context + sensitive command completion + jolokia - Utility for downloading and managing Jolokia + agents. + +INSTALLATION + + The Perl part installs as any other module via Module::Build, which + you need to have installed. Using + + perl Build.PL + ./Build installdeps # If there are dependencies missing and you + # have Module::Build >= 0.36 installed. + ./Build + ./Build test + ./Build install + + will install the modules. It is highly recommended to install the + recommended dependent modules, too to get the full jmx4perl + power. The set of 'required' modules is kept small and guarantees + only that 'jmx4perl' and the modules around JMX::Jmx4Perl are + working properly. The other tools (check_jmx4perl, j4psh and + jolokia) require the recommended modules for proper working. Look + into Build.PL for which tool requires which module. + + In order to download the Jolokia WAR agent into the local directory + as jolokia.war, use the following command + + jolokia + + This agent "jolokia.war" needs to be deployed on the JEE Server to + monitor. Please consult http://www.jolokia.org/agent.html for more + information how to install the agent. E.g. for Tomcat this war file + needs to be copied into the webapps directory. + + To test it, you can use 'jmx4perl' with the URL of the deployed + agent: + + jmx4perl http://:/jolokia + + Consult 'man jmx4perl' for more information about this command + utility. + +RESOURCES + + * Jmx4perl's source is hosted on github.com. You can clone the + repository with git://github.com/rhuss/jmx4perl.git as URL + + * Interesting articles around Jmx4Perl, JMX and Nagios can be found + at http://labs.consol.de Checkout the various post categories for + selecting a specific topic. + + * www.jmx4perl.org is the canonical entry point for jmx4perl related + information. + +NOTE + + For you convenience, the latest Module::Build is included in this + distribution, so there is no need of a locally install Module::Build + for installing this suite. More information about Module::Build can + be found http://search.cpan.org/~dagolden/Module-Build/ + +LICENSE + + Copyright (C) 2009-2011 Roland Huss (roland@cpan.org) + + Jmx4perl is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + jmx4perl is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with jmx4perl. If not, see . + + A commercial license is available as well. You can either apply the + GPL or obtain a commercial license for closed source + development. Please contact roland@cpan.org for further information. + +PROFESSIONAL SERVICES + + Just in case you need professional support for this module (or + Nagios, JMX or JEE in general), you might want to have a look at + http://www.consol.com/nagios-monitoring . Contact + roland.huss@consol.de for further information (or use the contact + form at http://www.consol.com/contact/ ) + +ACKNOWLEDGMENTS + + Big thanks go to ... + + * Gerhard Lausser, who initially pushed me to think harder + about a better way for monitoring JEE Servers with Nagios. + + * Danijel Tasov for patching, patching, patching and keeping + an eye on contemporary perl styling. + + * All bug reporters and blog commenters for helping me to + increase the overall quality (and for letting me know that + this is not software for the ivory tower) + +BUGS + + Please report any bugs and/or feature requests at + http://rt.cpan.org/Public/Bug/Report.html?Queue=jmx4perl + +AUTHOR + + roland@cpan.org diff --git a/config/common.cfg b/config/common.cfg new file mode 100644 index 0000000..78d5bc8 --- /dev/null +++ b/config/common.cfg @@ -0,0 +1,34 @@ + +# Common check definitions which can be used +# as a base for more specific configurations + +# This are mostly convenience, abstract checks +# which are meant to be mixed into more concrete +# checks + +# ================================================= + +# A nice label to be used for relative values + + Label = %.2r% used (%.2v %u / %.2b %w) + # Default values for critical (90%) and warning (80%) thresholds + Critical = ${0:90} + Warning = ${1:80} + + +# A incremental check for values per minute +# $0: used in label to specify what is counted +# per minute + + Label = %2.2f $0/minute + Delta = 60 + + +# A incremental check for values per hour +# $0: used in label to specify what is counted +# per hour + + Label = %2.2f $0/hour + Delta = 3600 + + diff --git a/config/glassfish.cfg b/config/glassfish.cfg new file mode 100644 index 0000000..4e81305 --- /dev/null +++ b/config/glassfish.cfg @@ -0,0 +1,69 @@ +# Glassfish specific checks +# =========================== + + +# ================= +# JMS with Open MQ +# For even more metrics, please refer to http://docs.oracle.com/cd/E19316-01/820-6766/gcakw/index.html + +# Number of messages within a queue +# $0: Name of queue +# $1: Critical (default: 1000) +# $2: Warning (default: 800) + + MBean = com.sun.messaging.jms.server:name="$0",subtype=Monitor,type=Destination,desttype=q + Attribute = NumMsgs + Name = JMS Queue $0 Count + Critical = ${1:1000} + Warning = ${2:800} + + +# Number of messages held for a topic +# $0: Name of queue +# $1: Critical (default: 1000) +# $2: Warning (default: 800) + + MBean = com.sun.messaging.jms.server:name="$0",subtype=Monitor,type=Destination,desttype=t + Attribute = NumMsgs + Name = JMS Topic $0 Count + Critical = ${1:1000} + Warning = ${2:800} + + +# Average number of consumers of a topic or queue +# $0: Name of queue or topic +# $1: Critical (default: 300) +# $2: Warning (default: 200) + + MBean = com.sun.messaging.jms.server:name="$0",subtype=Monitor,type=Destination,* + Attribute = AvgNumConsumers + Name = Average Number of consumers for $0 + Critical = ${1:300} + Warning = ${2:200} + + +# Active number of consumers of a topic or queue +# $0: Name of queue or topic +# $1: Critical (default: 300) +# $2: Warning (default: 200) + + MBean = com.sun.messaging.jms.server:name="$0",subtype=Monitor,type=Destination,* + Attribute = NumActiveConsumers + Name = Number of consumers of $0 + Critical = ${1:300} + Warning = ${2:200} + + +# Size of all messages within a queue or topic +# $0: Name of queue or topic +# $1: Critical (default: 30 MB) +# $2: Warning (default: 20 MB) + + MBean = com.sun.messaging.jms.server:name="$0",subtype=Monitor,type=Destination,* + Attribute = TotalMsgBytes + Name = Size of messages in $0 + Critical = ${1:30000000} + Warning = ${2:20000000} + + + diff --git a/config/jboss.cfg b/config/jboss.cfg new file mode 100644 index 0000000..c043543 --- /dev/null +++ b/config/jboss.cfg @@ -0,0 +1,111 @@ +# JBoss specific checks +# ======================================================== + +# JBoss uses tomcat internally +include tomcat.cfg + +# ======================================================= +# Connection-Pools: + +# Available connections in a connection pool for a data source +# Should be not 0 +# $0: Datasource name + + MBean = *:service=ManagedConnectionPool,name=$0 + Attribute = AvailableConnectionCount + Name = $0 : Available connections + Critical = $1 + Warning = $2 + + +# The reverse: Max. number of connections ever in use +# $0: Datasource name + + MBean = *:service=ManagedConnectionPool,name=$0 + Attribute = MaxConnectionsInUseCount + Name = $0 : Max. connections in use + Critical = $1 + Warning = $2 + + +# Connections currently in use +# $0: Datasource name + + MBean = *:service=ManagedConnectionPool,name=$0 + Attribute = InUseConnectionCount + Name = $0 : Connections in use + Critical = $1 + Warning = $2 + + +# Rate how often connections are created per minute +# $0: Datasource name + + Use = count_per_minute("connections") + MBean = *:service=ManagedConnectionPool,name=$0 + Attribute = ConnectionCreatedCount + Name = $0 : Connection creation rate + Critical = $1 + Warning = $2 + + +# ============================================================= +# Workmanager + +# Ratio of threads used in the JBoss WorkManager + + Use = relative_base + Value = jboss.jca:service=WorkManagerThreadPool/Instance/poolSize + Base = jboss.jca:service=WorkManagerThreadPool/Instance/maximumPoolSize + Label = WorkManager Threads: $BASE + Name = WorkManager Threads + + + + Use = relative_base + Value = jboss.threads:name=WorkManagerThreadPool/CurrentThreadCount + Base = jboss.threads:name=WorkManagerThreadPool/MaxThreads + + Label = WorkManager Threads: $BASE + Name = WorkManager Threads + + +# ============================================================= +# JMS + +# Rate how fast the number of messages in a JMS queue increases +# $0: Queue name +# $1: Critical (default: 1000) +# $2: Warning (default: 800) + + Use = count_per_minute("messages") + MBean = *:name=$0,service=Queue + Attribute = MessageCount + Name = JMS Queue $0 : Message count rate + + +# Number of messages in a JMS queue +# $0: Queue name +# $1: Critical (default: 1000) +# $2: Warning (default: 800) + + MBean = *:name=$0,service=Queue + Attribute = MessageCount + Name = JMS Queue $0 Count + Critical = ${1:1000} + Warning = ${2:800} + + +# Number of messages in a JMS Topic +# $0: Topic name +# $1: Critical (default: 1000) +# $2: Warning (default: 800) + + MBean = *:name=$0,service=Topic + Attribute = AllMessageCount + Name = JMS Topic $0 Count + Critical = ${1:1000} + Warning = ${2:800} + + + diff --git a/config/jboss7.cfg b/config/jboss7.cfg new file mode 100644 index 0000000..546a36f --- /dev/null +++ b/config/jboss7.cfg @@ -0,0 +1,203 @@ +# JBoss 7 specific checks +# ======================================================== + +include "common.cfg" + +# Please note that JBoss 7 changed (/wrt JBoss 6) completely with relation to the +# internal MBean structure + + +# Number of bytes received per minute for a connector +# $0: Name of connector (e.g. 'http-8080') +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("bytes received") + Label = Connector $0 : $BASE + Name = ${3:bytes_received} + Value = jboss.as.expr:connector=$0,*/bytesReceived + Critical = ${1:104857600} + Warning = ${2:83886080} + + +# Number of bytes sent per minute for a connector +# $0: Name of connector (e.g. 'http-8080') +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("bytes sent") + Label = Connector $0 : $BASE + Name = ${3:bytes_sent} + Value = jboss.as.expr:connector=$0,*/bytesSent + Critical = ${1:104857600} + Warning = ${2:83886080} + + +# Increase of overall processing time per minute for a connector +# This checks calculates the processing time for a certain +# interval and scale it to a minute +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Delta = 60 + Label = Connector $0 : %2.0f ms request processing time / minute + Name = ${3:proc_time} + Value = jboss.as.expr:connector=$0,*/processingTime + Critical = ${1:50000} + Warning = ${2:40000} + + +# Requests per minute for a connector +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("requests") + Label = Connector $0 : $BASE + Name = ${3:nr_requests} + Value = jboss.as.expr:connector=$0,*/requestCount + Critical = ${1:1000} + Warning = ${2:900} + + +# Number of errors for a connector per minute. +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Value = jboss.as.expr:connector=$0,*/errorCount + Label = Connector $0: %d errors + Name = ${3:errors} + Critical = ${1:100} + Warning = ${2:90} + Delta = 60 + + +################################################################# + +# Requests per minute for a servlet +# $0: Web-Module name +# $1: Servlet name +# $2: Critical (optional) +# $3: Warning (optional) +# $4: Name (optional) + + MBean = jboss.as.expr:deployment=$0,servlet=$1,subdeployment=*,subsystem=web + Use = count_per_minute("requests") + Attribute = requestCount + Name = ${4:request} + Critical = ${2:6000} + Warning = ${3:5000} + + +# Increase of overall processing time per minute for a servlet module +# This is calculate the processing time for a certain +# interval and extrapolate to a minute +# $0: Webmodule name +# $1: Servlet name +# $2: Critical (optional) +# $3: Warning (optional) +# $4: Name (optional) + + MBean = jboss.as.expr:deployment=$0,servlet=$1,subdeployment=*,subsystem=web + Attribute = processingTime + Delta = 60 + Label = %2.0f ms request processing time / minute + Name = ${3:proc_time} + Critical = ${2:50000} + Warning = ${3:40000} + + +# ======================================================== +# Session related checks + +# Number of active sessions at this moment +# $0: Name of web-module +# $1: Critical (optional) +# $2: Warning (optional) + + MBean = *:deployment=$0,subsystem=web + Attribute = activeSessions + Name = ${3:sessions_active} + Label = $0: Active Sessions = %v + Critical = ${1:1000} + Warning = ${2:800} + + +# Maximum number of active sessions so far +# $0: Name of web-module +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + MBean = *:deployment=$0,subsystem=web + Attribute = maxActive + Name = ${3:sessions_max} + Label = $0: Max-Active Sessions = %v + Critical = ${1:1000} + Warning = ${2:800} + + +# Number of sessions we rejected due to maxActive beeing reached +# $0: Name of web-module +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + MBean = *:deployment=$0,subsystem=web + Attribute = rejectedSessions + Name = ${3:sessions_rejected} + Label = $0: Rejected Sessions = %v + Critical = ${1:500} + Warning = ${2:200} + + +# Average time an expired session had been alive +# in seconds +# $0: Name of web-module +# $1: Critical (7200) +# $2: Warning (7200) +# $3: Name (optional) + + MBean = *:deployment=$0,subsystem=web + Attribute = sessionAverageAliveTime + Name = ${3:sessions_avg_life} + Label = $0: Average session lifetime = %v + Critical = ${1:7200} + Warning = ${2:6400} + + +# Longest time an expired session had been alive +# in seconds +# $0: Name of web-module +# $1: Critical (7200) +# $2: Warning (6400) +# $3: Name (optional) + + MBean = *:deployment=$0,subsystem=web + Attribute = sessionMaxAliveTime + Name = ${3:sessions_max_life} + Label = $0: Maximum session lifetime = %v + Critical = ${1:7200} + Warning = ${2:6400} + + +# Increase rate of sessions per minute +# $0: Name of web-module +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("sessions") + MBean = *:deployment=$0,subsystem=web + Attribute = sessionCounter + Name = ${3:sessions_inc} + Critical = ${1:1000} + Warning = ${2:900} + diff --git a/config/jetty.cfg b/config/jetty.cfg new file mode 100644 index 0000000..4583ee1 --- /dev/null +++ b/config/jetty.cfg @@ -0,0 +1,191 @@ +# Jetty specific checks +# ======================================================== + +include common.cfg + +# Servlet running +# $0: Name of servlet + + MBean = org.mortbay.jetty.servlet:name=$0,* + Attribute = running + String = 1 + Label = $0 running + Name = $0 running + Critical = false + + +# Servlet failed status +# $0: Name of servlet + + MBean = org.mortbay.jetty.servlet:name=$0,* + Attribute = failed + String = 1 + Label = $0 failing + Name = $0 failed + Critical = true + + +# Jetty is low on threads ? + + MBean = org.mortbay.thread:type=queuedthreadpool,* + Attribute = lowOnThreads + String = 1 + Label = Low on threads + Name = LowOnThreads Flag + Critical = true + + +# Ratio between created threads to maximum threads +# $0: Critical value (default: 90%) +# $1: Warning value (default: 80%) + + Use = relative_base($0,$1) + Value = org.mortbay.thread:type=queuedthreadpool,*/threads + Base = org.mortbay.thread:type=queuedthreadpool,*/maxThreads + Name = Jetty-Threads + + +# Server is running + + MBean = org.mortbay.jetty:type=server,* + Attribute = running + String = 1 + Label = Server running + Name = Server running + Critical = false + + +# Server failed + + MBean = org.mortbay.jetty:type=server,* + Attribute = failed + String = 1 + Label = Server failing + Name = ServerFailedFlag + Critical = true + + +# ===================================================================== +# Sessions + +# The maximum number of sessions ever created (overall, all webapps) +# $0: Critical +# $1: Warning + + MBean = org.mortbay.jetty.servlet:type=hashsessionmanager,* + Attribute = maxSessions + Label = Max Sessions = %v + Name = MaxSessions + Critical = $0 + Warning = $1 + + +# The current number of sessions (overall, all webapps) +# $0: Critical (default: 1000) +# $1: Warning (default: 800) + + MBean = org.mortbay.jetty.servlet:type=hashsessionmanager,* + Attribute = sessions + Label = Sessions = %v + Name = Sessions + Critical = ${0:1000} + Warning = ${1:800} + + + +# ===================================================================== +# Requests + +# The overall requests / minute +# 'statsOn' has to be set to true in jetty.xml for letting jetty collects +# statistics information for the overall connector +# $0: Critical (default: 6000) +# $1: Warning (default: 5000) + + Use = count_per_minute("requests") + MBean = org.mortbay.jetty.nio:type=selectchannelconnector,* + Attribute = requests + Name = Requests + Critical = ${0:6000} + Warning = ${1:5000} + + +# Number of accepted connections ('statsOn' must be set) +# $0: Critical (default: 6000) +# $1: Warning (default: 5000) + + Use = count_per_minute("connections") + MBean = org.mortbay.jetty.nio:type=selectchannelconnector,* + Attribute = connections + Name = Connections + Critical = ${0:6000} + Warning = ${1:5000} + + +# Number of open connections ('statsOn' must be set) +# $0: Critical (default: 1000) +# $1: Warning (default: 900) + + MBean = org.mortbay.jetty.nio:type=selectchannelconnector,* + Attribute = connectionsOpen + Name = ConnectionsOpen + Label = Open connections = %v + Critical = ${0:1000} + Warning = ${1:900} + + +# ======================================================================== + +# Add $JETTY_HOME/etc/jetty-stats.xml to the configuration for collecting per +# request duration statistics. +# +# See also http://communitymapbuilder.osgeo.org/display/JETTY/Statistics +# for details + +# Average duration of a request in ms +# $0: Critical (default: 400ms) +# $1: Warning (default: 300ms) + + MBean = org.mortbay.jetty.handler:type=statisticshandler,* + Attribute = requestsDurationAve + Name = RequestDurationAverage + Label = Average Request Duration = %v ms + Critical = ${0:400} + Warning = ${1:300} + + +# Maximum duration of any request in ms +# $0: Critical (default: 400ms) +# $1: Warning (default: 300ms) + + MBean = org.mortbay.jetty.handler:type=statisticshandler,* + Attribute = requestsDurationMax + Name = RequestDurationMaximum + Label = Maximum Request Duration = %v ms + Critical = ${0:1000} + Warning = ${1:900} + + +# Number of Requests per minute +# $0: Critical (default: 6000) +# $1: Warning (default: 5000) + + Use = count_per_minute("requests") + MBean = org.mortbay.jetty.handler:type=statisticshandler,* + Attribute = requests + Name = Requests + Critical = ${0:6000} + Warning = ${1:5000} + + +# Number of currently active requests +# $0: Critical (default: 1000) +# $1: Warning (default: 900) + + MBean = org.mortbay.jetty.handler:type=statisticshandler,* + Attribute = requestsActive + Name = ActiveRequests + Label = Active Requests = %v + Critical = ${0:1000} + Warning = ${1:900} + diff --git a/config/memory.cfg b/config/memory.cfg new file mode 100644 index 0000000..d39b053 --- /dev/null +++ b/config/memory.cfg @@ -0,0 +1,200 @@ +# Memory checks +# ============================================ + +include common.cfg + +# Base definition for memory relative checks +# (i.e. checks with a base value). Should +# not be used directly + + Use = relative_base($0,$1) + Unit = B + BaseUnit = B + + +# Relative Heap Memory used by the application. This +# is the ratio between used heap memory and the maximal +# available heap memory +# $0: Critical value (optional) +# $1: Warning value (optional) + + Use = memory_relative_base($0,$1) + Value = java.lang:type=Memory/HeapMemoryUsage/used + Base = java.lang:type=Memory/HeapMemoryUsage/max + Label = Heap-Memory: $BASE + Name = Heap + MultiCheckPrefix + + +# Relative non-heap memory. The JVM has memory other than the heap, +# referred to as non-heap memory. It stores per-class structures such +# as runtime constant pool, field and method data, and the code for +# methods and constructors, as well as interned Strings. More detailed +# information can be obtained from the pool checks defined below +# $0: Critical value (optional) +# $1: Warning value (optional) + + Use = memory_relative_base + Value = java.lang:type=Memory/NonHeapMemoryUsage/used + Base = java.lang:type=Memory/NonHeapMemoryUsage/max + Label = Non-Heap-Memory: $BASE + Name = Non-Heap + MultiCheckPrefix + + +# Java 8 Memory check for MetaSpace. Metaspace is typically unbounded +# and grows into native (OS) memory. Hence, an absolute thresshold is used +# here which by default is (C: 80M, W: 60M). + + Unit = B + Label = %.2v %u meta space used + Value = java.lang:name=Metaspace,type=MemoryPool/Usage/used + Name = MetaSpace + Critical = ${0:83886080} + Warning = ${1:62914560} + MultiCheckPrefix + + +# Java 8 Memory check for MetaSpace with an upper configued (-XX:MetaSpaceSize) + + Use = memory_relative_base + Value = java.lang:name=Metaspace,type=MemoryPool/Usage/used + Base = java.lang:name=Metaspace,type=MemoryPool/Usage/max + Label = MetaSpace: $BASE + Name = MetaSpace + MultiCheckPrefix + + +# ============================================================= +# Memory pool checks. These are specific to a Sun/Oracle JVM. + +# Base definition for pool based checks +# $0: Label prefix and name to used +# $1: Critical value (optional) +# $2: Warning value (optional) + + Use = memory_relative_base($1,$2) + Value = java.lang:type=MemoryPool,name=$0/Usage/used + Base = java.lang:type=MemoryPool,name=$0/Usage/max + Label = $0 : $BASE + Name = $0 + + +# Base definition for garbage collection count +# This checks count the number of garbage collections per +# minute +# $0: Name of garbage collector (used as Label as well) +# $1: Critical value (default: 30) +# $2: Warning value (default: 20) + + Use = count_per_minute("GC count") + Value = java.lang:type=GarbageCollector,name=$0/CollectionCount + + Label = $0 : $BASE + Name = $0 count + Critical = ${1:30} + Warning = ${2:20} + + +# Base definition for garbage time measurements +# This checks measure the ratio the garbage collection takes from a minute +# (e.g. how many percent of a minute is used for garbage collecting) + +# $0: Name of garbage collector (used as Label as well) +# $1: Critical value in percent (default: 20) +# $2: Warning value in percent (default: 10) + +# WARNING: THIS CHECK HAS CHANGED IN 1.08. Remove the 'Base' and adapt the label +# to obtain the old behaviour. + + Value = java.lang:type=GarbageCollector,name=$0/CollectionTime + + Label = %2.2r% GC Overhead + Name = $0 time + + Delta 60 + + # Next line switches on relative checking to get the percentual overhead + # for a garbage collection + Base = 60000 + + Critical = ${1:20} + Warning = ${2:10} + + +# The paralled garbage collectors and memory +# pools switched on with -XX:+UseParallelGC. +# Used by 64bit server VMs by default. + + Check = memory_pool_base("PS Eden Space",100,100) + Check = memory_pool_base("PS Survivor Space",100,100) + Check = memory_pool_base("PS Old Gen") + Check = memory_pool_base("PS Perm Gen") + + + + Check = memory_gc_count_base("PS Scavenge") + Check = memory_gc_count_base("PS MarkSweep") + + +# Since 1.08: Relative time instead of absolute values. + + Check = memory_gc_time_base("PS Scavenge") + Check = memory_gc_time_base("PS MarkSweep") + + +# Garbage collectors and memory pools used for +# -XX:+UseConcMarkSweepGC and -XX:+UseParNewGC +# used by default by OS X, client vm. + + Check = memory_pool_base("Par Eden Space") + Check = memory_pool_base("Par Survivor Space") + Check = memory_pool_base("CMS Old Gen") + Check = memory_pool_base("CMS Perm Gen") + + + + Check = memory_gc_count_base("ParNew") + Check = memory_gc_count_base("ConcurrentMarkSweep") + + +# Since 1.08: Relative time instead of absolute values. + + Check = memory_gc_time_base("ParNew") + Check = memory_gc_time_base("ConcurrentMarkSweep") + + + +# Garbage collector and memory pools used +# when -XX:+UseSerialGC is used. Seems to be the default +# on linux for -client and -server VMs + + Check = memory_pool_base("Eden Space") + Check = memory_pool_base("Survivor Space") + Check = memory_pool_base("Tenured Gen") + Check = memory_pool_base("Perm Gen") + + + + Check = memory_gc_count_base("Copy") + Check = memory_gc_count_base("MarkSweepCompact") + + +# Since 1.08: Relative time instead of absolute values. + + Check = memory_gc_time_base("Copy") + Check = memory_gc_time_base("MarkSweepCompact") + + + + Use = memory_pool_base("Code Cache") + + +# ================================================ +# Collection of related checks. + +# Overall view to the memory statistics + + Check memory_heap + Check memory_non_heap + diff --git a/config/metrics.cfg b/config/metrics.cfg new file mode 100644 index 0000000..4ca0622 --- /dev/null +++ b/config/metrics.cfg @@ -0,0 +1,43 @@ +# Checks for Metrics (http://metrics.codahale.com/) +# ================================================= + + + + MBean = $0:type=$1,name=$2 + Label = $0.$2 / $1 + + +# +# +# + + Use = metrics_base($1,$2,$3) + Attribute = $0 + Label = $0 for $BASE : %v %u + Name = $0 + Critical = $4 + Warning = $5 + Unit = ${6:ms} + + + + Check metrics_timer_base("Mean",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("StdDev",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("Min",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("Max",$0,$1,$2,$3,$4,$5) + + + + Check metrics_timer_base("50thPercentile",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("75thPercentile",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("95thPercentile",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("99thPercentile",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("999thPercentile",$0,$1,$2,$3,$4,$5) + + + + Check metrics_timer_base("MeanRate",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("OneMinuteRate",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("FiveMinuteRate",$0,$1,$2,$3,$4,$5) + Check metrics_timer_base("FifteenMinuteRate",$0,$1,$2,$3,$4,$5) + diff --git a/config/threads.cfg b/config/threads.cfg new file mode 100644 index 0000000..60df925 --- /dev/null +++ b/config/threads.cfg @@ -0,0 +1,37 @@ +# Predefined checks for fetching thread statistics +# from MXBeans +# ================================================== + +include common.cfg + +# Check for a thread increase per minute +# $0 : Critical threshold (default: 60) +# $1 : Warning threshold (default: 30) + + Use = count_per_minute("Threads") + Value = java.lang:type=Threading/ThreadCount + Name = Thread-Increase + Critical = ${0:~:60} + Warning = ${1:~:30} + + +# Check for monitoring the total (absolute) count of threads +# active within an application +# $0 : Critical threshold (default: 1000) +# $1 : Warning threshold (default: 800) + + Value = java.lang:type=Threading/ThreadCount + Name = Thread-Count + Critical = ${0:1000} + Warning = ${1:800} + + +# Find deadlocked Threads + + MBean = java.lang:type=Threading + Operation = findDeadlockedThreads + Null = no deadlock + Name = Thread-Deadlock + String = 1 + Critical = !no deadlock + diff --git a/config/tomcat.cfg b/config/tomcat.cfg new file mode 100644 index 0000000..3f5bea4 --- /dev/null +++ b/config/tomcat.cfg @@ -0,0 +1,245 @@ +# Tomcat specific checks +# ======================================================== + +include common.cfg + +# Requests per minute for a servlet +# $0: Web-Module name +# $1: Servlet name +# $2: Critical (optional) +# $3: Warning (optional) +# $4: Name (optional) + + MBean = *:j2eeType=Servlet,WebModule=$0,name=$1,* + Use = count_per_minute("requests") + Attribute = requestCount + Name = ${4:request} + Critical = ${2:6000} + Warning = ${3:5000} + + +# Check whether an webmodule (can contain multiple servlets) +# is running +# $0: Webmodule name (sth like "//localhost/j4p") +# $1: Name (optional) + + MBean = *:j2eeType=WebModule,name=$0,* + Attribute = state + String = 1 + Label = $0 running + Name = ${1:running} + Critical = !1 + + +# Increase of overall processing time per minute for a web module +# This is calculate the processing time for a certain +# interval and extrapolate to a minute +# $0: Webmodule name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + MBean = *:j2eeType=WebModule,name=$0,* + Attribute = processingTime + Delta = 60 + Label = %2.0f ms request processing time / minute + Name = ${3:proc_time} + Critical = ${1:50000} + Warning = ${2:40000} + + +# ======================================================== +# Session related checks + +# Number of active sessions at this moment +# $0: Path name without leading slash +# $1: Critical (optional) +# $2: Warning (optional) + + MBean = *:path=/$0,type=Manager,* + Attribute = activeSessions + Name = ${3:sessions_active} + Label = $0: Active Sessions = %v + Critical = ${1:1000} + Warning = ${2:800} + + +# Maximum number of active sessions so far +# $0: Path name without leading slash +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + MBean = *:path=/$0,type=Manager,* + Attribute = maxActive + Name = ${3:sessions_max} + Label = $0: Max-Active Sessions = %v + Critical = ${1:1000} + Warning = ${2:800} + + +# Number of sessions we rejected due to maxActive beeing reached +# $0: Path name without leading slash +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + MBean = *:path=/$0,type=Manager,* + Attribute = rejectedSessions + Name = ${3:sessions_rejected} + Label = $0: Rejected Sessions = %v + Critical = ${1:500} + Warning = ${2:200} + + +# Average time an expired session had been alive +# in seconds +# $0: Path name without leading slash +# $1: Critical (7200) +# $2: Warning (7200) +# $3: Name (optional) + + MBean = *:path=/$0,type=Manager,* + Attribute = sessionAverageAliveTime + Name = ${3:sessions_avg_life} + Label = $0: Average session lifetime = %v + Critical = ${1:7200} + Warning = ${2:6400} + + +# Longest time an expired session had been alive +# in seconds +# $0: Path name without leading slash +# $1: Critical (7200) +# $2: Warning (6400) +# $3: Name (optional) + + MBean = *:path=/$0,type=Manager,* + Attribute = sessionMaxAliveTime + Name = ${3:sessions_max_life} + Label = $0: Maximum session lifetime = %v + Critical = ${1:7200} + Warning = ${2:6400} + + +# Increase rate of sessions per minute +# $0: Path name without leading slash +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("sessions") + MBean = *:path=/$0,type=Manager,* + Attribute = sessionCounter + Name = ${3:sessions_inc} + Critical = ${1:1000} + Warning = ${2:900} + + +# ============================================================= +# Connector related checks + +# Number of connector threads in relation to maximum +# allowed connector threads +# $0: Name of connector (e.g. 'http-8080') +# $1: Critical (optional) +# $2: Warning (optional) + + Use = relative_base($1,$2) + Label = Connector $0 : $BASE + Name = ${3:connector_threads} + Value = *:type=ThreadPool,name=$0/currentThreadsBusy + Base = *:type=ThreadPool,name=$0/maxThreads + + + +# Number of bytes received per minute for a connector +# $0: Name of connector (e.g. 'http-8080') +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("bytes received") + Label = Connector $0 : $BASE + Name = ${3:bytes_received} + Value = *:type=GlobalRequestProcessor,name=$0/bytesReceived + Critical = ${1:104857600} + Warning = ${2:83886080} + + +# Number of bytes sent per minute for a connector +# $0: Name of connector (e.g. 'http-8080') +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("bytes sent") + Label = Connector $0 : $BASE + Name = ${3:bytes_sent} + Value = *:type=GlobalRequestProcessor,name=$0/bytesSent + Critical = ${1:104857600} + Warning = ${2:83886080} + + +# Increase of overall processing time per minute for a connector +# This checks calculates the processing time for a certain +# interval and scale it to a minute +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Delta = 60 + Label = Connector $0 : %2.0f ms request processing time / minute + Name = ${3:proc_time} + Value = *:type=GlobalRequestProcessor,name=$0/processingTime + Critical = ${1:50000} + Warning = ${2:40000} + + +# Requests per minute for a connector +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Use = count_per_minute("requests") + Label = Connector $0 : $BASE + Name = ${3:nr_requests} + Value = *:type=GlobalRequestProcessor,name=$0/requestCount + Critical = ${1:1000} + Warning = ${2:900} + + +# Number of errors for a connector per minute. +# $0: Connector name +# $1: Critical (optional) +# $2: Warning (optional) +# $3: Name (optional) + + Value = *:type=GlobalRequestProcessor,name=$0/errorCount + Label = Connector $0: %d errors + Name = ${3:errors} + Critical = ${1:100} + Warning = ${2:90} + Delta = 60 + + +# ================================================================== +# Relative DB Pool check (active connection vs. maximal available connections) +# Note that you need to register the datasource globally in order +# to access the Pool statistics (i.e. within the sections) +# See http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html +# for more information +# $0: JNDI-Name of datasource (e.g. jdbc/TestDB) +# $1: Critical value (optional) +# $2: Warning value (optional) +# $3: Name (optional) + + Value = *:name="$0",type=DataSource,*/numActive + Base = *:name="$0",type=DataSource,*/maxActive + Name = ${3:dbpool_used} + Label = %.2r% DB connections used (%v %u active / %b %w max) + Critical = ${1:90} + Warning = ${2:80} + \ No newline at end of file diff --git a/config/weblogic.cfg b/config/weblogic.cfg new file mode 100644 index 0000000..02eb6af --- /dev/null +++ b/config/weblogic.cfg @@ -0,0 +1,95 @@ +# Weblogic specific checks +# ======================================================== + +include common.cfg + + + Use = count_per_minute("bytes received") + Label = Channel $0 : $BASE + Name = bytes_received + Value = *:Name=$0,Type=ServerChannelRuntime,*/BytesReceivedCount + Critical = ${1:104857600} + Warning = ${2:83886080} + + + + Use = count_per_minute("bytes sent") + Label = Channel $0 : $BASE + Name = bytes_sent + Value = *:Name=$0,Type=ServerChannelRuntime,*/BytesSentCount + Critical = ${1:104857600} + Warning = ${2:83886080} + + + + Label = Channel $0 : %4.4v active connections + Name = connections + Value = *:Name=$0,Type=ServerChannelRuntime,*/ConnectionsCount + Critical = ${1:1000} + Warning = ${2:800} + + + + Value = *:Type=WebAppComponentRuntime,ApplicationRuntime=$0,*/DeploymentState + String = 1 + Label = $0 is running + Name = running + Critical = !1 + + + + Value = *:Type=ServletRuntime,ApplicationRuntime=$0,Name=$1,*/ExecutionTimeAverage + Label = $0 [$1] : Average execution time %d ms + Name = servlet_avg_execution_time + Critical = ${2:20000} + Warning = ${3:10000} + + + + Value = *:Type=WseeOperationRuntime,ApplicationRuntime=$0,Name=$1,*/ExecutionTimeAverage + Label = WS $0 [$1] : Average execution time %d ms + Name = ws_avg_execution_time + Critical = ${2:150000} + Warning = ${3:100000} + + + + Value = *:Type=WseeOperationRuntime,ApplicationRuntime=$0,Name=$1,*/ResponseTimeAverage + Label = WS $0 [$1] : Average response time %d ms + Name = ws_avg_execution_time + Critical = ${2:150000} + Warning = ${3:100000} + + + + Value = *:Type=WseeOperationRuntime,ApplicationRuntime=$0,Name=$1,*/ResponseErrorCount + Label = WS $0 [$1] : Response error count %d + Name = ws_response_errors + Critical = ${2:10} + Warning = ${3:5} + + + + Value = *:Type=WorkManagerRuntime,ApplicationRuntime=$0,Name=$1,*/PendingRequests + Label = WorkManager $0 [$1] : Pending requests %d + Name = ws_wm_pending_requests + Critical = ${2:10} + Warning = ${3:5} + + + + Value = *:Type=WorkManagerRuntime,ApplicationRuntime=$0,Name=$1,*/StuckThreadCount + Label = WorkManager $0 [$1] : Stuck threads %d + Name = ws_wm_stuck_threads + Critical = ${2:10} + Warning = ${3:5} + + + + Value = *:Type=WebAppComponentRuntime,ApplicationRuntime=$0,*/OpenSessionsCurrentCount + Label = Webapp $0 : Open sessions %d + Name = ws_webapp_sessions + Critical = ${1:2000} + Warning = ${2:1500} + + diff --git a/config/websphere.cfg b/config/websphere.cfg new file mode 100644 index 0000000..cbfa397 --- /dev/null +++ b/config/websphere.cfg @@ -0,0 +1,30 @@ +# Websphere Checks +# ---------------- + +# These checks are for WebSphere and has been tested for WebSphere >= 8.0 +# (but should workd with older WebSphere servers as well). + +# For most of the test it is required that a customzied Jolokia agent is used +# which provides simplified access to JSR-77 metrics. +# +# These agents can be obtained from the 'jolokia-extra' project: https://github.com/rhuss/jolokia-extra +# or downloaded from Maven central: http://central.maven.org/maven2/org/jolokia/extra/ +# They all have an classifier "-jsr77" and the first three parts of the version specify +# the Jolokia core version included. +# E.g. "jolokia-extra-war-1.2.2.2-jsr77.war" contains Jolokia 1.2.2 (and is the second variant with +# the JSR-77 specifier) + +# Most of these tests utilize the PMI subsystem of WebSphere. + +# =============================================================== +# Including various checks. These config files are self contained, +# and for performance optimizations could be included separately if only +# some checks are needed. + +include websphere/threads.cfg +include websphere/http.cfg +include websphere/jdbc.cfg +include websphere/jms.cfg +include websphere/jca.cfg +include websphere/appstate.cfg + diff --git a/config/websphere/appstate.cfg b/config/websphere/appstate.cfg new file mode 100644 index 0000000..28f2632 --- /dev/null +++ b/config/websphere/appstate.cfg @@ -0,0 +1,13 @@ +# --------------------------------------- +# Check of the application state +# +# $0: application name + + MBean WebSphere:j2eeType=J2EEApplication,J2EEName=${0},* + Attribute state + + Critical = ${1:1} + Label = $0 : status = %v + Name = $0-state + + diff --git a/config/websphere/http.cfg b/config/websphere/http.cfg new file mode 100644 index 0000000..7ddea20 --- /dev/null +++ b/config/websphere/http.cfg @@ -0,0 +1,129 @@ +# ============================================ +# HTTP Checks + +include threads.cfg + +# HTTP Thread Pool Utilization +# Check of relative pool size, i.e. the ratio between actual created threads +# to the number of maximal available threads. + + Use was_thread_pool_size('WebContainer',$0,$1) + + +# Relative check of all active threads out of the threadpool for the web container + + Use was_thread_pool_active('WebContainer',$0,$1) + + +# Web-Sessions + +# Check for the number of session uses. The maximal number of sessions is not available +# and should be provided as argument to this check (default is 200). +# +# A unique part of the name contained in the 'mbeanIdentifier' key of the MBean +# must be used for the name (e.g. 'jolokia' for the Jolokia agent). +# +# $0: Unique part of the name of the web app (see above) +# $1: Maximum number of session (default: 200) +# $2: Critical (default: 90%) +# $3: Warning (default: 80%) + + MBean WebSphere:type=SessionManager,mbeanIdentifier=*${0}*,* + Attribute stats + Path */*/statistics/LiveCount/current + + # Base value as the number of maximal possible sessions + # (or if a proper MBean attribute is found, this could be inserted here) + Base ${1:200} + + Critical ${2:90} + Warning ${3:80} + + Label $0 : %.2r% sessions in use (%v / %b) + Name ${0}-http-sessions + + +# HTTP Request Count +# Check for the number of requests per minute for a specific servlet. +# +# $0: Part of the servlet name (see above) +# $1: Critical as requests / minute (no default) +# $2: Warning as requests / minute (no default) + + Use was_request_count($0,$1,$2) + MBean WebSphere:type=Servlet,mbeanIdentifier=*${0}*,* + + +# Check for the number of requests per minute for a specific JSP +# +# $0: Part of the JSP name (see above) +# $1: Critical as requests / minute (1000) +# $2: Warning as requests / minute (800) + + Use was_request_count($0,$1,$2) + MBean WebSphere:type=JSP,mbeanIdentifier=*${0}*,* + + +# Base Check for requests counts (servlet or JSPs) +# $0: Part of the servlet name (see above) +# $1: Critical as requests / minute (1000) +# $2: Warning as requests / minute (800) + + Attribute stats + Path */*/statistics/RequestCount/count + Delta 60 + + Critical ${1:1000} + Warning ${2:800} + + Label $0 : %2.2q requests / minute + Name ${0}-request-count + + +# HTTP Service Time +# +# Check of average processing time per request for a servlet. +# +# $0: Part of the servlet name (see above) +# $1: Critical (default: 10000ms) +# $2: Warning (default: 5000ms) + + Use was_service_time($0,$1,$2) + MBean WebSphere:type=Servlet,mbeanIdentifier=*${0}*,* + BaseMBean WebSphere:type=Servlet,mbeanIdentifier=*${0}*,* + + +# Check of average processing time per request for a JSP +# +# $0: Part of JSP name (see above) +# $1: Critical (default: 10000ms) +# $2: Warning (default: 5000ms) + + Use was_service_time($0,$1,$2) + MBean WebSphere:type=JSP,mbeanIdentifier=*${0}*,* + BaseMBean WebSphere:type=JSP,mbeanIdentifier=*${0}*,* + + +# Base check for total service time checks (suggestion for +# improvements: Currently the overall average is measured. It would be +# much better to use only the average till the last +# measurement. Therefore a "Delta" should be used (without +# normalization), but unfortunately the base value is not used as 'delta' +# yet. + + Attribute stats + Path */*/statistics/ServiceTime/totalTime + + BaseAttribute stats + BasePath */*/statistics/ServiceTime/count + + Delta + + # * 100 because the value is a 'relative' check typical used for percentages + Critical{1:1000000} + Warning ${2:500000} + + Label %2.2q ms ∅ processing time per request (%v ms total for %b requests) + Name $0-request-processing-time + + diff --git a/config/websphere/jca.cfg b/config/websphere/jca.cfg new file mode 100644 index 0000000..8801aa9 --- /dev/null +++ b/config/websphere/jca.cfg @@ -0,0 +1,43 @@ +# =============================================================== +# JCA + +# JCA connector pool usage +# +# ${0} : part of the JCA connector name +# ${1} : Managed Connection Factory Name (JCA) +# ${2} : Critical (default: 90 percent) +# ${3} : Warning (default: 80 percent) + + MBean WebSphere:j2eeType=JCAResource,mbeanIdentifier=*${0}*,* + Attribute stats + Path */*/connectionPools/${1}/statistics/PercentUsed/current + + Critical ${2:90} + Warning ${3:80} + + Label $1 : %2.0f% connections used + Name jca-${1}-${0}-pool + + +# Average waiting time until a JCA connector is available +# +# ${0} : part of the JCA resource name as it appears in the mbeanIdentifier +# ${1} : Managed Connection Factory Name (JCA) +# ${2} : Critical (default: 10s) +# ${3} : Warning (default: 5s) + + MBean WebSphere:j2eeType=JCAResource,mbeanIdentifier=*${0}*,* + Attribute stats + Path */*/connectionPools/${1}/statistics/WaitTime/totalTime + + BaseMBean WebSphere:j2eeType=JCAResource,mbeanIdentifier=${0},* + BaseAttribute stats + BasePath */*/connectionPools/${1}/statistics/WaitTime/count + + Critical ${2:10000} + Warning ${3:5000} + + Label $1: %2.2q ms ∅ wait time (%v ms total for %b requests) + Name jca-${1}-${0}-wait-time + + diff --git a/config/websphere/jdbc.cfg b/config/websphere/jdbc.cfg new file mode 100644 index 0000000..3213d68 --- /dev/null +++ b/config/websphere/jdbc.cfg @@ -0,0 +1,88 @@ +# ============================================================================== +# JDBC Datasources + +# JDBC Poolsize Check. This check requires two parameters at least: +# The name of th JDBC Provider and the data source name. It must be ensured that +# the pattern used in this check must result in a single data source only. +# +# In order to specify this even further, a fourth parameter can be used to +# match on part of the mbeanIdentifier. +# +# ${0} : Name of the JDBC Provider +# ${1} : DataSource Name +# ${2} : Critical (default: 90%) +# ${3} : Warning (default: 80%) +# ${4} : Part of mbeanIdentifier (default: *) + + + MBean WebSphere:j2eeType=JDBCResource,name=${0},mbeanIdentifier=${4:*},* + Attribute stats + Path */*/connectionPools/${1}/statistics/PercentUsed/current + + Critical ${2:90} + Warning ${3:80} + + Label $1 : %2.0f % DB Connections used + Name jdbc-$0-connections + + +# Average wait time until a connection is obtained + +# ${0} : Name of the JDBC Provider +# ${1} : Datasource name +# ${2} : Critical (default: 10s) +# ${3} : Warning (default: 5s) +# ${4} : Part of mbeanIdentifier (default: *) + + MBean WebSphere:j2eeType=JDBCResource,name=${0},mbeanIdentifier=${4:*},* + Attribute stats + Path */*/connectionPools/${1}/statistics/WaitTime/totalTime + + BaseMBean WebSphere:j2eeType=JDBCResource,name=${0},mbeanIdentifier=${4:*},* + BaseAttribute stats + BasePath */*/connectionPools/${1}/statistics/WaitTime/count + + Critical ${2:10000} + Warning ${3:5000} + + Label $1: %2.2q ms ∅ waiting time (%v ms total for %b requests) + Name jdbc-$0-average-wait-time + + +# Check for the number of rolled back transactions +# +# $0: Part of the MBean identifier +# $1: Critical as rollback count / minute +# $2: Warning as rollback count / minute + + Use was_transaction_count($0,"RolledbackCount",$1,$2) + + +# Check for the number of active transactions +# +# $0: Part of the MBean identifier +# $1: Critical as rollback count / minute +# $2: Warning as rollback count / minute + + Use was_transaction_count($0,"ActiveCount",$1,$2) + + +# Base-Check for the number of transactions +# +# $0: Part of the MBean identifier +# $1: Attribute name +# $2: Critical as rollback count / minute +# $3: Warning as rollback count / minute + + MBean WebSphere:type=TransactionService,mbeanIdentifier=*${0}*,* + Attribute stats + Path */*/statistics/${1}/count + Delta 60 + + Critical ${2:10} + Warning ${3:5} + + Label $0 : %2.2q ${1} / minute + Name $1-$0-transaction + + diff --git a/config/websphere/jms.cfg b/config/websphere/jms.cfg new file mode 100644 index 0000000..62e2d25 --- /dev/null +++ b/config/websphere/jms.cfg @@ -0,0 +1,44 @@ +# ======================================================= +# WebSphere JMS checks + +# Check the number of message in a queue +# +# $0: Queue Name +# $1: Critical Threshold (default: 10) +# $2: Warning Threshold (default: 5) + + MBean WebSphere:type=SIBQueuePoint,name=${0},* + Attribute depth + + # Messages Thresshold + Critical ${1:10} + Warning ${2:5} + + Label %v messages in queue ${0} + Name jms-{0}-queue + + +# PMI metrics available over UI but not still via JMX ? --> + +# Queues.QueueStats.LocalProducerAttachesCount +# Queues.QueueStats.LocalProducerCount +# Queues.QueueStats.LocalConsumerAttachesCount +# Queues.QueueStats.LocalConsumerCount +# Queues.QueueStats.TotalMessagesProducedCount +# Queues.QueueStats.BestEffortNonPersistentMessagesProducedCount +# Queues.QueueStats.ExpressNonPersistentMessagesProducedCount +# Queues.QueueStats.ReliableNonPersistentMessagesProducedCount +# Queues.QueueStats.ReliablePersistentMessagesProducedCount +# Queues.QueueStats.AssuredPersistentMessagesProducedCount +# Queues.QueueStats.TotalMessagesConsumedCount +# Queues.QueueStats.BestEffortNonPersistentMessagesConsumedCount +# Queues.QueueStats.ExpressNonPersistentMessagesConsumedCount +# Queues.QueueStats.ReliableNonPersistentMessagesConsumedCount +# Queues.QueueStats.ReliablePersistentMessagesConsumedCount +# Queues.QueueStats.AssuredPersistentMessagesConsumedCount +# Queues.QueueStats.ReportEnabledMessagesExpiredCount +# Queues.QueueStats.AggregateMessageWaitTime +# Queues.QueueStats.LocalMessageWaitTime +# Queues.QueueStats.LocalOldestMessageAge +# Queues.QueueStats.AvailableMessageCount +# Queues.QueueStats.UnavailableMessageCount \ No newline at end of file diff --git a/config/websphere/threads.cfg b/config/websphere/threads.cfg new file mode 100644 index 0000000..ad78a57 --- /dev/null +++ b/config/websphere/threads.cfg @@ -0,0 +1,45 @@ +# ============================================ +# Thread Pool Checks + +# Generic Thread-Pool Check for the size of a Thread-Pool +# +# $0: Name of ThreadPool (z.B. "WebContainer") +# $1: Critical (default: 90%) +# $2: Warning (default: 80%) + + Use was_thread_pool($0,'PoolSize',$1,$2) + Label $0: %2.2r% threads used (%v / %b) + + +# Generic Thread-Pool Check for the number of active threads +# within the thread pool +# +# $0: Name of ThreadPool (z.B. "WebContainer") +# $1: Critical (default: 90%) +# $2: Warning (default: 80%) + + Use was_thread_pool($0,'ActiveCount',$1,$2,) + Label $0: %2.2r% active threads (%v / %b) + + +# Base Check for thread-pools checks +# $0: Name of ThreadPool (z.B. "WebContainer") +# $1: Attribute (PoolSize or ActiveCount) +# $2: Critical (default: 90%) +# $3: Warning (default: 80%) + + MBean WebSphere:name=${0},type=ThreadPool,* + Attribute stats + Path */*/statistics/${1}/current + + BaseMBean WebSphere:name=${0},type=ThreadPool,* + BaseAttribute stats + BasePath */*/statistics/${1}/upperBound + + Critical ${2:90} + Warning ${3:80} + + Label = ${0}: %.2r% Threads [${1}] (%v / %b) + Name = ${0}-${1}-threadpool + + diff --git a/config/wildfly.cfg b/config/wildfly.cfg new file mode 100644 index 0000000..28218b2 --- /dev/null +++ b/config/wildfly.cfg @@ -0,0 +1,134 @@ +# Wildfly (JBoss AS 8) specific checks +# ======================================================== + +include "common.cfg" + +# Wildfly use Undertow instead of Tomcat as its servlet container, +# webapp specific metrics changed completely. + +# Requests per minute for a servlet within a deployed war +# $0: Web-Module name (i.e. the WAR file name) +# $1: Servlet name +# $2: Critical (optional) +# $3: Warning (optional) +# $4: Descriptive name (optional) + + MBean = jboss.as.expr:subsystem=undertow,deployment=$0,servlet=$1,* + Use = count_per_minute("requests") + Attribute = requestCount + Name = ${4:request} + Critical = ${2:6000} + Warning = ${3:5000} + + +# Average request processing time for a servlet within a deployed war +# $0: Web-Module name (i.e. the WAR file name) +# $1: Servlet name +# $2: Critical (optional) +# $3: Warning (optional) +# $4: Descriptive name (optional) + + Value = jboss.as.expr:subsystem=undertow,deployment=$0,servlet=$1,*/totalRequestTime + Base = jboss.as.expr:subsystem=undertow,deployment=$0,servlet=$1,*/requestCount + Delta + Label = $0 : $1 : %2.2f ms average request time + Name = ${4:$0-$1-request-time} + Critical = ${2:6000} + Warning = ${3:5000} + + +# Requests per minute for a servlet, deployed as part of an ear +# $0: EAR Module (name of the EAR file) +# $1: Web-Module name (i.e. the WAR file name within the EAR) +# $2: Servlet name +# $3: Critical (optional) +# $4: Warning (optional) +# $5: Descriptive name (optional) + + MBean = jboss.as.expr:subsystem=undertow,deployment=$0,subdeployment=$1,servlet=$2,* + Use = count_per_minute("requests") + Attribute = requestCount + Name = ${5:request} + Critical = ${3:6000} + Warning = ${2:5000} + + +# Average request processing time, deployed as part of an ear +# $0: EAR Module name (i.e. the EAR file name) +# $1: Web-Module name (i.e. the WAR file name) +# $2: Servlet name +# $3: Critical (optional) +# $4: Warning (optional) + + Value = jboss.as.expr:subsystem=undertow,deployment=$0,subdeployment=$1,servlet=$2,*/totalRequestTime + Base = jboss.as.expr:subsystem=undertow,deployment=$0,subdeployment=$1,servlet=$2,*/requestCount + Delta + Label = $0 : $1 : $2 : %2.2f ms average request time + Name = $0-$1-$2-request + Critical = ${3:6000} + Warning = ${4:5000} + + +# Check whether the webapplications deployment is in status OK +# $0: Web-Module name (i.e. the WAR file name) +# $1: Name (optional) + + Value = jboss.as.expr:deployment=$0/status + String = 1 + Critical = !OK + Label = $0 status + Name = ${1:status} + + +# Check whether a webapplication is enabled +# $0: Web-Module name (i.e. the WAR file name) +# $1: Name (optional) + + Value = jboss.as.expr:deployment=$0/enabled + String = 1 + Critical = !true + Label = $0 enabled + Name = ${1:enabled} + + +# Check number of active session for a webapp, deployed as a war +# $0: Web-Module name (i.e. the WAR file name) +# $1: Critical (optional) (absolute number of active sessions allowed) +# $2: Warning (optional) (absolute number of active sessions allowed) +# $3: Descriptive name (optional) + + Value = jboss.as.expr:subsystem=undertow,deployment=$0/activeSessions + Label = %v active sessions + Name = ${3:active sessions} + Critical = ${1:1000} + Warning = ${2:800} + + +# Check number of active session for a webapp, deployed as part of an ear +# $0: EAR Module (name of the EAR file) +# $1: Web-Module name (i.e. the WAR file name within the ear) +# $2: Critical (optional) (absolute number of active sessions allowed) +# $3: Warning (optional) (absolute number of active sessions allowed) +# $4: Descriptive name (optional) + + Value = jboss.as.expr:subsystem=undertow,deployment=$0,subdeployment=$1/activeSessions + Label = %v active sessions + Name = ${4:active sessions} + Critical = ${2:1000} + Warning = ${3:800} + + +# Check for available database connections +# $0: Name of datasource (e.g. "ExampleDS") +# $1: Critical value (optional, default: 1) +# $2: Warning value (optional, default: 5) +# $3: Name (optional) + + Value = jboss.as.expr:data-source=${0},statistics=pool,subsystem=datasources/AvailableCount + Name = ${3:dbpool_available} + Label = %.2v DB connections available + Critical = ${1:1:} + Warning = ${2:5:} + + + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..263b61c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,42 @@ +# ================================================== +# Dockerfile for jmx4perl Tools +# ================================================== +FROM alpine:3.2 + +ENV JMX4PERL_VERSION 1.12 + +RUN apk add --update \ + build-base \ + wget \ + perl \ + perl-dev \ + readline \ + readline-dev \ + ncurses \ + ncurses-dev \ + libxml2-dev \ + expat-dev \ + gnupg1 \ + && cpan App::cpanminus < /dev/null \ + && cpanm install -n Term::ReadKey \ + && cpanm install \ + JSON::XS \ + Term::ReadLine::Gnu \ + && cpanm install ROLAND/jmx4perl-${JMX4PERL_VERSION}.tar.gz \ + && rm -rf /var/cache/apk/* \ + && apk del \ + build-base \ + perl-dev \ + readline-dev \ + ncurses-dev \ + libxml2-dev \ + expat-dev \ + && mkdir /jolokia + +WORKDIR /jolokia +VOLUME /jolokia + +CMD [ "jmx4perl", "--version" ] + + + diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..88576ad --- /dev/null +++ b/docker/README.md @@ -0,0 +1,43 @@ +## Jmx4Perl Tools 1.12 + +This Docker image is intended to provided an easy access to the +[Jmx4Perl](http://www.jmx4perl.org) Tools, i.e. + +* **[jmx4perl](http://search.cpan.org/~roland/jmx4perl/scripts/jmx4perl)** -- Command line +* **[j4psh](http://search.cpan.org/~roland/jmx4perl/scripts/j4psh)** + -- JMX shell +* **[jolokia](http://search.cpan.org/~roland/jmx4perl/scripts/jolokia)** + -- Jolokia agent management tool +* **[check_jmx4perl](http://search.cpan.org/~roland/jmx4perl/scripts/check_jmx4perl)** + -- Send Jolokia Requests from the command line + +Please refer to the upstream tool documentation for details. + +Examples: + +````shell +# Get some basic information of the server +docker run --rm -it jolokia/jmx4perl jmx4perl http://localhost:8080/jolokia + +# Download the current jolokia.war agent +docker run --rm -it -v `pwd`:/jolokia jolokia/jmx4perl jolokia + +# Start an interactive JMX shell, server "tomcat" is defined in ~/.j4p/jmx4perl.config +docker run --rm -it -v ~/.j4p:/root/.j4p jolokia/jmx4perl j4psh tomcat +```` + +If you put your server definitions into `~/.j4p/jmx4perl.config` you +can use them by volume mounting them with `-v +~/.j4p:/root/.j4p`. For the management tool `jolokia` it is +recommended to mount the local directory with `-v $(pwd):/jolokia` so +that downloaded artefacts are stored in the current host directory + +To simplify the usage, the following shell setup can be used: + +````shell +function j4p_docker { + alias jmx4perl="docker run --rm -it -v ~/.j4p:/root/.j4p jolokia/jmx4perl jmx4perl" + alias jolokia="docker run --rm -it -v `pwd`:/jolokia jolokia/jmx4perl jolokia" + alias j4psh="docker run --rm -it -v ~/.j4p:/root/.j4p jolokia/jmx4perl j4psh" +} +```` diff --git a/examples/jsr77.pl b/examples/jsr77.pl new file mode 100755 index 0000000..e4cdf03 --- /dev/null +++ b/examples/jsr77.pl @@ -0,0 +1,158 @@ +#!/usr/bin/perl + +use JMX::Jmx4Perl; +use strict; +use Data::Dumper; +use Getopt::Std; + +my %opts; +getopts('s',\%opts); + + +my $url = $ARGV[0] || die "No url given\n"; + +my $jmx = JMX::Jmx4Perl->new(url => $url,verbose => 0); + +my $MODULE_HANDLER = init_handler($jmx); +my %VISITED = (); + +my $product = $jmx->product; +print "Product: ",$product->name," ",$product->version,"\n"; +print "JSR77 : ",$product->jsr77 ? "Yes" : "No","\n\n"; + +my $domains = $jmx->search("*:j2eeType=J2EEDomain,*"); +$domains = [ "(none)" ] unless $domains; +# Special fix for geronimo which seems to have a problem with properly spelling +# the domain name +#push @$domains,"Geronimo:j2eeType=J2EEDomain,name=Geronimo" if grep { /^geronimo:/ } @$domains; +for my $d (@{$domains || []}) { + my $dn = $d eq "(none)" ? "*" : _print(1,$d,"Domain"); + my $servers = $jmx->search("$dn:j2eeType=J2EEServer,*"); + if (!$servers && $d eq "(none)") { + # That's probably not a real jsr77 container + # We are looking up all J2EEObject on our own without server and domain + my $objects = [ grep { /j2eeType/ } @{$jmx->search("*:*")} ]; + print_modules(1,$objects); + } elsif (!$servers) { + print " == No servers defined for domain $dn ==\n"; + } else { + for my $s (@{$servers || []}) { + my $sn = _print(2,$s,"Server"); + for my $o (qw(deployedObjects resources javaVMs)) { + my $objects = $jmx->get_attribute($s,$o); + print_modules(3,$objects); + } + } + + } + print "\n"; +} + +# Special JBoss handling, since it seems than deployed WARs (WebModules) +# don't appear below a server but stand on their own (despite the rules +# layed out in JSR77) +if ($product->id eq "jboss" || $product->id eq "weblogic") { + my $web_modules = $jmx->search("*:j2eeType=WebModule,*"); + if ($web_modules) { + print "\n=============================================\nJBoss WebModules:\n"; + my $new = [ grep { !$VISITED{$_} } @$web_modules ]; + print_modules(1,$new); + } +} + +sub init_handler { + my $jmx = shift; + return { + "J2EEApplication" => "modules", + "AppClientModule" => 0, + "ResourceAdapterModule" => "resourceAdapters", + "WebModule" => "servlets", + "Servlet" => 0, + "EJBModule" => "ejbs", + "MessageDrivenBean" => 0, + "EntityBean" => 0, + "StatelessSessionBean" => 0, + "StatefulSessionBean" => 0, + "JCAResource" => "connectionFactories", + "JCAConnectionFactory" => "managedConnectionFactory", + "JCAManagedConnectionFactory" => 0, + "JavaMailResource" => 0, + "JDBCResource" => "jdbcDataSources", + "JDBCDataSource" => "jdbcDriver", + "JDBCDriver" => 0, + "JMSResource" => 0, + "JNDIResource" => 0, + "JTAResource" => 0, + "RMI_IIOPResource" => 0, + "URLResource" => 0, + "JVM" => sub { + my ($l,$mod) = @_; + print " ", + join(", ",map { $jmx->get_attribute($mod,$_) } qw(javaVendor javaVersion node)),"\n"; + }, + # JBoss specific: + "ServiceModule" => 0, + "MBean" => 0 + }; +} + +sub print_modules { + my ($l,$objects) = @_; + for my $k (sort keys %$MODULE_HANDLER) { + my @mods = grep { $_ =~ /j2eeType=$k/ } @$objects; + if (@mods) { + my $handler = $MODULE_HANDLER->{$k}; + for my $mod (@mods) { + _print($l,$mod); + if (ref($handler) eq "CODE") { + $handler->($l,$mod); + } elsif ($handler && !ref($handler)) { + my $modules = $jmx->get_attribute($mod,$handler); + if ($modules) { + $modules = ref($modules) eq "ARRAY" ? $modules : [ $modules ]; + # Fix for Jonas 4.1.2 with jetty, which includes the + # WebModule itself in the list of contained Servlets + $modules = [ grep { $_ !~ /j2eeType=$k/} @$modules ]; + print_modules($l+1,$modules) if scalar(@$modules); + } + } + } + } + } +} + + + +sub _print { + my ($i,$s,$t) = @_; + $VISITED{$s} = $s; + my $n = extract_name($s); + unless ($t) { + $t = $1 if $s =~ /j2eeType=(\w+)/; + } + my $can_stat = check_for_statistics($s); + print " " x $i,$t,": ",$n,($can_stat ? " [S] " : ""),"\n"; + print " " x $i," " x length($t)," ",$s,"\n"; + if ($opts{s} && $can_stat) { + eval { + my $ret = $jmx->get_attribute($s,"stats"); + print Dumper($ret); + }; + } + return $n; +} + +sub check_for_statistics { + my $mbean = shift; + my $ret; + eval { + $ret = $jmx->get_attribute($mbean,"statisticsProvider"); + }; + return $@ ? undef : lc($ret) eq "true"; +} + +sub extract_name { + my $s = shift; + $s =~ /.*:.*name=([^,]+)/; + return $1; +} diff --git a/examples/memory.pl b/examples/memory.pl new file mode 100644 index 0000000..29ab958 --- /dev/null +++ b/examples/memory.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl +use JMX::Jmx4Perl; +use strict; +my $jmx = new JMX::Jmx4Perl(url => "http://localhost:8080/jolokia"); +my $memory = $jmx->get_attribute("java.lang:type=Memory","HeapMemoryUsage"); +my ($used,$max) = ($memory->{used},$memory->{max}); +if ($memory->{used} / $memory->{max} > 0.9) { + print "Memory exceeds 90% (used: $used / max: $max = ",int($used * 100 / $max),"%)\n"; + system("/etc/init.d/tomcat restart"); + sleep(120); +} diff --git a/examples/memory.sh b/examples/memory.sh new file mode 100644 index 0000000..fab9853 --- /dev/null +++ b/examples/memory.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +base_url="http://localhost:9090/jolokia" +memory_url="${base_url}/read/java.lang:type=Memory/HeapMemoryUsage" +used=`wget -q -O - "${memory_url}/used" | sed 's/^.*"value":"\([0-9]*\)".*$/\1/'` +max=`wget -q -O - "${memory_url}/max" | sed 's/^.*"value":"\([0-9]*\)".*$/\1/'` +usage=$((${used}*100/${max})) +if [ $usage -gt 5 ]; then + echo "Memory exceeds 80% (used: $used / max: $max = ${usage}\%)"; + exit 1; +else + exit 0; +fi diff --git a/examples/remote.pl b/examples/remote.pl new file mode 100644 index 0000000..fa51dfc --- /dev/null +++ b/examples/remote.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use JMX::Jmx4Perl; +use JMX::Jmx4Perl::Request; +use JMX::Jmx4Perl::Alias; +use Data::Dumper; +use Time::HiRes qw(gettimeofday tv_interval); +my $jmx = new JMX::Jmx4Perl(url => "http://localhost:8888/jolokia-proxy", + target => { + url => "service:jmx:rmi:///jndi/rmi://bhut:9999/jmxrmi", + env => { + user => "monitorRole", + password => "consol", + } + } + ); +my $req1 = new JMX::Jmx4Perl::Request(READ,{ + mbean => "java.lang:type=Memory", + attribute => "HeapMemoryUsage", + } + ); +my $req2 = new JMX::Jmx4Perl::Request(LIST); +my $req3 = new JMX::Jmx4Perl::Request(READ,{ + mbean => "jboss.system:type=ServerInfo", + attribute => "HostAddress" + } + ); +my $t0 = [gettimeofday]; +my @resp = $jmx->request($req3); +print "Duration: ",tv_interval($t0,[gettimeofday]),"\n"; +print Dumper(@resp); diff --git a/examples/threadDump.pl b/examples/threadDump.pl new file mode 100755 index 0000000..83ec9d0 --- /dev/null +++ b/examples/threadDump.pl @@ -0,0 +1,102 @@ +#!/usr/bin/perl + +use Getopt::Long; +use JMX::Jmx4Perl; +use Data::Dumper; +use strict; +use warnings; + +=head1 NAME + +threadDump.pl - Print a thread dump of an JEE Server + +=head1 SYNOPSIS + + threadDumpl.pl -f org.jmx4perl http://localhost:8080/j4p + + http-0.0.0.0-8080-1 (RUNNABLE): + .... + sun.management.ThreadImpl.dumpThreads0(ThreadImpl.java:unknown) + org.jmx4perl.handler.ExecHandler.doHandleRequest(ExecHandler.java:77) + org.jmx4perl.handler.RequestHandler.handleRequest(RequestHandler.java:89) + org.jmx4perl.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:73) + org.jmx4perl.AgentServlet.callRequestHandler(AgentServlet.java:205) + org.jmx4perl.AgentServlet.handle(AgentServlet.java:152) + org.jmx4perl.AgentServlet.doGet(AgentServlet.java:129) + .... + +=head1 DESCRIPTION + +For JEE Server running with Java 6, this simple script prints out a thread +dump, possibly filtered by package name. This is done by executing the MBean +C's operation C. + +=cut + +my %opts = (); +my $result = GetOptions(\%opts, + "user|u=s","password|p=s", + "proxy=s", + "proxy-user=s","proxy-password=s", + "filter|f=s", + "verbose|v!", + "help|h!" => sub { Getopt::Long::HelpMessage() } + ); + +my $url = $ARGV[0] || die "No URL to j4p agent given\n"; +my $jmx = new JMX::Jmx4Perl(url => $url,user => $opts{user},password => $opts{password}, + proxy => $opts{proxy}, proxy_user => $opts{"proxy-user"}); + +my $dump; +eval { + $dump = $jmx->execute("java.lang:type=Threading","dumpAllThreads","false","false"); +}; +die "Cannot execute thread dump. Remember, $0 works only with Java >= 1.6\n$@\n" if $@; + +my @filters = split ",",$opts{filter} if $opts{filter}; +for my $thread (@$dump) { + print "-" x 75,"\n" if print_thread($thread);; +} + +sub print_thread { + my $thread = shift; + my $st = get_stacktrace($thread->{stackTrace}); + if ($st) { + print $thread->{threadName}," (",$thread->{threadState},"):\n"; + print $st; + return 1; + } else { + return undef; + } +} + +sub get_stacktrace { + my $trace = shift; + my $ret = ""; + my $found = 0; + my $flag = 1; + my $last_line; + for my $l (@$trace) { + my $class = $l->{className}; + if (!@filters || grep { $class =~ /^\Q$_\E/ } @filters) { + $ret .= $last_line if ($last_line && !$found); + $ret .= format_stack_line($l); + $found = 1; + $flag = 1; + } elsif ($flag) { + $flag = 0; + $ret .= " ....\n"; + $last_line = format_stack_line($l); + } + } + return $found ? $ret : undef; +} + +sub format_stack_line { + my $l = shift; + my $ret = " ".$l->{className}.".".$l->{methodName}."(".$l->{fileName}.":"; + $ret .= $l->{lineNumber} > 0 ? $l->{lineNumber} : "unknown"; + $ret .= ")\n"; + return $ret; + +} diff --git a/inc/Module-Build/Module/Build.pm b/inc/Module-Build/Module/Build.pm new file mode 100644 index 0000000..ce0cfae --- /dev/null +++ b/inc/Module-Build/Module/Build.pm @@ -0,0 +1,1098 @@ +package Module::Build; + +# This module doesn't do much of anything itself, it inherits from the +# modules that do the real work. The only real thing it has to do is +# figure out which OS-specific module to pull in. Many of the +# OS-specific modules don't do anything either - most of the work is +# done in Module::Build::Base. + +use strict; +use File::Spec (); +use File::Path (); +use File::Basename (); + +use Module::Build::Base; + +use vars qw($VERSION @ISA); +@ISA = qw(Module::Build::Base); +$VERSION = '0.34'; +$VERSION = eval $VERSION; + +# Okay, this is the brute-force method of finding out what kind of +# platform we're on. I don't know of a systematic way. These values +# came from the latest (bleadperl) perlport.pod. + +my %OSTYPES = qw( + aix Unix + bsdos Unix + dgux Unix + dragonfly Unix + dynixptx Unix + freebsd Unix + linux Unix + haiku Unix + hpux Unix + irix Unix + darwin Unix + machten Unix + midnightbsd Unix + mirbsd Unix + next Unix + openbsd Unix + netbsd Unix + dec_osf Unix + nto Unix + svr4 Unix + svr5 Unix + sco_sv Unix + unicos Unix + unicosmk Unix + solaris Unix + sunos Unix + cygwin Unix + os2 Unix + interix Unix + gnu Unix + gnukfreebsd Unix + nto Unix + + dos Windows + MSWin32 Windows + + os390 EBCDIC + os400 EBCDIC + posix-bc EBCDIC + vmesa EBCDIC + + MacOS MacOS + VMS VMS + VOS VOS + riscos RiscOS + amigaos Amiga + mpeix MPEiX + ); + +# Inserts the given module into the @ISA hierarchy between +# Module::Build and its immediate parent +sub _interpose_module { + my ($self, $mod) = @_; + eval "use $mod"; + die $@ if $@; + + no strict 'refs'; + my $top_class = $mod; + while (@{"${top_class}::ISA"}) { + last if ${"${top_class}::ISA"}[0] eq $ISA[0]; + $top_class = ${"${top_class}::ISA"}[0]; + } + + @{"${top_class}::ISA"} = @ISA; + @ISA = ($mod); +} + +if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @INC) { + __PACKAGE__->_interpose_module("Module::Build::Platform::$^O"); + +} elsif (exists $OSTYPES{$^O}) { + __PACKAGE__->_interpose_module("Module::Build::Platform::$OSTYPES{$^O}"); + +} else { + warn "Unknown OS type '$^O' - using default settings\n"; +} + +sub os_type { $OSTYPES{$^O} } + +sub is_vmsish { return ((os_type() || '') eq 'VMS') } +sub is_windowsish { return ((os_type() || '') eq 'Windows') } +sub is_unixish { return ((os_type() || '') eq 'Unix') } + +1; + +__END__ + +=for :stopwords +bindoc binhtml destdir distcheck distclean distdir distmeta distsign disttest +fakeinstall html installdirs installsitebin installsitescript installvendorbin +installvendorscript libdoc libhtml pardist ppd ppmdist realclean skipcheck +testall testcover testdb testpod testpodcoverage versioninstall + +=head1 NAME + +Module::Build - Build and install Perl modules + + +=head1 SYNOPSIS + +Standard process for building & installing modules: + + perl Build.PL + ./Build + ./Build test + ./Build install + +Or, if you're on a platform (like DOS or Windows) that doesn't require +the "./" notation, you can do this: + + perl Build.PL + Build + Build test + Build install + + +=head1 DESCRIPTION + +C is a system for building, testing, and installing +Perl modules. It is meant to be an alternative to +C. Developers may alter the behavior of the +module through subclassing in a much more straightforward way than +with C. It also does not require a C on your system +- most of the C code is pure-perl and written in a very +cross-platform way. In fact, you don't even need a shell, so even +platforms like MacOS (traditional) can use it fairly easily. Its only +prerequisites are modules that are included with perl 5.6.0, and it +works fine on perl 5.005 if you can install a few additional modules. + +See L<"MOTIVATIONS"> for more comparisons between C +and C. + +To install C, and any other module that uses +C for its installation process, do the following: + + perl Build.PL # 'Build.PL' script creates the 'Build' script + ./Build # Need ./ to ensure we're using this "Build" script + ./Build test # and not another one that happens to be in the PATH + ./Build install + +This illustrates initial configuration and the running of three +'actions'. In this case the actions run are 'build' (the default +action), 'test', and 'install'. Other actions defined so far include: + + build manpages + clean pardist + code ppd + config_data ppmdist + diff prereq_data + dist prereq_report + distcheck pure_install + distclean realclean + distdir retest + distmeta skipcheck + distsign test + disttest testall + docs testcover + fakeinstall testdb + help testpod + html testpodcoverage + install versioninstall + manifest + + +You can run the 'help' action for a complete list of actions. + + +=head1 GUIDE TO DOCUMENTATION + +The documentation for C is broken up into three sections: + +=over + +=item General Usage (L) + +This is the document you are currently reading. It describes basic +usage and background information. Its main purpose is to assist the +user who wants to learn how to invoke and control C +scripts at the command line. + +=item Authoring Reference (L) + +This document describes the structure and organization of +C, and the relevant concepts needed by authors who are +writing F scripts for a distribution or controlling +C processes programmatically. + +=item API Reference (L) + +This is a reference to the C API. + +=item Cookbook (L) + +This document demonstrates how to accomplish many common tasks. It +covers general command line usage and authoring of F +scripts. Includes working examples. + +=back + + +=head1 ACTIONS + +There are some general principles at work here. First, each task when +building a module is called an "action". These actions are listed +above; they correspond to the building, testing, installing, +packaging, etc., tasks. + +Second, arguments are processed in a very systematic way. Arguments +are always key=value pairs. They may be specified at C +time (i.e. C), in which case +their values last for the lifetime of the C script. They may +also be specified when executing a particular action (i.e. +C), in which case their values last only for the +lifetime of that command. Per-action command line parameters take +precedence over parameters specified at C time. + +The build process also relies heavily on the C module. +If the user wishes to override any of the +values in C, she may specify them like so: + + perl Build.PL --config cc=gcc --config ld=gcc + +The following build actions are provided by default. + +=over 4 + +=item build + +[version 0.01] + +If you run the C script without any arguments, it runs the +C action, which in turn runs the C and C actions. + +This is analogous to the C I target. + +=item clean + +[version 0.01] + +This action will clean up any files that the build process may have +created, including the C directory (but not including the +C<_build/> directory and the C script itself). + +=item code + +[version 0.20] + +This action builds your code base. + +By default it just creates a C directory and copies any C<.pm> +and C<.pod> files from your C directory into the C +directory. It also compiles any C<.xs> files from C and places +them in C. Of course, you need a working C compiler (probably +the same one that built perl itself) for the compilation to work +properly. + +The C action also runs any C<.PL> files in your F +directory. Typically these create other files, named the same but +without the C<.PL> ending. For example, a file F +could create the file F. The C<.PL> files are +processed first, so any C<.pm> files (or other kinds that we deal +with) will get copied correctly. + +=item config_data + +[version 0.26] + +... + +=item diff + +[version 0.14] + +This action will compare the files about to be installed with their +installed counterparts. For .pm and .pod files, a diff will be shown +(this currently requires a 'diff' program to be in your PATH). For +other files like compiled binary files, we simply report whether they +differ. + +A C parameter may be passed to the action, which will be passed +to the 'diff' program. Consult your 'diff' documentation for the +parameters it will accept - a good one is C<-u>: + + ./Build diff flags=-u + +=item dist + +[version 0.02] + +This action is helpful for module authors who want to package up their +module for source distribution through a medium like CPAN. It will create a +tarball of the files listed in F and compress the tarball using +GZIP compression. + +By default, this action will use the C module. However, you can +force it to use binary "tar" and "gzip" executables by supplying an explicit +C (and optional C) parameter: + + ./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe + +=item distcheck + +[version 0.05] + +Reports which files are in the build directory but not in the +F file, and vice versa. (See L for details.) + +=item distclean + +[version 0.05] + +Performs the 'realclean' action and then the 'distcheck' action. + +=item distdir + +[version 0.05] + +Creates a "distribution directory" named C<$dist_name-$dist_version> +(if that directory already exists, it will be removed first), then +copies all the files listed in the F file to that directory. +This directory is what the distribution tarball is created from. + +=item distmeta + +[version 0.21] + +Creates the F file that describes the distribution. + +F is a file containing various bits of I about the +distribution. The metadata includes the distribution name, version, +abstract, prerequisites, license, and various other data about the +distribution. This file is created as F in YAML format. +It is recommended that the C module be installed to create it. +If the C module is not installed, an internal module supplied +with Module::Build will be used to write the META.yml file, and this +will most likely be fine. + +F file must also be listed in F - if it's not, a +warning will be issued. + +The current version of the F specification can be found at +L + +=item distsign + +[version 0.16] + +Uses C to create a SIGNATURE file for your +distribution, and adds the SIGNATURE file to the distribution's +MANIFEST. + +=item disttest + +[version 0.05] + +Performs the 'distdir' action, then switches into that directory and +runs a C, followed by the 'build' and 'test' actions in +that directory. + +=item docs + +[version 0.20] + +This will generate documentation (e.g. Unix man pages and HTML +documents) for any installable items under B that +contain POD. If there are no C or C installation +targets defined (as will be the case on systems that don't support +Unix manpages) no action is taken for manpages. If there are no +C or C installation targets defined no action is +taken for HTML documents. + +=item fakeinstall + +[version 0.02] + +This is just like the C action, but it won't actually do +anything, it will just report what it I have done if you had +actually run the C action. + +=item help + +[version 0.03] + +This action will simply print out a message that is meant to help you +use the build process. It will show you a list of available build +actions too. + +With an optional argument specifying an action name (e.g. C), the 'help' action will show you any POD documentation it can +find for that action. + +=item html + +[version 0.26] + +This will generate HTML documentation for any binary or library files +under B that contain POD. The HTML documentation will only be +installed if the install paths can be determined from values in +C. You can also supply or override install paths on the +command line by specifying C values for the C +and/or C installation targets. + +=item install + +[version 0.01] + +This action will use C to install the files from +C into the system. See L<"INSTALL PATHS"> +for details about how Module::Build determines where to install +things, and how to influence this process. + +If you want the installation process to look around in C<@INC> for +other versions of the stuff you're installing and try to delete it, +you can use the C parameter, which tells C to +do so: + + ./Build install uninst=1 + +This can be a good idea, as it helps prevent multiple versions of a +module from being present on your system, which can be a confusing +situation indeed. + +=item manifest + +[version 0.05] + +This is an action intended for use by module authors, not people +installing modules. It will bring the F up to date with the +files currently present in the distribution. You may use a +F file to exclude certain files or directories from +inclusion in the F. F should contain a bunch +of regular expressions, one per line. If a file in the distribution +directory matches any of the regular expressions, it won't be included +in the F. + +The following is a reasonable F starting point, you can +add your own stuff to it: + + ^_build + ^Build$ + ^blib + ~$ + \.bak$ + ^MANIFEST\.SKIP$ + CVS + +See the L and L actions if you want to find out +what the C action would do, without actually doing anything. + +=item manpages + +[version 0.28] + +This will generate man pages for any binary or library files under +B that contain POD. The man pages will only be installed if the +install paths can be determined from values in C. You can +also supply or override install paths by specifying there values on +the command line with the C and C installation +targets. + +=item pardist + +[version 0.2806] + +Generates a PAR binary distribution for use with L or L. + +It requires that the PAR::Dist module (version 0.17 and up) is +installed on your system. + +=item ppd + +[version 0.20] + +Build a PPD file for your distribution. + +This action takes an optional argument C which is used in +the generated PPD file to specify the (usually relative) URL of the +distribution. By default, this value is the distribution name without +any path information. + +Example: + + ./Build ppd --codebase "MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz" + +=item ppmdist + +[version 0.23] + +Generates a PPM binary distribution and a PPD description file. This +action also invokes the C action, so it can accept the same +C argument described under that action. + +This uses the same mechanism as the C action to tar & zip its +output, so you can supply C and/or C parameters to affect +the result. + +=item prereq_data + +[version 0.32] + +This action prints out a Perl data structure of all prerequisites and the versions +required. The output can be loaded again using C. This can be useful for +external tools that wish to query a Build script for prerequisites. + +=item prereq_report + +[version 0.28] + +This action prints out a list of all prerequisites, the versions required, and +the versions actually installed. This can be useful for reviewing the +configuration of your system prior to a build, or when compiling data to send +for a bug report. + +=item pure_install + +[version 0.28] + +This action is identical to the C action. In the future, +though, when C starts writing to the file +F<$(INSTALLARCHLIB)/perllocal.pod>, C won't, and that +will be the only difference between them. + +=item realclean + +[version 0.01] + +This action is just like the C action, but also removes the +C<_build> directory and the C script. If you run the +C action, you are essentially starting over, so you will +have to re-create the C script again. + +=item retest + +[version 0.2806] + +This is just like the C action, but doesn't actually build the +distribution first, and doesn't add F to the load path, and +therefore will test against a I installed version of the +distribution. This can be used to verify that a certain installed +distribution still works, or to see whether newer versions of a +distribution still pass the old regression tests, and so on. + +=item skipcheck + +[version 0.05] + +Reports which files are skipped due to the entries in the +F file (See L for details) + +=item test + +[version 0.01] + +This will use C or C to run any regression +tests and report their results. Tests can be defined in the standard +places: a file called C in the top-level directory, or several +files ending with C<.t> in a C directory. + +If you want tests to be 'verbose', i.e. show details of test execution +rather than just summary information, pass the argument C. + +If you want to run tests under the perl debugger, pass the argument +C. + +If you want to have Module::Build find test files with different file +name extensions, pass the C argument with an array +of extensions, such as C<[qw( .t .s .z )]>. + +If you want test to be run by C, rather than C, +pass the argument C as an array reference of arguments to +pass to the TAP::Harness constructor. + +In addition, if a file called C exists in the top-level +directory, this file will be executed as a Perl script and its output +will be shown to the user. This is a good place to put speed tests or +other tests that don't use the C format for output. + +To override the choice of tests to run, you may pass a C +argument whose value is a whitespace-separated list of test scripts to +run. This is especially useful in development, when you only want to +run a single test to see whether you've squashed a certain bug yet: + + ./Build test --test_files t/something_failing.t + +You may also pass several C arguments separately: + + ./Build test --test_files t/one.t --test_files t/two.t + +or use a C-style pattern: + + ./Build test --test_files 't/01-*.t' + +=item testall + +[version 0.2807] + +[Note: the 'testall' action and the code snippets below are currently +in alpha stage, see +L<"http://www.nntp.perl.org/group/perl.module.build/2007/03/msg584.html"> ] + +Runs the C action plus each of the C actions defined by +the keys of the C parameter. + +Currently, you need to define the ACTION_test$type method yourself and +enumerate them in the test_types parameter. + + my $mb = Module::Build->subclass( + code => q( + sub ACTION_testspecial { shift->generic_test(type => 'special'); } + sub ACTION_testauthor { shift->generic_test(type => 'author'); } + ) + )->new( + ... + test_types => { + special => '.st', + author => ['.at', '.pt' ], + }, + ... + +=item testcover + +[version 0.26] + +Runs the C action using C, generating a +code-coverage report showing which parts of the code were actually +exercised during the tests. + +To pass options to C, set the C<$DEVEL_COVER_OPTIONS> +environment variable: + + DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover + +=item testdb + +[version 0.05] + +This is a synonym for the 'test' action with the C +argument. + +=item testpod + +[version 0.25] + +This checks all the files described in the C action and +produces C-style output. If you are a module author, +this is useful to run before creating a new release. + +=item testpodcoverage + +[version 0.28] + +This checks the pod coverage of the distribution and +produces C-style output. If you are a module author, +this is useful to run before creating a new release. + +=item versioninstall + +[version 0.16] + +** Note: since C is so new, and since we just recently added +support for it here too, this feature is to be considered +experimental. ** + +If you have the C module installed on your system, you can +use this action to install a module into the version-specific library +trees. This means that you can have several versions of the same +module installed and C a specific one like this: + + use only MyModule => 0.55; + +To override the default installation libraries in C, +specify the C parameter when you run the C script: + + perl Build.PL --versionlib /my/version/place/ + +To override which version the module is installed as, specify the +C parameter when you run the C script: + + perl Build.PL --version 0.50 + +See the C documentation for more information on +version-specific installs. + +=back + + +=head1 OPTIONS + +=head2 Command Line Options + +The following options can be used during any invocation of C +or the Build script, during any action. For information on other +options specific to an action, see the documentation for the +respective action. + +NOTE: There is some preliminary support for options to use the more +familiar long option style. Most options can be preceded with the +C<--> long option prefix, and the underscores changed to dashes +(e.g. C<--use-rcfile>). Additionally, the argument to boolean options is +optional, and boolean options can be negated by prefixing them with +C or C (e.g. C<--noverbose> or C<--no-verbose>). + +=over 4 + +=item quiet + +Suppress informative messages on output. + +=item use_rcfile + +Load the F<~/.modulebuildrc> option file. This option can be set to +false to prevent the custom resource file from being loaded. + +=item verbose + +Display extra information about the Build on output. + +=item allow_mb_mismatch + +Suppresses the check upon startup that the version of Module::Build +we're now running under is the same version that was initially invoked +when building the distribution (i.e. when the C script was +first run). Use with caution. + +=back + + +=head2 Default Options File (F<.modulebuildrc>) + +[version 0.28] + +When Module::Build starts up, it will look first for a file, +F<$ENV{HOME}/.modulebuildrc>. If it's not found there, it will look +in the the F<.modulebuildrc> file in the directories referred to by +the environment variables C + C, C, +C, C, C. If the file exists, the options +specified there will be used as defaults, as if they were typed on the +command line. The defaults can be overridden by specifying new values +on the command line. + +The action name must come at the beginning of the line, followed by any +amount of whitespace and then the options. Options are given the same +as they would be on the command line. They can be separated by any +amount of whitespace, including newlines, as long there is whitespace at +the beginning of each continued line. Anything following a hash mark (C<#>) +is considered a comment, and is stripped before parsing. If more than +one line begins with the same action name, those lines are merged into +one set of options. + +Besides the regular actions, there are two special pseudo-actions: the +key C<*> (asterisk) denotes any global options that should be applied +to all actions, and the key 'Build_PL' specifies options to be applied +when you invoke C. + + * verbose=1 # global options + diff flags=-u + install --install_base /home/ken + --install_path html=/home/ken/docs/html + +If you wish to locate your resource file in a different location, you +can set the environment variable C to the complete +absolute path of the file containing your options. + + +=head1 INSTALL PATHS + +[version 0.19] + +When you invoke Module::Build's C action, it needs to figure +out where to install things. The nutshell version of how this works +is that default installation locations are determined from +F, and they may be overridden by using the C +parameter. An C parameter lets you specify an +alternative installation root like F, and a C lets +you specify a temporary installation directory like F in +case you want to create bundled-up installable packages. + +Natively, Module::Build provides default installation locations for +the following types of installable items: + +=over 4 + +=item lib + +Usually pure-Perl module files ending in F<.pm>. + +=item arch + +"Architecture-dependent" module files, usually produced by compiling +XS, L, or similar code. + +=item script + +Programs written in pure Perl. In order to improve reuse, try to make +these as small as possible - put the code into modules whenever +possible. + +=item bin + +"Architecture-dependent" executable programs, i.e. compiled C code or +something. Pretty rare to see this in a perl distribution, but it +happens. + +=item bindoc + +Documentation for the stuff in C