Subscribe Us

How to install Nagios in RHEL| Fedora | Centos

Nagios is the industry standard in enterprise-class monitoring for good reason. It allows you to gain insight into your network and fix problems before customers know they even exist. It’s stable, scalable, supported, and extensible.


1. First step : Install some Packages :

yum install httpd php

yum install gcc

yum install glibc glibc-common

yum install gd gd-devel

2. Create nagios user in box :

#/usr/sbin/useradd -m nagios

#passwd nagios

3. Add nagcmd group

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd apache

4. Now go to http://www.nagios.org download below files

nagios-3.1.0.tar.gz | nrpe-2.12.tar.gz | nagios-plugins-1.4.13.tar.gz

tar -zxvf  nagios-3.1.0.tar.gz

cd nagios-3.1.0

./configure --with-command-group=nagcmd

#make all; make install; make install-init; make install-config;
make install-commandmode; make install-webconf

5. Edit your email admin address in cantacts.cfg configuration file:

Go to
vi /usr/local/nagios/etc/objects/contacts.cfg 

If you want to use existing mail server like gmail, yahoo or own server then mention below like:
sSMTP Configuration

6. Create a nagiosadmin account for logging into the Nagios web interface assign to this you’ll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

7. Restart the httpd server :

#Service httpd restart

The second step : Extract and install plugins :

1.Go to you downloaded nagios tools

tar  -zxvf   nagios-plugins-1.4.13.tar.gz

cd nagios-plugins

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make; make install

2.Now you have to add nagios to Chkconfig

chkconfig --add nagios

chkconfig nagios on

3. Verify if you have a good config of nagios with the command :

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

4. Check if there are no errors displayed; then start nagios with command :

service nagios start

Run below command to get updated nagios logs.

tail -f /usr/local/nagios/var/nagios.log


5. Set Nagios Admin Panel Password
htpasswd -c /etc/nagios/passwd nagiosadmin


Please disable the selinux and iptables and ip6tables :
now open your browser and http://localhost/nagios or http://ip/nagios




This is what the Nagios admin panel looks like:




And you are all done!

Post a Comment

16 Comments

  1. Wonderful beat ! I wish to apprentice at the same
    time as you amend your web site, how can i subscribe for
    a blog website? The account aided me a acceptable deal.

    I were tiny bit familiar of this your broadcast offered bright clear idea

    My homepage ... canlı bahis siteleri

    ReplyDelete
  2. Saved as a favorite, I love your website!

    My webpage :: GHD Straighteners

    ReplyDelete
  3. I visited multiple websites except the audio feature for audio songs existing at this site is genuinely superb.


    Check out my website GHD Straightener

    ReplyDelete
  4. Since the admin of this web page is working, no hesitation very
    shortly it will be renowned, due to its quality contents.



    Feel free to visit my web page - dragon city cheats

    ReplyDelete
  5. Hi there, You have done a fantastic job.
    I'll definitely digg it and personally suggest to my friends.

    I'm sure they'll be benefited from this site.

    Here is my blog post; Discount Christian Louboutin

    ReplyDelete
  6. Wonderful work! That is the type of information that are
    meant to be shared around the net. Disgrace on Google for not positioning this put up
    higher! Come on over and discuss with my web site .
    Thank you =)

    Have a look at my web blog - Christian Louboutin Sale

    ReplyDelete
  7. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
    Kindly keep blogging. If anyone wants to become a Java developer learn from Java EE Online Training from India.
    or learn thru Java EE Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete
  8. I wish more writers of this sort of substance would take the time you did to explore and compose so well. I am exceptionally awed with your vision and knowledge.
    data scientist training and placement

    ReplyDelete
  9. ---
    ### This playbook downloads Nagios Remote Plugin Executor, configures and compiles it and modifies xinetd to allow our IP
    - name: Download the source code for a release of NRPE and extract it
    unarchive:
    src: "{{ nrpe_dwld_url }}"
    dest: "/home/{{ vm_user }}"
    copy: no
    tags:
    - dwld_nrpe

    - name: Configure NRPE
    command: ./configure --enable-command-args --with-nagios-user={{ user }} --with-nagios-group={{ nagios_group }} --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
    args:
    chdir: "/home/{{ vm_user }}/nrpe-{{ nrpe_version }}"
    tags:
    - cfg_nrpe

    - name: Compile NRPE
    command: "{{ item }}"
    args:
    chdir: "/home/{{ vm_user }}/nrpe-{{ nrpe_version }}"
    with_items:
    - make all
    - make install
    - make install-xinetd
    - make install-daemon-config
    tags:
    - cfg_nrpe

    - name: Modify extended Internet daemon to allow our IP
    lineinfile:
    dest: /etc/xinetd.d/nrpe
    state: present
    regexp: "^only_from(.*)$"
    line: "only_from = 127.0.0.1 {{ vm_ip }}"
    backrefs: yes
    tags:
    - xinetd

    - name: Restart xinetd
    service: name=xinetd state=restarted
    tags:
    - xinetd

    ReplyDelete
  10. In the wake of perusing your article, I was astounded. I realize that you clarify it well overall. What's more, I trust that different perusers will likewise encounter how I feel in the wake of perusing your article.
    data analytics course in hyderabad

    ReplyDelete
  11. Really an awesome blog and useful content. Keep update more blogs again soon. Thank you.
    Data Science Training and Placements in Hyderabad

    ReplyDelete
  12. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it. data science course in mysore

    ReplyDelete
  13. A decent blog consistently concocts new and energizing data and keeping in mind that perusing I have feel that this blog is truly have each one of those quality that qualify a blog to be a one. data scientist course in mysore

    ReplyDelete
  14. We appreciate your valuable insights regarding Degree Colleges in Hyderabad for B.Com. Thank you for sharing the informative content.
    Degree Colleges in Hyderabad For B.com

    ReplyDelete
  15. Thank you for sharing this useful information in this fantastic article. I'll check your blog frequently for the most recent content.
    Top CEC colleges in Hyderabad

    ReplyDelete