Skip to content

Instantly share code, notes, and snippets.

@simbalinux
Created July 13, 2018 01:11
Show Gist options
  • Save simbalinux/9a2862c3450f4882a60db6cdc95a31e0 to your computer and use it in GitHub Desktop.
Save simbalinux/9a2862c3450f4882a60db6cdc95a31e0 to your computer and use it in GitHub Desktop.
bootstrap an nrpe client in the network
# Enable Debug
set -x
# Install requirements
yum -y install nrpe nagios-plugins-ping nagios-plugins-load nagios-plugins-check-updates nagios-plugins-ssh nagios-plugins-disk nagios-plugins-mysql nagios-plugins-http
# Create new firewall XML rules save as Monitoring2 so as not to chagne existing xml configs
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<zone>
<short>Monitoring</short>
<description>To allow devices in the monitor network to connect to this server. </description>
<source address=\"192.168.x.x/32\"/>
<service name=\"nrpe\"/>
</zone>" > /etc/firewalld/zones/monitoring2.xml
firewall-cmd --reload
# Configure nrpe.cfg to allow "new" Nagios server & other configs
sed -i "s/allowed_hosts=192.168.x.x,127.0.0.1/allowed_hosts=192.168.x.x,192.168.34.57,127.0.0.1/g" /etc/nagios/nrpe.cfg
sed -i "s/command_timeout=60/command_timeout=240/g" /etc/nagios/nrpe.cfg
systemctl restart nrpe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment