Created
September 24, 2015 15:16
-
-
Save zouzias/f0036a5ad3b79a550e83 to your computer and use it in GitHub Desktop.
Setup Nagios Ubuntu Tomcat Jmeter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 ) Install nagios on Ubuntu using the following guide. | |
https://help.ubuntu.com/lts/serverguide/nagios.html | |
2) Install the Jmeter and Tomcat Plugin from nagios exchange. | |
http://exchange.nagios.org/directory/Plugins/Java-Applications-and-Servers/Apache-Tomcat/check_tomcat-2Epl/details | |
https://github.com/gmykhailiuta/nagios_jmeter_check | |
2) Copy the following configuration file into /etc. | |
First, | |
* Add the following command on /etc/nagios3/commands.cfg | |
# `check_jmeter` command definition | |
define command{ | |
command_name check_jmeter | |
command_line /usr/bin/perl /usr/lib/nagios/plugins/check_jmeter -H $HOSTADDRESS$ -j $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$ | |
} | |
# 'check_tomcat' command definition | |
define command{ | |
command_name check_tomcat | |
command_line /usr/bin/perl /usr/lib/nagios/plugins/check_tomcat -H $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$ | |
} | |
Second, | |
* Create the following file /etc/nagios3/conf.d/search-dev.cfg with contents: | |
# A simple configuration file for monitoring the local host | |
# This can serve as an example for configuring other servers; | |
# Custom services specific to this host are added here, but services | |
# defined in nagios2-common_services.cfg may also apply. | |
# | |
define host{ | |
use generic-host ; Name of host template to use | |
host_name search-dev | |
alias search-dev | |
address search-dev.zrlindexer.zc2.ibm.com | |
} | |
define service{ | |
use generic-service | |
host_name search-dev | |
service_description Search Development service | |
check_command check_jmeter!/usr/share/jmeter!/home/ubuntu/jmeter/crystal-search-dev.jmx!5!10!30 | |
} | |
# Define a service to check the disk space of the root partition | |
# on the local machine. Warning if < 20% free, critical if | |
# < 10% free space on partition. | |
define service{ | |
use generic-service ; Name of service template to use | |
host_name search-dev | |
service_description Disk Space | |
check_command check_all_disks!20%!10% | |
} | |
# Define a service to check the number of currently logged in | |
# users on the local machine. Warning if > 20 users, critical | |
# if > 50 users. | |
define service{ | |
use generic-service ; Name of service template to use | |
host_name search-dev | |
service_description Current Users | |
check_command check_users!20!50 | |
} | |
# Define a service to check the number of currently running procs | |
# on the local machine. Warning if > 250 processes, critical if | |
# > 400 processes. | |
define service{ | |
use generic-service ; Name of service template to use | |
host_name search-dev | |
service_description Total Processes | |
check_command check_procs!250!400 | |
} | |
# Define a service to check the load on the local machine. | |
define service{ | |
use generic-service ; Name of service template to use | |
host_name search-dev | |
service_description Current Load | |
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0 | |
} | |
# NRPE disk check. | |
define service { | |
use generic-service | |
host_name search-dev | |
service_description nrpe-disk | |
check_command check_nrpe_1arg!check_all_disks!search-dev.zrlindexer.zc2.ibm.com | |
} | |
# Define a service to check the state of a Tomcat service | |
define service{ | |
use generic-service | |
host_name search-dev | |
service_description Tomcat | |
check_command check_tomcat!8080!admin!qwerty!25%,25%!10%,10% | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment