If you are using nagios in your hosting environment and need to install nrpe on your XenServer servers, here’s a good way to do it.
I’m using XenServer 6.1 (latest version).
First, install the epel repo and disable it by default:
1 2 3 |
wget http://dl.fedoraproject.org/pub/epel/5/$(uname -i)/epel-release-5-4.noarch.rpm rpm -Uvh epel-release-*.rpm sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo |
Next, install nrpe:
1 |
yum install --enablerepo=epel nrpe |
If you get an error like this:
1 2 3 |
Could not retrieve mirrorlist http://updates.vmd.citrix.com/XenServer/6.2.0/domain0/mirrorlist error was [Errno 14] HTTP Error 404: Not Found Cannot find a valid baseurl for repo: citrix |
Then disable the Citrix repo by changing ‘enabled=1’ to ‘enabled=0’ in /etc/yum.repos.d/Citrix.repo and try again.
Set it to start automagically on boot:
1 |
chkconfig nrpe on |
Install Nagios plugins – these are some that we use..
1 |
yum install --enablerepo=epel nagios-plugins-users nagios-plugins-disk nagios-plugins-swap nagios-plugins-procs nagios-plugins-load |
Next, add the following line to the iptables config just before the REJECT line at the bottom:
(Found here: /etc/sysconfig/iptables – this will allow your nagios server to connect to your XenServer)
1 |
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT |
Next, restart the firewall:
1 |
service iptables restart |
Start nrpe:
1 |
service nrpe start |
Edit the nrpe config file (/etc/nagios/nrpe.cfg) and take a look at the check commands at the bottom. If you have any questions about how to get it set up further feel free to comment on this post!
Yes! Man, you are on a roll! I’ve been missing my alerts, and this post came right on time. Thank you so much for these no-muss, no fuss directions. I’m pretty new to server maintenance and I swear some of so-called “Easy to Follow” instructions that I find are written for rocket scientists.
Thanks for that. A very detailed and thorough explanation. I will give it a try using your guide and if I have any issues I wil post here for your help if you don’t mind. Very kind of you to offer to help anyone having trouble.