Nagios Fossed
Nagios Fossed
Having a tool in place that monitors systems and resources is an important part of an IT department.
No IT worker can be on duty 24x7. Everyone has more productive things to do with their time than to make sure a server is up or a service is functioning properly. Can help notify you of minor problems before they become big problems.
Example: EZProxy loosing HTTP service
What is it?
Nagios is software that will watch your servers, switches, routers, appliances, databases, the list is endless, and notify you when things change from normal operating parameters.
It runs on a variety of linux distributions. It is open source and free to download but also has paid support for those who need it. It is flexible and can be configured in a variety of ways to fit any organization.
10MB NIC
SSH access to the server I currently monitor hundreds of services and over a hundred nodes using a machine similar to these specifications and have no performance issues.
Core
The core is the heart of the program. It is what does the monitoring, alerting, scheduling, communications.
For windows users, you can think of this as the .exe file. It is installed as a service and for the most part, after a successful installation you wont deal with the core directly again.
Configuration Files
A Nagios install lives and dies by the configuration files.
Everything is done via these files from setting up schedules, contacts, things to monitor, services to check.
They are plain text files but do not let that fool you, they are very powerful and allow you to make Nagios do anything you want.
Plugins
Plugins are what allows Nagios to watch your devices and services.
The Nagios core is not capable of monitoring anything directly, it is all done via plugins.
The standard set of plugins is robust and encompasses a variety of operating systems, services and hardware.
There is a community of developers that create additional plugins for more obscure or for specific needs that are not met by the standard set.
Web Interface
The web interface is the only visual part of Nagios that you can see.
It aims for function over flashy. It has basic control components built into it but it primarily is meant to give a visual monitoring overview of your devices. No configuration is done via the web interface.
Web Interface
Plugins
START SMALL
KEEP IT SIMPLE
NRPE
Nagios Remote Plugin Executor, for monitoring linux and other *UX* based systems
SNMP
simple network management protocol, for monitoring hardware that supports this standard
Important Commands
Start, Stop, Restart Nagios:
sudo /etc/init.d/nagios3 start sudo /etc/init.d/nagios3 stop sudo /etc/init.d/nagios3 restart
(this is the one you will use the most)
etc/nagios-plugins
Contains config files for the plugins
/usr/lib/nagios/plugins/
Contains the binary files of the plugins
/usr/share/nagios3/htdocs/media/
Fun stuff, custom sounds
/usr/share/nagios/htdocs/images/logos/base
Fun stuff, Icons for your hosts
/etc/nagios
Contains the NRPE files for the remote linux host
NSClient++
NSClient is a very small plugin that is installed on a windows computer that will allow you to monitor a variety of things including but not limited to:
Memory Total and available RAM CPU Load average Disk Total and available hard drive space Service Confirm a specific service is running UpTime Operating system uptime EventLog Scan the event log for errors
http://nsclient.org/nscp/
NRPE
NRPE is Nagios Remote Plugin Executor
Allows Nagios Core to execute plugins remotely on a system Essentially allows you to install any Nagios plug in, be it part of the standard set or an extra one on a remote linux server and feed the results of that back to your Nagios server. Packages exist for a variety of linux flavors so you do not need to be running the same version of linux on the remote system as your Nagios deployment is installed on.
SNMP
Simple Network Management Protocol
SNMP is part of the standard set of Nagios plugins You need to obtain the MIBs for the device you are wanting to monitor and copy them to your Nagios server. The MIBs typically are obtained via the manufacture or via 3rd party websites. We could spend days on SNMP alone so we will get you started but since every device is unique in how their MIBs are designed you will need to do some trial and error to get it working properly. If you follow the steps to install used in this presentation, the location you should copy the MIBs to is:
/usr/share/snmp/mibs/
Nagios.cfg
Primary configuration file for Nagios core Default directory: /etc/Nagios3/
resource.cfg
Contains variable names for $USER1$, $USER2$ Default directory: /etc/Nagios3/ This location is specified in Nagios.cfg
You must edit the nrpe.cfg file on the target machine to include the Nagios server IP
You can customize the example commands in this file to tweak it to your needs.
You must have installed the NSClient service on the target machine for this to work. It is case sensitive! v uptime will not work but v UPTIME will.
You will need to create custom commands to monitor partitions C:, D:, G: etc.
Useful Websites
Nagios:
http://www.Nagios.org/
Nagios Plugins:
http://Nagiosplugins.org/
NSClient++
http://nsclient.org/nscp/
NRPE
http://www.Nagios.org/download/addons
SNMP
http://www.net-snmp.org/
Disclaimers
All company and product names used in this presentation are trademarked by their respective owners.
This presentation and videos are licensed under Creative Commons:
Creative Commons Attribution-NonCommercial-ShareAlike 3.0