Created
July 13, 2018 01:11
-
-
Save simbalinux/9a2862c3450f4882a60db6cdc95a31e0 to your computer and use it in GitHub Desktop.
bootstrap an nrpe client in the network
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
# 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