170 likes | 408 Views
Advisor : Quincy Wu Speaker : Xang-Ting Date : 2010/06/08. Monitor. Outline. What is nagios? Install Setup the web interface Configure NRPE. Nagios. Monitoring of a lot of network service(SMTP,POP,HTTP,NNTP,PING...) Monitoring of host resources. Web interface for monitoring.
E N D
Advisor : Quincy Wu Speaker : Xang-Ting Date : 2010/06/08 Monitor
Outline • What is nagios? • Install • Setup the web interface • Configure • NRPE
Nagios • Monitoring of a lot of network service(SMTP,POP,HTTP,NNTP,PING...) • Monitoring of host resources. • Web interface for monitoring. • Powerful plug-in.
Setup web interface • $make install-webconf Generate /etc/httpd/conf.d/nagios.conf • $service httpd restart • htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin • Default path : /usr/local/nagios/share • Url_path: http://localhost/nagios/
Conf-cgi.cfg , nagios.cfg • cgi.conf • $vi /usr/local/nagios/etc/cgi.cfg • use_authentication=1 • Safer!! • nagios.conf • $vi /usr/local/nagios/etc/nagios.cfg • check_external_commands=1 • This option allows you to specify whether or not Nagios should check for external commands. • command_check_interval=15s • It will leave nagios check for external commands every 15 seconds. • enable_notifications=1
Conf - timeperiods.cfg • Make user to define monitoring period. • $vi /usr/local/nagios/etc/object/timeperiods.cfg define timeperiod{ timeperiod_name workhours alias Normal Work Hours monday 09:00-17:00 tuesday 09:00-17:00 wednesday 09:00-17:00 thursday 09:00-17:00 friday 09:00-17:00 }
Configure-contacts.cfg • Define the way to notify the contacts when something is wrong. • $vi /usr/local/nagios/etc/object/ define contact{ contact_name nagiosadmin alias sysadmin email xxxxx@xxxxxx pager 1338757xxx } define contactgroup{ contactgroup_name sagroup alias System Administrators members nagiosadmin,test }
Conf-host.cfg • Define the host which you want to monitor. • $vi /usr/local/nagios/etc/object/host.cfg define host{ host_name nagios-server alias nagios server address 192.168.0.111 } define hostgroup{ hostgroup_name sa-servers alias sa Servers members nagios-server,host1... }
Conf-service.conf define service{ host_name nagios-server service_description check-host-alive check_command check-host-alive max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r contact_groups sagrou }
Notification options • Service notification options • w(warning) • n(unknown) • c(critical) • r(restore) • Host notification options • d(down) • u(unreachable) • r(restored)
Conf-command.cfg • Defind the command in /usr/local/nagios/libexec • ./check_udp -h • $vi /usr/local/nagios/object/command.cfg define command{ command_name check_udp command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$ }
Run nagios • $/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg • /etc/init.d/nagios start
Demo • Define my command. • Nagios with ftp
NRPE • When to use?