Login NagiOS Server & Install Dependency Package
yum install perl-XML-XPath perl-libwww-perl
Step 2:
Download check_tomcat.pl
A: Using WebBrowser
B: Using curl
cd /usr/local/nagios/libexec
curl "https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=2522&cf_id=24" -o check_tomcat.pl
chmod +x /usr/lib/nagios/plugins/check_tomcat.pl
Step 3:
Test check_tomcat.pl
cd /usr/local/nagios/libexec
./check_tomcat.pl -h
./check_tomcat.pl -I 172.17.20.103 -p 8080 -l admin -a admin -w 20%,30% -c 10%,20%
Step 4:
Add Command for Check Tomcat
vi /etc/nagios/objects/commands.cfg
#Check tomcat service
define command{
command_name check_tomcat
command_line /bin/sh -c “$USER1$/check_tomcat.pl -H $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$”
}
Note: we can use the command_line variable as below. But sometimes you will get an error. So we can use “/bin/sh -c ” to avoid the error
Step 5:
Add Service in Client.cfg
define service{
use generic-service ; Inherit default values from a template
host_name test-red1
service_description Tomcat
check_command check_tomcat!8080!admin!admin!10%,50%!5%,10%
}
Step 6:
check Nagios configurations and restart
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors: 0
Things look okay – No serious problems were detected
systemctl restart nagios
Step 7:
check Nagios service monitoring page for tomcat status in Browser
http://172.17.20.100/nagios/
Part 1: Nagios Core 4.X configuration in Linux
Part 2: Add Remote hosts and service in Nagios
Part 3: Monitor MySQL/MariaDB Using check_mysql Plugin
Part 4: Monitor Tomcat using check_tomcat Plugin
Hello! i have an problem whit nagios, when i try to check the tomcat status, i have this error:
ReplyDelete(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: -H: “/usr/local/nagios/libexec/check_tomcat.pl: No such file or directory))
I Ve problem
ReplyDeleteTomcat
CRITICAL 03-24-2018 03:00:41 0d 15h 14m 6s 3/3 (Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: -H: “/usr/local/nagios/libexec/check_tomcat.pl: No such file or directory))
please help me to resolve as soon as possible
Warning: Return code of 127 for check of service 'Tomcat' on host '#### Server' was out of bounds. Make sure the plugin you're trying to run actually exists.
ReplyDeleteUse this
ReplyDeletedefine command{
command_name check_tomcat
command_line /bin/perl $USER1$/check_tomcat.pl -H $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$
}
Facing below error while executing
ReplyDeleteCRITICAL: http://172.31.92.209:8081/manager/status?XML=true HTTP/1.1 403 Forbidden
PC monitors have developed from the early green screen and shading monitors sold with the IBM PC into interconnected high-goal tone multi-monitors. https://bestmonitorhub.com/
ReplyDelete(Return code of 127 is out of bounds. Check if plugin exists)
ReplyDeletei am getting this error while doing above steps