How to install and configure Nagios on Ubuntu 9.04
Posted: July 13, 2009 at 2:31 pm | Tags: alerts , configure , Linux , Nagios , UbuntuNagios is a good open source tool for monitoring network components and services. It Can be configured to send alerts by e-mail
That given the new version (3) Can be found in repositories, installation is much easier now, using apt-get:
sudo apt-get install nagios3
Checking the installation:
nagios3 sudo-v nagios.cfg
This is how the testing should look like:
Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 01/12/2008
License: GPL
Reading configuration on ...
Running pre-flight check on configuration on ...
Checking services ...
Checked 7 services.
Checking hosts ...
Checked two hosts.
Checking host groups ...
Checked 5 host groups.
Checking service groups ...
Checked 0 service groups.
Checking contacts ...
Checked two contacts.
Checking contact groups ...
Checked a 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 150 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 ...
Obsessive compulsive processor commands ... Checking
Checking misc settings ...
Total Warnings: 0
Total Errors: 0
Things look okay - No Serious Problems Were Detected During the pre-flight check
Everything should Be OK. That errors may occur is in most Cases Because of permissions.
Now we have to add the user for Nagios (before that, the you have to get to / etc/nagios3):
cd / etc/nagios3
sudo htpasswd-c htpasswd.users Nagios
Must enter the password for the new user Twice:
New password:
Re-type new password:
Adding password for user Nagios
At this point, Nagios Web interface Can be accessed by:.
http://localhost/nagios3/
or, http://IP/nagios3/
Now You Can configure Nagios. Configuration file resides in / etc/nagios3/nagios.cfg. The rest of the files Which allow various configurations is found in conf.d. In contacts_nagios2.cfg file the email account you CAN set the alerts will be sent WHERE to:
gedit contacts_nagios2.cfg
define contact {
contact_name alex
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-service-by-email
host_notification_commands notify-host-by-email
email alex@domain.com
}
E-mails will be sent to alex@domain.com.
Each Must Be Added to contactgroup contact:
contactgroup define {
contactgroup_name admins
alias Nagios Administrators
members alex
}
Adding the new user to Nagios group:
useradd-m-G Nagios alex
passwd alex
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated Successfully
In the web interface you may Receive the Following message:
It appears as though you do note have permission to view information for Any of the services you Requested ...
In this case you have to edit cgi.cfg:
sudo gedit cgi.cfg
In this file change tissue lines:
authorized_for_system_information = Nagios
authorized_for_configuration_information = Nagios
authorized_for_system_commands = Nagios
authorized_for_all_services = Nagios
authorized_for_all_hosts = Nagios
authorized_for_all_service_commands = Nagios
authorized_for_all_host_commands = Nagios
, Where "Nagios" That is the user HAS installed Nagios.
If you used this tutorial or have Any questions, feel free to leave a comment Below. You Can Also rate this tutorial to let me know how I'm doing. Thanks! ![]()




























The Discussion
see what everyone is Saying
[...] Use this addon, Nagios obviously need to be installed. No [...]
Very good tutorial. There are plenty of tutorials for installing Nagios on the net, but with your tutorial and I've managed to put up Nagios.
Thanks!
@ Adrian: I'm glad you helped. The autors try to post more tutorials about different.
mee too
I sincerely doubt that will go about ceva.dar ... to my amazement .. tutorial is a very well explained and ptr unaware ...
I'm one of them and I want to thank you.
if you can come up with a little help and meaning mysql management settings and possibly on how to "work" with him broswer + some php admin would already be all you can say about webhosting.
Many thanks again
@ BFC

I'm glad the tutorial helped you - know that all tutorials / methods presented here are tested, so as to not have much work.
Of course I want to make many more tutorials, possibly to complete something for the existing, but have very little time for me to take care of it.
I do not understand what you mean when you say "help in the sense mysql and php admin" - an installation guide for this?
Thanks for comment and you wait here.
Seems to Be a clean tutorial. I'll Give it a try!
@ Armanca: Please try it and let me know if you encounter Any problems.
thank you very much .. this article really helps me a lot ..
Would Be nice to know WHERE the check_command definitions for all the plugins Resid. Does not include check_http commands.cfg Ubuntu's, so it apparent what's note Can be used as check_http! Foo
Hi,
I want to add multiple Windows server to monitor for Nagios, please help how it's Possible.
i am not understand how I Will Able to add multiple windows machine in windows.cfg file, When I am changing host_name alias name and THEN do not start Nagios services and getting error please check configuration file.
Please Help me.
Thanks
Rajnish
awesome!
Hello,
Also I faced the error "It appears as though you do note have permission to view information for Any
of the services you Requested ... "
Solution for me WAS service_description changing.
I was using "NSClient + + - Version" .... After changing to "NSClient - Version" the error disappeared.
Could this help Someone else maybe.
Regards, tcpdump
Thank you all for your comments. As I was busy latelly, I haven't answer to your posts. I hope you understand this.
Cheers,
Alex
Boa tarde,
I add novo amigo nao consigo user Podere ajudar me?
They pride nao é que a commando Valido
e quando nao tento acessar via web acess.
obrigado.
Amigo,
Please formulated your question in english if you really need help!
Cheers!
good work here