Add

How to install and configure Nagios in Ubuntu 9.04


Nagios is a good open source tool for monitoring network components and services. It can be configured to send alerts by e-mail

Given that 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:

sudo nagios3 -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: 12-01-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 2 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 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…

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

Everything should be ok. Errors that may occur are in most cases because of permissions.

Now we have to add the user for nagios (before that, you have to get to /etc/nagios3) :

cd /etc/nagios3

sudo htpasswd -c htpasswd.users nagios

Must enter the password twice for the new user:

New password:

Re-type new password:

Adding password for user nagios

At this point, Nagios can be accessed by Web interface:.

http://localhost/nagios3/

or, http://IP/nagios3/

nagios-overview

Now you can configure Nagios. Configuration file resides in / etc/nagios3/nagios.cfg. The rest of the files which allow various configurations are found in conf.d. In contacts_nagios2.cfg file you can set the email account where the alerts will be sent to:

gedit contacts_nagios2.cfg

define contact{

contact_name alex

alias Admin Nagios

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 contact must be added to contactgroup:

define contactgroup{

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 not 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 these 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” is the user that 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! :)

nagios-host-detailnagios-service-detail

1 Star2 Stars3 Stars4 Stars5 Stars (17 votes, average: 5.00 out of 5)
Loading ... Loading ...

The Discussion

see what everyone is saying

  • Addon pentru Firefox: Nagios July 13th, 2009 at 14:38 #1

    [...] folosirea acestui addon, evident e nevoie ca nagios sa fie instalat. No [...]

  • Adrian July 30th, 2009 at 11:06 #2

    Foarte bun tutorialul. Sunt o gramada de tutoriale pentru instalarea nagios pe net, insa cu tutorialul tau am reusit sa pun si eu pe picioare nagios.
    Thanks!

  • admin July 30th, 2009 at 12:35 #3

    @Adrian: Ma bucur ca te-a ajutat. In limita timpului disponibil incerc sa postez mai multe tutoriale despre diverse.

  • Raul Molnar August 5th, 2009 at 11:23 #4

    mee too :)

  • B.F.C August 17th, 2009 at 01:15 #5

    sincer ma cam indoiam ca va merge ceva.dar… spre uimirea mea .. tutorialul este unu foarte bine explicat si ptr necunoscatori…
    eu sunt unul dintre ei si tin sa iti multumesc.
    daca se poate sa vii cu un pic de ajutor si in sensul mysql referitor la setari si administrare eventual cum sa “lucrezi” cu el din broswer + ceva php admin ar fi deja tot ce se poate spune despre webhosting.
    inca o data mii de multumiri

  • admin August 18th, 2009 at 11:03 #6

    @B.F.C.
    Ma bucur ca te-a ajutat tutorialul – sa stii ca toate tutorialele/ metodele prezentate aici sunt testate, deci nu prea au cum sa nu mearga. :)
    Sigur ca as vrea sa pun mult mai multe tutoriale, eventual sa mai completez cate ceva pentru cele existente, insa am destul de putin timp pentru a ma ocupa de asta.
    Nu inteleg la ce te referi cand spui “ajutor in sensul mysql si php admin” – un ghid de instalare pentru acestea?
    Multam de comentariu si te mai astept pe aici. :)

  • Armance October 1st, 2009 at 21:43 #7

    Seems to be a clean tutorial. I’ll give it a try!

  • admin October 1st, 2009 at 21:46 #8

    @Armance: Please try it and let me know if you encounter any problems.

  • dewa November 11th, 2009 at 05:38 #9

    thank you very much.. this article really helps me a lot..

  • SEWilco May 13th, 2010 at 19:29 #10

    Would be nice to know where the check_command definitions for all the plugins reside. Ubuntu’s commands.cfg doesn’t include check_http, so it’s not apparent what can be used as check_http!foo

  • Rajnish kumar August 5th, 2010 at 07:36 #11

    Hi,
    I want to add multiple windows server in nagios for monitor, how it’s possible please help.
    i am not able to understand how i will add multiple windows machine in windows.cfg file, when i am changing host_name and alias name then do not start nagios services and getting error please check configuration file.
    Please Help me.
    Thanks
    Rajnish

  • Ali November 7th, 2010 at 16:41 #12

    awesome!!!

  • tcpdump November 15th, 2010 at 15:06 #13

    Hello,

    I also faced the error “It appears as though you do not have permission to view information for any
    of the services you requested…”

    Solution for me was changing service_description.
    I was using “NSClient++ – Version”…. After changing to “NSClient – Version” the error disappeared.

    Maybe this could help someone else.

    Regards, tcpdump

  • admin December 8th, 2010 at 16:54 #14

    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

  • Mauricio Gonçalves November 11th, 2011 at 17:59 #15

    Boa tarde,

    Amigo eu não consigo add novo user poderia me ajudar?
    ele fala que o comando não é valido

    e quando tento acessar via web não acessa.

    obrigado.

  • admin November 11th, 2011 at 19:56 #16

    Amigo,

    Please formulate your question in english if you really need help!

    Cheers!

Respond

get in on the action.

* Required

Rumanian flagItalian flagEnglish flagGerman flagFrench flagSpanish flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagSwedish flagNorwegian flagSerbian flagSlovenian flagUkrainian flagTurkish flagHungarian flag
By N2H

Random Posts Recent Comments

  • admin Says:

    Amigo, Please formulate your question in english if you really need help! Cheers!...

  • Mauricio Gonçalves Says:

    Boa tarde, Amigo eu não consigo add novo user poderia me ajudar? ele fala que o comando não é ...

  • Flossy Says:

    Zubao0 That's really thinking out of the box. Thanks!...

  • Michael Esch Says:

    I used this tutorial to install Komodo Edit 6 on Ubuntu 10.10; I rate your tutorial 5/5 I hope that...

  • admin Says:

    @dan Am rulat aplicatii create in visual basic si in fox sub wine, deci cred ca nu ar trebui sa fie ...

  • dan Says:

    as dori sa imi spuneti daca un prg de conta sub visual basic ruleaza cu wine sub ubuntu intreb deo...

  • admin Says:

    Thank you all for your comments. As I was busy latelly, I haven't answer to your posts. I hope you u...

  • tcpdump Says:

    Hello, I also faced the error "It appears as though you do not have permission to view informatio...

  • Ali Says:

    awesome!!!...

  • Schedule Says:

    You you should make changes to the post subject Split and join files in Ubuntu with lxsplit | EtutsR...

Tag Cloud