This plugin can be used to capture JavaMelody Data in Nagios
Before installation you will need to have java 1.5 or higher.
wget https://github.com/downloads/sbower/nagios_javamelody_plugin/javamelody_plugin.tar.gz
tar xzvf javamelody_plugin.tar.gz
mv javamelody_plugin/* /usr/local/nagios/libexec
First define a command in /etc/nagios/commands.cfg.
Setting a command to check local heap
# 'check_local_heap' command definition
define command{
command_name check_heap
command_line $USER1$/check_jmelody -r /usr/local/tomcat/temp/javamelody/$ARG3$/ -uh -w $ARG1$ -c $ARG2$
}
# 'check_remote_heap' command definition
define command{
command_name check_remote_heap
command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C '/usr/local/nagios/libexec/check_jmelody -r /usr/local/tomcat/temp/javamelody/$ARG3$/ -uh -w $ARG2$ -c $ARG3$'
}
Then you will need to define a service in your host definition
# Heap
define service{
use remote-service,graphed-service ; Name of service template to use
host_name hostname
service_description Heap
check_command check_heap!6442450944!8589934592!warfile
}
To run the tests:
$ mvn test
- Fork it.
- Create a branch (
git checkout -b nagios_javamelody_plugin
) - Commit your changes (
git commit -am "Added Snarkdown"
) - Push to the branch (
git push origin nagios_javamelody_plugin
) - Create an Issue with a link to your branch
- Enjoy a refreshing Diet Coke and wait