Tuesday, August 28, 2012
HOW TO INSTALL NAGIOS ON UBUNTU 12.04
Monitoring plays an important role in running our systems smoothly. It is always better to diagnose the problems and take some measures as early as possible, rather than waiting for things to go worse.
Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. For a detailed information on Nagios you can visit the official documentation page here. I'll just cover the steps to install and get Nagios working on your Ubuntu box.
First of all install Nagios on your Ubuntu box using the following command :
$ sudo apt-get install -y nagios3
It will go through, and ask you about what mail server you want to use. You'll see something like this on your screen.
Pick one as per your requirements.
It will then ask you about the domain name you want to have email sent from. Again, fill that out based upon your needs.
It will ask you what password you want to use - put in a secure password. This is for the admin account nagiosadmin.
NOTE : Keep the account name and password name in mind as you'll need it to log in to Nagios.
It'll ask you to verify your password.
Once the install is all done, point your web browser to localhost/nagios3 or whatever the IP address/domain name of the server you installed Nagios on is.
At this point you'll be asked to enter your password. Enter your password and hit enter.
Once you've done that, you're in and you'll see something like this on your screen.
Nagios automatically adds in the 'localhost' to the config, and does load, current users, disk space, http and ssh checks.
Before leaving we have to do one more thing to make Nagios all set. We need to have it accept external commands so that we can acknowledge problems, add comments, etc. To do that, we need to edit a few files.
Start by opening /etc/nagios3/nagios.cfg with the following command.
$ sudo nano /etc/nagios3/nagios.cfg
Now, search for check_external_commands, and turn the check_external_commands=0 into check_external_commands=1.
Now, restart apache by running.
$ sudo service apache2 restart
Not done yet! We need to edit /etc/group. There should be a line like this in there.
nagios:x:114
Change it to
nagios:x:114:www-data
Save and close this file.
Now, we need to edit the /var/lib/nagios3/rw files permission with.
$ sudo chmod g+x /var/lib/nagios3/rw
And then (because of how permissions work) we need to edit the permissions of the directory above that with.
$ sudo chmod g+x /var/lib/nagios3
Now, restart nagios with.
$ sudo service nagios3 restart
And you should be good to go! Happy monitoring!
NOTE : Do not forget to let me know whether it worked for you or not.
Subscribe to:
Post Comments (Atom)
How to work with Avro data using Apache Spark(Spark SQL API)
We all know how cool Spark is when it comes to fast, general-purpose cluster computing. Apart from the core APIs Spark also provides a rich ...
-
HBase shell is great, specially while getting yourself familiar with HBase. It provides lots of useful shell commands using which you ca...
-
Hive is a wonderful tool for those who like to perform batch operations to process their large amounts of data residing on a Hadoop cluster ...
-
SSH (Secure Shell) is a network protocol secure data communication, remote shell services or command execution and other secure network ser...
Very helpful and easy to understand..Appreciate it.
ReplyDeletePlease post links to configure SSH and other components in Nagios.
Thanks in advance.
Glad to hear that it helped you. For ssh+nagios you can go to :
ReplyDeletehttp://www.techrepublic.com/blog/opensource/remotely-monitor-servers-with-the-nagios-checkbyssh-plugin/321
HTH
Thanks.How to add linux and windows host in this nagios...
ReplyDeleteHi Sathis,
DeleteThis link explains the procedure in great detail :
http://winlinuxnet.blogspot.in/2011/10/adding-windows-host-in-to-nagios.html
HTH
how to enable router and switch monitoring, I can able to find object fold in /etc/nagios3 folder. Help please.
ReplyDeleteThanks in advance.
Hello Mri,
DeleteYou can visit this link http://nagios.sourceforge.net/docs/3_0/monitoring-routers.html
It explains the procedure in detail. Let me know if you face any issue.
Many thanks for this. Details were very helpful. A few changes on permissions I'm not clear on as of yet, but I think I get the gist of it.
ReplyDeleteOne thing is your font on the page, I had to copy the page into a txt editor to read.
Thank you so much for the valuable feedback..It is always helpful..I'll try to add more details and change the font.
Delete