0% found this document useful (0 votes)
74 views14 pages

Network Management With Nagios

This document provides an overview of how to install, configure, and use the Nagios network monitoring tool. It discusses Nagios' benefits, prerequisites for installation like Apache and development libraries, and step-by-step instructions for downloading, compiling, and configuring Nagios. It also demonstrates how to define hosts and services to monitor, check configurations, and restart Nagios. The document encourages learning plugins to expand Nagios' monitoring capabilities.

Uploaded by

Roger Rodrigues
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views14 pages

Network Management With Nagios

This document provides an overview of how to install, configure, and use the Nagios network monitoring tool. It discusses Nagios' benefits, prerequisites for installation like Apache and development libraries, and step-by-step instructions for downloading, compiling, and configuring Nagios. It also demonstrates how to define hosts and services to monitor, check configurations, and restart Nagios. The document encourages learning plugins to expand Nagios' monitoring capabilities.

Uploaded by

Roger Rodrigues
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Network Management with Nagios

Sebastian Bttrich, wire.less.dk edit: October 2008 @ Sengerema Telecentre, Tanzania

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK http://creativecommons.org/licenses/by-nc-sa/3.0/ www.itrainonline.org

Agenda
What is it? Why use it? Installing Configuring Introduction to the Nagios web interface

Lab & Exercises: Using Nagios monitor a server/gateway Lab & Exercises: Using plugins

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Nagios What is it? Why use it?


Nagios is a great network monitoring and management tool. It provides a valuable management dashboard. It's open source / free software. Similar systems and alternatives (partly overlapping with Nagios) include: Cacti, mrtg / rrdtools, nedi

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Installing Prerequisites
Apache 2 GCC compiler and development libraries GD development libraries Ubuntu: You can use apt-get to install these packages by running the following commands: > sudo apt-get install apache > sudo apt-get install build-essential

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Installing Steps
Get sources, currently: nagios-3.0.4.tar.gz
> wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.4.tar.gz > wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.12.tar.gz Depending on where you are, you might want to use a mirror closer to you! Start here: http://www.nagios.org/download/

> tar -xzvf nagios-_._._.tar.gz Follow <nagios-dir>/html/docs/quickstartubuntu.html ... or the guides for other linux distros, if you are on another one

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Installing Creating user and group


As root, run the following commands to create the nagios user and group: /usr/sbin/useradd -m nagios passwd nagios /usr/sbin/groupadd nagios /usr/sbin/usermod -G nagios nagios /usr/sbin/groupadd nagcmd /usr/sbin/usermod -G nagcmd nagios /usr/sbin/usermod -G nagcmd www-data

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Installing Configuring and building


Run the Nagios configure script, passing the name of the group you created earlier like so: > ./configure --with-command-group=nagcmd Compile the Nagios source code. > make all Install binaries, init script, sample config files and set permissions on the external command directory. >make install >make install-init >make install-config > make install-commandmode View and edit config files in /usr/local/nagios/etc Install the Nagios web config file in the Apache conf.d directory. >make install-webconf Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later. > htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin Restart Apache to make the new settings take effect. ItrainOnline MMTK www.itrainonline.org 7

7 November 2005 >/etc/init.d/apache2 reload Sebastian Bttrich

Web interface Introduction


If everything went well, now go to: http://localhost/nagios

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

Using Nagios Monitoring a server


Task: Monitoring your gateway or main server 2 kinds of monitoring: Publicly available services Internal services (via ssh / plugins) Nagios relies on objects (hosts, groups, services, ...) and their configuration Start by creating a host configuration Example config files are in /usr/local/nagios/etc/objects/
7 November 2005 Sebastian Bttrich ItrainOnline MMTK www.itrainonline.org 9

Using Nagios Monitoring a server


Example of a host definition
definehost{ use generichost ;Inheritdefaultvaluesfromatemplate host_name wimbo ;Thenamewe'regivingtothishost alias myownlaptop ;Alongernameassociatedwiththehost address 127.0.0.1 ;IPaddressofthehost hostgroups allhosts ;Hostgroupsthishostisassociatedwith }

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

10

Using Nagios Monitoring a server


Example of a service definition monitoring ssh on our gateway, using the check_ssh plugin
defineservice{ use genericservice host_name wimbo service_description SSH check_command check_ssh } ;Inheritdefaultvaluesfromatemplate

7 November 2005 Sebastian Bttrich

ItrainOnline MMTK www.itrainonline.org

11

Using Nagios Monitoring a server


Whenever you are done adding a host or service, or have made any change, check the config by >/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg Remember that your new files need to be enabled in nagios.cfg, by a cfg_file or cfg_dir directive ! And restart Nagios like so >/etc/init.d/nagios start
7 November 2005 Sebastian Bttrich ItrainOnline MMTK www.itrainonline.org 12

Using Nagios Becoming a Nagios expert


The secret to using Nagios at its full potential is: Learn to work with configuration files (services) and plugins. There are many websites with plugin repositories. All documenation for Nagios is included in what you have installed on your system, so use it :)
7 November 2005 Sebastian Bttrich ItrainOnline MMTK www.itrainonline.org 13

That was it ... Thank you!


[email protected] http://wire.less.dk
Sebastian Bttrich, wire.less.dk edit: October 2008

http://creativecommons.org/licenses/by-nc-sa/3.0/

Sources:
7 November 2005 Sebastian Bttrich ItrainOnline MMTK www.itrainonline.org 14

You might also like