by StanGilbertlandria » Tue Aug 30, 2022 1:27 am
I installed Nagios through the EPEL repository. I've left most permissions the same as they were installed, including the plugins which were installed as root:root. The one change I did make was to change all the CFG files in /etc/nagios/objects to root:nagios: I added myself to the nagios group, and so editing is much easier. For my CentOS installation, plugins are installed to /usr/lib64/nagios/plugins. I downloaded check_tomcat.pl to that directory, renamed it to just check_tomcat (for no real good reason), did a chmod 755 on it, and added # nagios: -epn to it.
Here are the excerpts from my CFG files:
commands.cfg:
# 'check_tomcat' command definition
define command{
command_name check_tomcat
command_line $USER1$/check_tomcat -H $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -a $ARG3$ -w $ARG4$ -c $ARG5$
}
localhost.cfg:
# Define a service to check the state of a Tomcat service
define service{
use local-service
host_name localhost
service_description Tomcat
check_command check_tomcat!8080!tomcat!tomcat!25%,25%!10%,10%
}
$HOSTADDRESS$ is passed as the host_name alias from the service to the command.
Thank you,