Skip to content

Instantly share code, notes, and snippets.

@krishnamurthydasari
Created December 7, 2017 12:52
Show Gist options
  • Save krishnamurthydasari/945b6abd3cf76584e26249184e7218e7 to your computer and use it in GitHub Desktop.
Save krishnamurthydasari/945b6abd3cf76584e26249184e7218e7 to your computer and use it in GitHub Desktop.
1. Update security group to allow 5666, ICMP request and SSH protocols from nagios server 34.193.101.102/32
2. Run below commands to install Nagios client
mkdir /opt/Nagios
cd /opt/nagios/
wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar xvf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall
echo "nrpe: 34.193.101.102" >> /etc/hosts.allow
aws s3 cp s3://jbsm-installers/check_cpu_usage.sh /usr/local/nagios/libexec/check_cpu
chmod +x /usr/local/nagios/libexec/check_cpu
chown nagios:nagios /usr/local/nagios/libexec/check_cpu
3. vi /usr/local/nagios/etc/nrpe.cfg
Append below lines to nrpe.cfg at the end of file
command[check_cpu]=/usr/local/nagios/libexec/check_cpu -w 75 -c 85
command[check_root_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_nginx]=/usr/local/nagios/libexec/check_procs -c 1: -C nginx -u root -a 'master process'
command[check_tomcat]=/usr/local/nagios/libexec/check_procs -c 1: -u tomcat -a 'org.apache.catalina.startup.Bootstrap start'
4. service xinetd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment