View
105
Download
4
Category
Tags:
Preview:
DESCRIPTION
Linux Network Server Group: Nagios. Marc Bechtel Sebastian Blümel Alexandre Quignon. Table of Contents. Overview Requirements (MYSQL, APACHE, CONFIGS…) A short introduction to Nagios Nagios-Configuration with Fruity Installation and Configuration Problems Nagios in Action - PowerPoint PPT Presentation
Citation preview
M. Bechtel, S. Blümel, A. Quignon 1
Linux Network ServerGroup: Nagios
Marc Bechtel
Sebastian Blümel
Alexandre Quignon
M. Bechtel, S. Blümel, A. Quignon 2
Table of Contents
1. Overview
2. Requirements (MYSQL, APACHE, CONFIGS…)
3. A short introduction to Nagios
4. Nagios-Configuration with Fruity
5. Installation and Configuration Problems
6. Nagios in Action
7. Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 3
Requirements
YUM-Installation Manager
MySQL 5.0.4-5
Apache 2.0.52-28
PHP 5.0.4-5
Postfix 2.2.2.10-1
Self installed
Nagios 2.5
Fruity 1 RC 1
./chkconfig --add httpd
./chkconfig --level 235 httpd on
./chkconfig –add mysql
./chkconfig --level 235 mysql on
./chkconfig –add nagios
./chkconfig --level 235 nagios on
6 different runlevels
0 - Halt the system 1 - Single-user mode 2 - Multi-user mode (without NFS) 3 - Multi-user mode 5 - Multi-user mode, graphical login 6 - Reboot the system
M. Bechtel, S. Blümel, A. Quignon 4
Table of Contents
1. Overview
2. Requirements (MYSQL, APACHE, CONFIGS…)
3. A short introduction to Nagios
4. Nagios-Configuration with Fruity
5. Installation and Configuration Problems
6. Nagios in Action
7. Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 5
What is Nagios?
Nagios is System and network monitoring application
Developed by Ethan Galstad
Formerly know as Netsaint (2002)
Nagios is open source Software (General Public License)
current verion is 2.5
„Nagios is quite powerful and flexible, but unfortunately its not very friendly to newbies. Why? Because it takes a lot of work to get it installed and configured properly. That being said, if you stick with it and manage to get it up and running, you’ll never want to be without it. :-)“
M. Bechtel, S. Blümel, A. Quignon 6
Monitoring of…
Nagios can supervise:
Hosts (Windows, Linux, …) and host resources (Disk Usage, Load)
Services (FTP, Mail, HTTP, …)
SNMP Traps
other hardware devices (like temperature sensors,filling level indicator,…)
In case of emergency send notifications:
email, pager, SMS
any user-defined method through plug-in system
M. Bechtel, S. Blümel, A. Quignon 7
Plug-in concept
How is this achieved?
build in check services (DNS, SNMP, SMTP, ICMP,…)
by simple plug-in design that allows users to easily develop their own service checks
Upside: You can monitor just about anything you can think of!
Downside: Nagios cannot produce graphs of collected data because it has no further information about what you are monitoring!
Check Plugin
Webfrontend
Nagios Deamon
Administrator
Check Status
OK,Warning,Critical
Notification
M. Bechtel, S. Blümel, A. Quignon 8
Configuring Nagios
As all Linux Software Nagios heavily relies on config files!
We will have a (short) look at:
httpd.conf
nagios.cfg
hosts.cfg & hostgroup.cfg
contacts.cfg & contactsgroup.cfg
services.cfg and commands.cfg
Do I have to configure all by hand?
M. Bechtel, S. Blümel, A. Quignon 9
Configuration-Files
M. Bechtel, S. Blümel, A. Quignon 10
Apache: httpd.conf
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory "/usr/local/nagios/sbin">
Options ExecCgi
AllowOverride AuthConfig
Order allow, deny
Allow from all
</Directory>
Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
Options ExecCgi
AllowOverride AuthConfig
Order allow, deny
Allow from all
</Directory>
Configure Script Alias For The CGIs: default installation expects to find them accessible at http://yourmachine/nagios/cgi-bin/
Configure Alias For The HTML Files: to make the HTML files accessible via the web server
http://192.168.10.4/nagios
M. Bechtel, S. Blümel, A. Quignon 11
Main Configuration File: nagios.cfg
Location: /usr/local/nagios/etc/nagios.cfg
Refers to all other config files
First file read by the Nagios process
Extract:
log_file=/var/log/nagios/nagios.log
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/commands.cfg
M. Bechtel, S. Blümel, A. Quignon 12
host.cfg and hostgroup.cfg
define host {
host_name FTP
alias FTP Server
address 192.168.10.21
check_command Ping
check_period 24x7
contact_groups LNS
}
define hostgroup{
hostgroup_name AllServers
alias all Server
members FTP
}
Description: A host definition is used to define a physical server, workstation, device, etc. that resides on your network.
Description: A host group definition is used to group one or more hosts together for display purposes in the CGIs.
M. Bechtel, S. Blümel, A. Quignon 13
contactgroups.cfg and contacts.cfg
define contactgroup{
contactgroup_name LNS
alias ThisIsATestGroup
members Marc
}
define contact{
contact_name Marc
alias Marc Bechtel
host_notification_period 24x7
host_notification_commands
send_notification_mail_host
email marcbechtel@gmail.com
}
Description: A contact group definition is used to group one or more contacts together for the purpose of sending out alert/recovery notifications.
Description:A contact definition is used to identify someone who should be contacted in the event of a problem on your network.
M. Bechtel, S. Blümel, A. Quignon 14
Configuration-Files
M. Bechtel, S. Blümel, A. Quignon 15
services.cfg and commands.cfg
define service {
service_description Ping
check_command Ping
max_check_attempts 2
contact_groups LNS
}
define command{
command_name Ping
command_line /usr/local/nagios/libexec/check_icmp $HOSTADDRESS$ -c 500,10%
}
Description:A service definition is used to identify a "service" that runs on a host.
Description:How to perform a service check.
M. Bechtel, S. Blümel, A. Quignon 16
Verifying Your Nagios Configuration:
Pre-Flight Check with the –v option/usr/local/nagios/bin/nagios -v <main_config_file>
Nagios verifies that you have defined the necessary data relationships for monitoring.
1. Verify that all contacts are a member of at least one contact group.
2. Verify that all contacts specified in each contact group are valid.
3. Verify that all hosts are a member of at least one host group.
4. Verify that all hosts specified in each host group are valid.
5. Verify that all hosts have at least one service associated with them.
…
M. Bechtel, S. Blümel, A. Quignon 17
Table of Contents
Overview
Requirements (MYSQL, APACHE, CONFIGS…)
A short introduction to Nagios
Nagios-Configuration with Fruity
Installation and Configuration Problems
Nagios in Action
Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 18
Fruity
What is Fruity?
PHP based web-frontend
Open Source project
Why are we using Fruity?
Simplicity
Easy to make changes
No manual *.cfg file handling
Demonstation of Fruity
M. Bechtel, S. Blümel, A. Quignon 19
Table of Contents
Overview
Requirements (MYSQL, APACHE, CONFIGS…)
A short introduction to Nagios
Nagios-Configuration with Fruity
Installation and Configuration Problems
Nagios in Action
Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 20
Fruity Configuration Problems
SELinux blocking write access for Fruity
File missing:
/usr/local/nagios/objectconf/oconf.cfg
Two processes at shutdown
M. Bechtel, S. Blümel, A. Quignon 21
Table of Contents
Overview
Requirements (MYSQL, APACHE, CONFIGS…)
A short introduction to Nagios
Nagios-Configuration with Fruity
Installation and Configuration Problems
Nagios in Action
Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 22
Monitoring
What is offered by Nagios ?
Host Monitoring
Service Monitoring
Status Map
3D Map
M. Bechtel, S. Blümel, A. Quignon 23
Reporting
Nagios Standard
Trends
Availability
Alert Diagrams
Notification / Event Log
PNP
Performance Diagrams
M. Bechtel, S. Blümel, A. Quignon 24
Notification
Mail command
Miranda
Mailbox Root
M. Bechtel, S. Blümel, A. Quignon 25
Table of Contents
Overview
Requirements (MYSQL, APACHE, CONFIGS…)
A short introduction to Nagios
Nagios-Configuration with Fruity
Installation and Configuration Problems
Nagios in Action
Nagios with SNMP and Cisco
M. Bechtel, S. Blümel, A. Quignon 26
What’s a MIB
Used to manage devices in a Network
Hierarchical database
All objects are addressed through a OID (Object Identifier)
Is used by SNMP (Simple Network Management Protocol)
There are Standard and Enterprise MIBs
IF-MIB: RFC 2863
IP-MIB: RFC 4293
CISCO-PRODUCTS-MIB: www.cisco.com
M. Bechtel, S. Blümel, A. Quignon 27
Cisco Catalyst 2950 SNMP Check
MIB-II: RFC 1213
OID: 1.3.6.1.2.1.2.2.1.8. <Interface Nr>
Values: 1, 2, 3 (up, down, testing)
Command:
check_snmp -H 192.168.10.150 -o 1.3.6.1.2.1.2.2.1.8.17 -C public -c 1:1
M. Bechtel, S. Blümel, A. Quignon 28
QUESTIONS
Recommended