Firefox 16, a treat for developers http://t.co/cnd27CzT
How to install Nagios in ubuntu 9.x and 10.x
Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better.
Nagios was originally designed to run under Linux, but also runs well on other Unix variants. It is free software, licensed under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Before to start, if you want to install Nagios in fedora ,RHEL or centos please read our previous tutorial
I- Install Apache, PHP and some needed libraries
First we will install apache , php and needed librairies
- Install some necessary compilers using the command :
sudo apt-get install build-essential
- Install GD Libraries using the command :
sudo apt-get install libgd2-xpm-dev
- Install Apache2
sudo apt-get install apache2
- Install PHP for apache 2 :
sudo apt-get install php5-common php5 libapache2-mod-php5
Now configure Apache to use PHP:
Open apache2.conf file
sudo vi /etc/apache2/apache2.conf
and add this line
DirectoryIndex index.html index.php index.cgi
Now restart your apache
sudo /etc/init.d/apache2 restart
II- Install and Configure Nagios :
Now lets install and configure Nagios
First download the latest core nagios from nagios website and before installing create a user to run the service and a group to run external commands:
* sudo useradd -m nagios
* sudo passwd nagios
* sudo groupadd nagcmd
* sudo usermod -a -G nagcmd nagios
* sudo usermod -a -G nagcmd www-data
Now install the Nagios tarballs that were downloaded previously:
tar -zxvf nagios-3.2.1.tar.gz
Then cd the the extracted folder and install
cd nagios-3.2.1
sudo ./configure --with-command-group=nagcmd
sudo make all
sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode
sudo make install-webconf
Add a user for the Nagios interface:
sudo mkdir /usr/local/nagios/etc
Create a new password
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Output
New password:
Re-type new password:
pirat9@pirat9-desktop:~/Downloads/nagios-3.2.1$
Now add Nagios directory to apache, first open apache.conf :
sudo vi /etc/apache2/apache.conf
and add these lines :
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
Alias /nagios /usr/local/nagios/share
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
save and exit then restart apache2
sudo /etc/init.d/apache2 restart
Install Nagios Plugins :
- Now we have to install Nagios plugins, first download the file from nagios website, then extract it using the command :
tar -zxvf nagios-plugins-1.4.14.tar.gz
- Cd the extracted folder and install the plugins
cd nagios-plugins-1.4.14
sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
sudo make
sudo make install
-
Create a link to start the service:
sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
ls -altr
Output
total 20
-rw-r–r– 1 root root 447 2009-09-07 20:58 README
lrwxrwxrwx 1 root root 20 2010-04-04 22:10 S70x11-common -> ../init.d/x11-common
lrwxrwxrwx 1 root root 24 2010-04-04 22:10 S70screen-cleanup -> ../init.d/screen-cleanup
lrwxrwxrwx 1 root root 17 2010-04-04 22:10 S55urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 23 2010-04-04 22:10 S49console-setup -> ../init.d/console-setup
lrwxrwxrwx 1 root root 18 2010-04-04 22:10 S37apparmor -> ../init.d/apparmor
lrwxrwxrwx 1 root root 16 2010-04-04 22:10 S25brltty -> ../init.d/brltty
lrwxrwxrwx 1 root root 21 2010-04-04 22:10 S13pcmciautils -> ../init.d/pcmciautils
lrwxrwxrwx 1 root root 24 2010-04-04 22:10 S06keyboard-setup -> ../init.d/keyboard-setup
drwxr-xr-x 132 root root 12288 2010-04-15 01:45 ..
lrwxrwxrwx 1 root root 18 2010-04-15 02:09 S99nagios -> /etc/init.d/nagios
drwxr-xr-x 2 root root 4096 2010-04-15 02:09 .
Please before running the configuration check and copy all config files from your nagios directory to /usr/local/nagios/etc/objects/ and /usr/local/nagios/etc/
like
config file ‘/usr/local/nagios/etc/objects/commands.cfg’…
object config file ‘/usr/local/nagios/etc/objects/contacts.cfg’…
object config file ‘/usr/local/nagios/etc/objects/timeperiods.cfg’…
object config file ‘/usr/local/nagios/etc/objects/templates.cfg’…
object config file ‘/usr/local/nagios/etc/objects/localhost.cfg’…
- Verify the config:
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Output :
Nagios Core 3.2.1
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-09-2010
License: GPL
Website: http://www.nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/usr/local/nagios/etc/objects/commands.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/contacts.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/timeperiods.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/templates.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/localhost.cfg’…
Read object config files okay…
Running pre-flight check on configuration data…
Checking services…
Checked 8 services.
Checking hosts…
Checked 1 hosts.
Checking host groups…
Checked 1 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 24 commands.
Checking time periods…
Checked 5 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
pirat9@pirat9-desktop:~/Downloads/nagios-3.2.1$
- Now start Nagios:
sudo /etc/init.d/nagios start
- Now you are ready to use Nagios, open your browser and type :
http://hostname/nagios or http://ip/nagios



{loadposition user9}
Related Articles By Tags:
{loadposition user1}
-
-
-
-
-
-
-
-
-
-
-
http://RE:AllowOverridenotallowedhere
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
http://www.unixmen.com
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
http://enteryoursiteURL...
-
-
-
-
-
-
http://www.aloser.rs
-
-
http://enteryoursiteURL...
-
http://www.italic-solution.com/
-
-
-
-
-
-
-
http://enteryoursiteURL...
-
http://enteryoursiteURL...
-
http://www.bestfinance-blog.com
-
http://www.bestfinance-blog.com
-
http://www.bestfinance-blog.com
-
-
http://servertechz.com/?s=nagios
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Like us on Facebook
This week Top Posts 
Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
Install and Configure Samba share in Ubuntu 13.04 Raring Ringtail , 12.10, 12.04| Howto : Updated 05-04-2013: One of the most asked features for Samba is a graphical user interface to help w...0 comment(s) |
How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comment(s) |
Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
Recent Posts
- Setup Backup server using rsnapshot on RHEL / CentOS / Ubuntu / Debian
- How to disable/change default PDF viewer in Mozilla Firefox
- Dictionaries in Python
- How to Install uTorrent Client on Ubuntu/Debian/Linux Mint
- Lists in Python
- Argument Handling in Python
- Setup your own Wikipedia like website using MediaWiki
- Administer your Server using Ajenti Server Manager
- “Brand New” Unixmen Forum is Now Live!
- How To: Disable or Enable Guest Account in Ubuntu 13.04
Recent Comments



















Ladi Oyekanmi
| #
Could you please assist in step by step on how to install nagios on solaris
Adhraa
| #
Greate tutorial :)
pigmej
| #
Just one thing:
What about pep8 in your python code ? How can you give ‘tutorials’ on quite popular website, of such a bad quality ?
Amit Rai
| #
I just renamed shared.xml and it logged in and created a new shared.xml.
DB Griffin
| #
Larry Page is not being completely honest! The manner in which the PRISM program/project works does not need access from company administrators or owners, so called “direct access”; the access to the information is already there. These tech company CEOs take for granted the actual intelligence of most end users of their products. All it takes is a little digging and reading to go from ignorant to informed on these things especially on exactly how the internet works/functions in the U.S.A. I find Larry Page’s remarks just as laughable as Al Gore’s claim to “inventing” the internet/world wide web!
If you, as an end user, are reading this post; I challenge you to research these matters yourself. It really is quite simple with all the “information sites” that exist on the web today ie Wikipedia, & other online encyclopedias that actually list source material, as well as highly respected tech sites and blogs that also list their source material. Be warned: this is only the tip of the iceberg and these tech CEOs know and understand this; they are scrambling in attempt to perform DAMAGE CONTROL to save the company and what little trust thay have left from their products end users/consumers.
Am I a skeptic? I believe someone has to be or needs to be at this point in time! If your not just a little skeptical of the government, tech companies, and the people that are in charge of these agencies and companies; you need to be, even if just a little skeptic. For your own personal protection and security! I know I was a part of this community for over 14 years!