Icinga (Monitoring Solution) Installation And Configuration On CentOS - Page 2
Installation of Nagios plugins for monitoring
1. Download the Nagios plugin and compile the same:
[[email protected] software]# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
[[email protected] software]# tar -zxvf nagios-plugins-1.4.15.tar.gz
[[email protected] software]# cd nagios-plugins-1.4.15
[[email protected] nagios-plugins-1.4.15]# ./configure --prefix=/opt/icinga/ --with-nagios-user=daemon --with-nagios-group=daemon
[[email protected] nagios-plugins-1.4.15]# make && make install
Cutomization of Icinga
Mail alert configuration:
[[email protected] /]# cd /opt/icinga/etc/
[[email protected]]# vi objects/contacts.cfg
define contact{ contact_nameicingaadmin ; Short name of user use generic-contact ; Inherit default values from generic-contact template (defined above) alias Icinga Admin ; Full name of user [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ****** }
Change the email address from [email protected] to your email address [email protected].
Make sure you had configured smarthost in the CentOS server.
To configure smart host in CentOS
[[email protected]]# rpm -qa|grepsendmail
sendmail-8.13.8-2.el5
[[email protected]]# vim /etc/mail/sendmail.mc
Disable the following line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl dnl#DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Enable the following line:
dnl define(`SMART_HOST', `smtp.your.provider')dnl
Give your smtp address here - in this case sunil.cc:
define(`SMART_HOST', `smtp.sunil.cc')dnl
[[email protected] /]#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[[email protected] /]#/etc/init.d/sendmail restart
Installing Nagios Plugin and nrpe in Ubuntu 192.168.1.40
1. For Ubuntu to be monitored by the Icinga server we need to install Nagios plugin and nrpe:
[email protected]:~# apt-get install gcc*
[email protected]:~#wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
[email protected]:~# tar -zxvf nagios-plugins-1.4.15.tar.gz
2. Compiling Nagios plugin:
[email protected]:~# cd nagios-plugins-1.4.15/
[email protected]:~/nagios-plugins-1.4.15# ./configure --with-nagios-user=daemon --with-nagios-group=daemon
[email protected]:~/nagios-plugins-1.4.15# make && make install
[email protected]:~/nagios-plugins-1.4.15# chown -R daemon:daemon /usr/local/nagios/
Installation of NRPE (Nagios Remote Plugin Executor)
1. Download and compile NRPE:
[email protected]:~# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
[email protected]:~# tar -zxvf nrpe-2.12.tar.gz
[email protected]:~# cd nrpe-2.12/
[email protected]:~/nrpe-2.12# apt-get install openssllibssl-dev
[email protected]:~# make all
[email protected]:~# make install-plugin
[email protected]:~# make install-daemon
[email protected]:~# make install-daemon-config
[email protected]:~/nrpe-2.12# apt-get installxinetd
[email protected]:~# make install-xinetd
2. We need to configure the nrpe as a xinetd service:
[email protected]:~/nrpe-2.12# vim /etc/xinetd.d/nrpe
servicenrpe { flags = REUSE socket_type = stream port = 5666 wait = no user = daemon group = daemon server = /usr/local/nagios/bin/nrpe server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd log_on_failure += USERID disable = no only_from = 127.0.0.1 }
3. Edit by adding the Icinga server IP in only_from:
servicenrpe { flags = REUSE socket_type = stream port = 5666 wait = no user = daemon group = daemon server = /usr/local/nagios/bin/nrpe server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd log_on_failure += USERID disable = no only_from = 127.0.0.1 192.168.1.20 }
4. Now we need to run it as a service by adding the following line:
[email protected]:~# vim /etc/services
nrpe 5666/tcp
5. Restart the xinetd service:
[email protected]:~# /etc/init.d/xinetd restart
6. Check whether nrpe has started:
[email protected]:~# netstat -a |grep nrpe
To check whether Ubuntu is able to communicate with the Icinga server:
[email protected]:~# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12
You should be able to get this output.