Nagios详细教程

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

2. 3. NRPE 4.
SSL
check_nrpe
NRPE daemon (check_disk,..etc)
NRPE Nagios
check_nrpe check_nrpe
5. Nagios
Host Name Nagios-Server
OS
IP
Software Apache Php Nagios
cgi.cfg nagios.cfg resource.cfg
CGI Nagios
$USER1$ objects objects Nagios objects/commands.cfg objects/contacts.cfg objects/localhost.cfg objects/printer.cfg
notify-service-by-email ; ;
11. “notify-service-by-email” 12. commands.cfg notify-host-by-email ; 13. “notify-host-by-email” 14. register commands.cfg 0
1. # cat /usr/local/nagios/etc/htpasswd
htpasswd
f.
1.
apache
# /usr/local/apache2/bin/apachectl start
nagios
web
Nagios Nagios Nagios Nagios
6.1 Nagios /usr/local/nagios/etc
# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios3.4.3.tar.gz
2. 3. 4.
# tar zxvf nagios-3.4.3.tar.gz # cd nagios # ./configure --prefix=/usr/local/nagios
# make && make install
c.
apache apache /usr/local/apache2/conf/httpd.conf
Baidu Nhomakorabea
User daemon Group daemon
User nagios Group nagios
<IfModule dir_module> DirectoryIndex index.html </IfModule>
# make all
# make install
# make install-init
# make install-commandmode
# make install-config
# chkconfig --add nagios # chkconfig --level 35 nagios on # chkconfig --list nagios
nagios
# useradd -s /sbin/nologin nagios # mkdir /usr/local/nagios # chown -R nagios.nagios /usr/local/nagios
nagios
1. # ll -d /usr/local/nagios/
5.3
1.
Nagios
Nagios
check_disk
1(WARNING)
nagios Nagios
Nagios
Nagios
Nagios Nagios
Nagios apache http apache apache
Linux
Nagios Nagios NRPE Nagios
Nagios 1. Nagios
NRPE check_nrpe check_nrpe
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
AddType application/x-httpd-php .php nagios httpd.conf
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. #setting for nagios ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" <Directory "/usr/local/nagios/sbin"> AuthType Basic Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd //
1. 2.
define contact{ name generic-contact ;
3.
service_notification_period "24x7"
24x7 timeperiods.cfg 24x7 timeperiods.cfg w,u,c,r u unknown
;
4.
host_notification_period "24x7"
objects/switch.cfg objects/templates.cfg objects/timeperiods.cfg objects/windows.cfg 6.2 Nagios nagios Nagios Windows
nagios
6.3
Nagios nagios
hosts.cfg services.cfg contacts.cfg commands.cfg timeperiods.cfg templates.cfg a. templates.cfg nagios Nagios templates.cfg templates.cfg nagios
# rpm -q gcc glibc glibc-common gd gd-devel xinetd openssl-devel
yum
1.
# yum install -y gcc glibc glibc-common gd gd-devel xinetd openssl-d evel
5.2
1. 2. 3.
;
5. “ 6. criticle 7.
service_notification_options ” w warn
; ; ; c
r
recover
; ;
8.
host_notification_options d down
d,u,r ;
;
9. unreachable 10. r recovery
; u
service_notification_commands
5.6 Apache web Php
Apache
Php nagios nagios web web
nagios nagios php a.
1. 2. 3. 4. 5.
nagios3.1.x nagios-3.4.3 php php5.4.10
web apache
php
Apache
# wget http://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz # tar zxvf httpd-2.2.23.tar.gz # cd httpd-2.2.23 # ./configure --prefix=/usr/local/apache2 # make && make install
--with-included-apr b.
1. 2. 3. 4.
Php
# wget http://cn2.php.net/distributions/php-5.4.10.tar.gz # tar zxvf php-5.4.10.tar.gz # cd php-5.4.10 # ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache 2/bin/apxs
Plugin Nagios SSH SSL
……
C++
Perl ruby
Python PHP C# Nagiosgrapher PNP4Nagios
Plugins Nagiosgraph
email, pager, sms
Nagios Nagios web Nagios nagios /libexec check_load ./check_xxx –h Nagios 2(CRITICAL) Nagios 0(OK) 3(UNKNOWN) web nagios CPU
Nagios
# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nag ios-plugins-1.4.16.tar.gz
2. 3. 4. 5.
# tar zxvf nagios-plugins-1.4.16.tar.gz # cd nagios-plugins-1.4.16 # ./configure --prefix=/usr/local/nagios # make && make install
192.168.1.113
NSClient++ web
Client
NRPE /iptables: Firewall is not running.
SELINUX=disabled
Nagios 5.1
1.
gcc glibc glibc-common gd gd-devel xinetd openssl-devel
5.4 /usr/local/nagios var etc bin sbin share Nagios
bin etc sbin share libexec var var/archives var/rw 5.5
1.
Nagios Nagios Nagios CGI Nagios Nagios Nagios Nagios lock
CentOS release 6.3 192.168.1.108 (Final)
nagios-plugins nagios-plugins nrpe
Nagios-Linux
CentOS release 5.8 192.168.1.111 (Final)
Nagios-Windows Server
Windows XP nagios
SMTP POP3 HTTP
NNTP
ICMP SNMP
FTP SSH Windows
CPU load disk usage system logs NSClient++ plugin
3. 4. 5. 6. plugin shell scripts 7. 8. 9. 10. plugin 11. 12. 13. 14. Web Nagios Nagios
;
host_notification_commands
Nagios
Nagios
Windows
Linux
Unix
Nagios
NetSaint
Ethan Galstad
NAGIOS "Agios" Unix
: "saint"
"Nagios Ain't Gonna Insist On Sainthood" Sainthood Nagios Linux
1. 2.
web
11.
Require valid-user
12. </Directory> 13. Alias /nagios "/usr/local/nagios/share" 14. <Directory "/usr/local/nagios/share"> 15. 16. 17. 18. 19. 20. 21. 22. AuthType Basic Options None AllowOverride None Order allow,deny Allow from all AuthName "nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd Require valid-user
23. </Directory>
d.
apache htpasswd
1.
# /usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd david
/usr/local/nagios/etc http://192.168.1.108/nagios/ e.
相关文档
最新文档