Formatting code for MonitoringNagios


show source only

{{parent page="Monitoring"}}

===Installing nagios NMS===
%%
$ ./configure --with-command-group=nagcmd --prefix=/opt/nagios \
--with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios \
--with-nagios-user=nagios --with-nagios-group=nagios

*** Configuration summary for nagios 3.2.1 03-09-2010 ***:

General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Embedded Perl: no
Event Broker: yes
Install ${prefix}: /opt/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/rc.d/init.d
Apache conf.d directory: /etc/httpd/conf.d
Mail program: /bin/mail
Host OS: linux-gnu

Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /bin/traceroute

$ make all
$ make install
$ make install-config
$ make install-commandmode
$ make install-webconf
$ htpasswd -c /usr/local/nagios/etc/htpasswd.users admin
%%

===Compile and install nagios plugins===
%%
$ tar xvf nagios-plugins-1.4.11.tar.gz
$ cd nagios-plugins-1.4.11
$ ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround
$ make
$ make install
$ chkconfig --add nagios
$ chkconfig nagios on
$ /opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
$ /opt/nagios/bin/nagios -d /opt/nagios/etc/nagios.cfg

curl http://localhost/nagios
%%


===Monitoring node (NRPE)===
Install nagios plugin first, then install nrpe

%%
$ chown nagios.nagios /usr/local/nagios
$ chown -R nagios.nagios /usr/local/nagios/libexec/

[remotehost]# ./configure
*** Configuration summary for nrpe 2.12 03-10-2008 ***:

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

[remotehost]# make all
[remotehost]# make install-plugin
[remotehost]# make install-daemon
[remotehost]# make install-daemon-config
[remotehost]# make install-xinetd


edit /etc/xinetd.d/nrpe and add NMS to the list, then
echo "nrpe 5666/tcp # NRPE" >> /etc/services
$ /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12

service xinetd restart ; netstat -atunp | grep 5666
%%

===Back to the NMS===
%%
[nagios-server]# tar xvfz nrpe-2.12.tar.gz
[nagios-server]# cd nrpe-2.1.2
[nagios-server]# ./configure
[nagios-server]# make all
[nagios-server]# make install-plugin

./configure will give a configuration summary as shown below:

*** Configuration summary for nrpe 2.12 05-31-2008 ***:

General Options:
————————-
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

$ /usr/local/nagios/libexec/check_nrpe -H <remotehost>
NRPE v2.12
%%


Now create a remotehost.cfg under /opt/nagios/etc/objects
%%
define host {
use linux-server
host_name vlinux02.hkg
alias vlinux02.hkg
address 202.168.210.21
contact_groups admins
}

define service {
use generic-service
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}
%%

restart nagiosd (kill -9 and start up again) and go to the web interface

--> At this point I'm getting plugin not exist errors in /opt/nagios/var/nagios.log....
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki