This is a guide how to install Naemon 0.8.0 on CentOS 6.5 64-bit system. 32-bit packages are also available, just change download links bellow.
Download precompiled packages, you will find/verify the links from Naemon homepage: http://naemon.org
This instructions are created with CentOS minimal installation in mind, some packages may already exist if you have any other kind of installation.
Download wget
1 |
yum install wget |
Download packages
1 2 3 4 5 6 7 8 9 10 |
cd mkdir naemon-rpm cd naemon-rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-core-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-devel-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-livestatus-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-thruk-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-thruk-libs-0.8.0-1.rhel6.x86_64.rpm wget http://labs.consol.de/naemon/release/v0.8.0/rhel6/x86_64/naemon-thruk-reporting-0.8.0-1.rhel6.x86_64.rpm |
Enable epel repository, required for both dependency (mod_fcgid), nrpe and nagios-plugins
1 |
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
Install mod_fcgid
1 |
yum install mod_fcgid |
Install Naemon
1 |
yum install naemon* |
Disable SELinux, not supported by Thruk
1 |
setenforce 0 |
Make it persistent
1 |
vi /etc/selinux/config |
edit row: “SELINUX=enforcing”
replace with: “SELINUX=disabled”
Install nagios-plugins and NRPE agent, available via epel repository
1 |
yum install nagios-plugins nagios-plugins-all nagios-plugins-nrpe nrpe |
Modify path to nagios plugins, edit /etc/naemon/resource.cfg
1 |
vi /etc/naemon/resource.cfg |
edit row: “$USER1$=/usr/lib64/naemon/plugins”
replace with: “$USER1$=/usr/lib64/nagios/plugins”
Start services (also after boot)
1 2 3 4 |
service iptables stop #This is just for testing and will restart the firewall after reboot, please adjust your IP-tables accordingly chkconfig httpd on && service httpd start chkconfig naemon on && service naemon start chkconfig thruk on && service thruk start |
Installation complete, test your installation. Visit http://your-server/naemon/ and use default password admin/admin
I have a suggestion for the iptables
#show all iptables with line numbers
iptables –list –line-numbers
#delete INPUT rule number 5
#that’s the default block all on CentOS minimal installation
iptables -D INPUT 5
#add in the iptables rule to accept port 80
iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
#re-add the REJECT all rule for everything else at the end
iptables -A INPUT -j REJECT –reject-with icmp-host-prohibited
#save your iptables
service iptables save
#confirm
iptables –list –line-numbers
You can also change the lines for editing the files to make it easy to copy and paste
vi /etc/selinux/config
# Search and repalce row: “SELINUX=enforcing”
# with: “SELINUX=disabled”
:%s:SELINUX=enforcing:SELINUX=disabled
#save your file
:wq
# Search and replace row: “$USER1$=/usr/lib64/naemon/plugins”
# with: “$USER1$=/usr/lib64/nagios/plugins”
vi /etc/naemon/resource.cfg
:%s:/usr/lib64/nagios/plugin:/usr/lib64/naemon/plugins
#Save your file
:wq
Thanks, It took a while for me to see your comment. Sorry about that.
I will look at you suggestions and incorporate them since they make sense =)
Regards Johan
Johan,
Thanks for taking the time to read my suggestions. This is probably easier that what I suggested before.
iptables -I INPUT 4 -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-I (inputs to the) INPUT (chain at line 4) -m(match) state –state NEW -m tcp -p(port) –dport (destination port) 80 -j ACCEPT.
They also fixed /etc/naemon/resource.cfg so you don’t have to do the find replace any more.
I would suggest setting the iptables and killing SELinux earlier in the instructions so that Naemon doesn’t complain while installing. It’s not the end of the world but it helps.
Yes, this article was written during early days before naemon.org documentation was created and the 0.8 was still under development.
I will update the official documentation as well.
Thanks
Hi Johan,
Have you manage to install Naemon on existing Nagios?
After installation I cant login to webgui.