Nagios Server install
- Install epel
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
- Disable selinux
- Install Nagios packages
yum install nagios nagios-plugins-all nagios-plugins-nrpe php-pear mod_ssl net-snmp-utils sendmail
- Create nagios user and password or web interface
- Iptables
- Add apache to nagios group
- configure services
chkconfig httpd on
chkconfig sendmail on
service sendmail restart
- Edit httpd.conf and enable SSL in nagios.conf
uncomment SSLRequireSSL in /etc/httpd/conf.d/nagios.conf
restart httpd
- Configure for nrpe
Add check nrpe command.
Add the following to /etc/nagios/objects/commands.cfg.
define command{
command_name check_nrpe
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
make the servers directory
mkdir /etc/nagios/servers
chown root:nagios /etc/nagios/servers
service nagios restart
(a reboot might be necessary)
The Nagios server should working and accessible from the web interface.
On a separate machine install Centos 6 with minimal packages. Configure the system as needed.
Client nrpe install
- Install epel
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
- Disable selinux
- Install Nagios nrpe packages
yum install nagios-plugins-nrpe nagios-plugins-all nagios-nrpe openssl
- Add allowed hosts
allowed_hosts=127.0.0.1,x.x.x.x
Also change the server_address to the nrpe client IP
chown nrpe:nrpe /etc/nagios/nrpe.cfg
- nrpe services
chkconfig nrpe on
service nrpe restart
Allow port 5666 in iptables
Check connections from both nrpe and nagios server
/usr/lib64/nagios/plugins/check_nrpe -H (IP of nrpe)
- Add the nrpe client to the nagios server
define host{
use linux-server
host_name (nrpe client name)
alias CentOS 6
address (nrpe client)
}
service nagios restart
There should now be two hosts on in the web interface.
No comments:
Post a Comment