1. ports install nagios and nagios plugin
2. add web login accounts
/usr/local/apache/bin/htpasswd -c /usr/local/etc/nagios/htpasswd.users nagiosadmin
或 /usr/local/apache/bin/htpasswd /usr/local/etc/nagios/htpasswd.users nagios_user2
3. edit httpd.conf
# Nagios
ScriptAlias /nagios/cgi-bin /usr/local/www/nagios/cgi-bin
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
Alias /nagios /usr/local/www/nagios
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
4. edit configure file
1) contacts.cfg
change notification email address:
email raymond@abc.com
2) services.cfg
monitor remote host via nrpe
######################################################################################
# Define services for other hosts via nrpe
define service{
use generic-service
host_name testhost
service_description check load
check_command check_nrpe!check_load
}
*** Must install nrpe in both nagios server and clients. **********
* other config files: hosts.cfg; commands.cfg;
5. install nrpe
# ./configure
General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios
# make all
# make install-plugin
# make install-daemon
# make install-daemon-config
# make install-xinetd
6. edit nrpe.conf
allow hosts
define command
eg. command[check_2.abc.com]=/usr/lib64/nagios/plugins/check_http -H abc.com -w 5 -c 10
7. startup nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
阅读(752) | 评论(0) | 转发(0) |