How to Install Nagios 3 on Ubuntu 8.10
Nagios is a free, open-source tool that can be used to monitor network components and services. When it detects a problem, it can send alert messages by either e-mail or pager. It can also be configured so that only designated personnel can view status information for particular services or equipment. This tutorial will show you how to install Nagios 3 on an Ubuntu 8.10 server.
Installation
Nagios3 is in the repository for Ubuntu 8.10.
sudo apt-get install nagios3You can see that it will install a number of packages to make it all work.
The following extra packages will be installed:
libfreetype6 libgd2-noxpm libjpeg62 libnet-snmp-perl libperl5.10 libpng12-0
libradius1 libsensors3 libsnmp-base libsnmp15 libsysfs2 libtalloc1
libwbclient0 nagios-images nagios-plugins nagios-plugins-basic
nagios-plugins-standard nagios3-common nagios3-doc radiusclient1
samba-common smbclient snmp
Suggested packages:
libfreetype6-dev libgd-tools libcrypt-des-perl libdigest-hmac-perl
libdigest-sha1-perl libio-socket-inet6-perl lm-sensors nagios2 nagios-text
nagios whois nagios-nrpe-plugin smbfs
The following NEW packages will be installed:
libfreetype6 libgd2-noxpm libjpeg62 libnet-snmp-perl libperl5.10 libpng12-0
libradius1 libsensors3 libsnmp-base libsnmp15 libsysfs2 libtalloc1
libwbclient0 nagios-images nagios-plugins nagios-plugins-basic
nagios-plugins-standard nagios3 nagios3-common nagios3-doc radiusclient1
samba-common smbclient snmp
0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.5MB of archives.
After this operation, 54.6MB of additional disk space will be used.
Once it is installed run a pre-flight check to verify it is working correctly.
Pre-Flight Check
sudo nagios3 -v nagios.cfg
Nagios 3.0.2
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL
Reading configuration data…
Running pre-flight check on configuration data…
Checking services…
Checked 7 services.
Checking hosts…
Checked 2 hosts.
Checking host groups…
Checked 5 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 142 commands.
Checking time periods…
Checked 4 time periods.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…
Total Warnings: 0
Total Errors:Â Â 0
Things look okay – No serious problems were detected during the pre-flight check
By default it should run and you should be able to login to the web interface after you create the nagios user. Move into the /etc/nagios3 directory and create a user to access the web interface.
htpasswd -c htpasswd.users nagios
New password:
Re-type new password:
Adding password for user nagios
Now login to the web interface with http://ip_address/nagios3
You will not have all of the rights to view everything but for the purposes of making sure it all works you will see it is all running.  Now you need to configure it for your settings.
Basic ConfigurationÂ
The configuration is where you will get to set up the services and hosts that you need.
Now, cd to the /etc/nagios3 directory.
cd /etc/nagios3
Here you will see the base file nagios.cfg. The additional configuration files are located in conf.d.
contacts_nagios2.cfg        generic-service_nagios2.cfg    localhost_nagios2.cfg
extinfo_nagios2.cfg         host-gateway_nagios3.cfg       services_nagios2.cfg
generic-host_nagios2.cfg    hostgroups_nagios2.cfg         timeperiods_nagios2.cfg
Check the “timeperiods_nagios2.cfg†file to define different time periods for when you want certain functions to happen. Here’s an example:
# Time periods
# All times are valid for all
# checks and notifications
define timeperiod{
timeperiod_name 24×7
alias             24 Hours A Day, 7 Days A Week
sunday         00:00-24:00
monday       00:00-24:00
tuesday        00:00-24:00
wednesday   00:00-24:00
thursday       00:00-24:00
friday           00:00-24:00
saturday       00:00-24:00
}
define timeperiod{
timeperiod_name 8×5
alias               8 Hours A Day, 5 Days A Week
monday         08:00-16:00
tuesday          08:00-16:00
wednesday    08:00-16:00
thursday        08:00-16:00
friday            08:00-16:00
}
Check, the “contacts_nagios2.cfg†file. This will define the types of notifications that individuals and groups will receive, and when they will be contacted.
# Contacts–Individuals and Groups
define contact{
contact_name                               fred
alias                                             Nagios Admin
service_notification_period         24×7
host_notification_period              24×7
service_notification_options       w,u,c,r
host_notification_options             d,r
service_notification_commands   notify-by-email
host_notification_commands        host-notify-by-email
email                                             fred.smith@some_mail.net
}
The email account that you add for the Nagios Admin should be your main email account as this will be used to send you information.
# contact groups
# Nagios only talks to contact groups, not individuals
# Members must be Nagios users, alias and contact_group
# are whatever you want
define contactgroup{
contactgroup_name              admins
alias                                      Nagios Administrators
members                                fred
}
In this file, each person who is to be a contact must have his own “define contact†section. Each person must also be a member of a “contactgroupâ€. Also, each person who is to be a contact must have a system account on the Nagios server, have a Nagios password, and be a member of the “nagios†group. (This group will be created automatically when you install Nagios.)
useradd -m -G nagios fred
passwd fred
If you haven’t yet created the Nagios password database, you’ll use the “htpasswd†command with the -c option to create the new file.
htpasswd -c /etc/nagios/htpasswd.users nagios
If the database has already been created, and you just want to add a new user to it, then omit the -c option:
 Now you should be able to see the host that you set up for an example and see that it is monitoring. You are ready to begin the next phase of setting up a loto of hosts and services to monitor
Latest posts by Editor (see all)
- How to Show files by size, biggest last- Linux Commands - January 21, 2011
- How to test for unreadable blocks on disk- Linux Commands - January 21, 2011
- How to Do a read speed test on disk sda – Linux Commands - January 21, 2011
5mb, alert messages, cfg, checking services, configuration data, e mail, ethan galstad, flight check, free open source, hmac, license gpl, nagios plugins, network components, open source tool, samba, server installation, smbclient, snmp
Leave a Reply Cancel reply
Categories
- Alerts & News
- Android
- Anti-Malware
- Anti-Spam/Virus
- Anti-Spyware
- Anti-Virus
- Apache
- Archiving
- Articles
- Audio and Video
- AWS
- Backup
- Backup
- Braindumps
- Browsers
- Browsers and Plugins
- Build Tools
- Cacti
- CentOS
- Cisco
- Cisco IOS Command Reference
- Citrix NetScaler
- Cleaning and Tweaking
- Clustering
- Clustering
- Compilers
- Data recovery
- Database
- Database
- Databases
- Debuggers
- Dell
- Dell
- Desktops
- Developer
- DHCP
- DNS
- Drivers Download
- Drupal
- Editors
- Encryption Software
- Exchange Server
- Fedora
- File Management
- firefox
- Firefox Add-ons
- Firewall
- Free ebooks
- Free software downloads
- Free Tools
- FTP
- FTP
- Games
- Google Plus
- Graphics
- Hacking
- Hardware
- Help Desk software
- High-Availability
- HP
- HP
- IIS
- Interpreters
- iphone
- IT-Tips
- LAMP
- Languages
- Laptops
- Latest Product & Technologies
- Linux
- Linux Commands
- Load Balancer
- Mac
- Memcached
- Messaging and Chat
- miscellaneous
- Mobile Development
- Mobiles
- Monitoring
- MySQL
- NAS
- Networking
- Networking
- Networking Software
- Office and News
- Open Source
- OpenSource Applications
- openSUSE
- Oracle
- PHP
- Popular downloads
- PostgreSQL
- Project Management Software
- Qmail
- Red Hat
- Remote Access
- Repository
- Sci-Tech Education
- Security
- Security
- Sendmail
- SEO
- SEO Tools
- Server OS
- Service Pack
- social networking
- Software Development
- solr
- SQL
- Squid
- Storage
- Sun Solaris
- System Tuning
- Tech Guru
- Technology News
- Testing
- Ubuntu
- Utilities
- Version Control
- Video Tutorial
- Virtual Machine Applications
- Virtualization
- VoIP
- VPN
- Web-related
- web-related
- Websense
- Website Promotion
- Windows
- Windows Commands
- Zend Studio
Recent Posts
- Microsoft Office for iPhone – Changing Strategy of Microsoft
- Guidelines for International websites from Google
- Google is to Change the rankings of smartphone search results
- we are back
- The best memcached Monitoring tool
