Sign Up

Continue with Facebook
Continue with Google
or use


Have an account? Sign In Now

Sign In Sign In

Continue with Facebook
Continue with Google
or use


Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

You must login to ask a question.

Continue with Facebook
Continue with Google
or use


Forgot Password?

Need An Account, Sign Up Here

You must login to add post.

Continue with Facebook
Continue with Google
or use


Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

IT Support BD Logo IT Support BD Logo
Sign InSign Up

IT Support BD

IT Support BD Navigation

  • Home
  • About Us
  • Blog
  • Download
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Terms of Use
  • Terms and Conditions
  • Privacy Policy
  • Cookie Policy
Home/ Questions/Q 7630
In Process
Asked: January 23, 20232023-01-23T13:57:11+06:00 2023-01-23T13:57:11+06:00In: Server

How to build network monitoring and problem-solving tools?

Support
Support IT Coordinator

How to build network monitoring and problem-solving tools.

 

nagios
  • 2
  • 1 1 Answer
  • 25 Views
  • 0 Followers
  • 0
    • Report
  • Share
    Share
    • Share onFacebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp

Leave an answer
Cancel reply

You must login to add an answer.

Continue with Facebook
Continue with Google
or use


Forgot Password?

Need An Account, Sign Up Here
Continue with Facebook
Continue with Google

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. admin IT Admin
    2023-01-23T14:13:16+06:00Added an answer on January 23, 2023 at 2:13 pm
    This answer was edited.

    One of the greatest open-source monitoring tools is Nagios, which keeps an eye on services and programs running on Linux and Windows operating systems.

    Nagios can keep an eye on system metrics including CPU load, memory consumption, disk utilization, logged-in users, active processes, and services like HTTP, FTP, SSH, and SMTP.

    We’ll look at how to set up Nagios on Ubuntu 22.04 in this article.

     

    Prerequisites:
    We shall compile Nagios from source even though there is a package for it in the Ubuntu repository. Therefore, install the packages listed below to compile Nagios.

    #sudo apt update
    
    #sudo apt install -y build-essential apache2 php openssl perl make php-gd libgd-dev libapache2-mod-php libperl-dev libssl-dev daemon wget apache2-utils unzip

     

    For Nagios, create a user and group. Then, to enable external commands to be executed via the Nagios web interface, add the nagios and apache user (www-data) to the section of the nagcmd group.

    #sudo useradd nagios
    
    #sudo groupadd nagcmd
    
    #sudo usermod -a -G nagcmd nagios
    
    #sudo usermod -a -G nagcmd www-data
    
    Nagios Core installation for Ubuntu 22.04
    First, get the most recent Nagios core version from the official website.
    
    
    #wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz
    
    #tar -zxvf nagios-4.4.6.tar.gz
    
    #cd nagios-4.4.6/
    
    Then, use the procedures listed below to build Nagios from source code.
    #sudo ./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-httpd_conf=/etc/apache2/sites-enabled/
    
    #sudo make all
    
    #sudo make install
    
    #sudo make install-init
    
    #sudo make install-config
    
    #sudo make install-commandmode
    
    

    You can find Nagios’s configuration files under the /usr/local/nagios/etc directory, and the default configuration should work fine.

    Next, install the Nagios web interface with the below command.

    #sudo make install-webconf

     

    You must establish a user account (nagiosadmin) in order to access the Nagios web interface, which is password secured by default. So, to establish a user account for the Nagios online interface, execute the command below.

     

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

    Enable the CGI module using the following command.

    #sudo a2enmod cgi
    
    Restart the Apache web server to finish.
    
    Adding plugins to Nagios with Ubuntu 22.04
    Installing Nagios plugins is required in order to monitor a system. Install the Nagios plugins by downloading them from the official website.

    #wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
    #tar -zxvf nagios-plugins-2.3.3.tar.gz
    #cd nagios-plugins-2.3.3/

     

    Then, compile and install the Nagios plugins.

    #sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
    
    #sudo make
    
    #sudo make install
    
    Open the Nagios monitoring program
    It's time to launch the Nagios service at this point. You should check the Nagios configuration files before launching the service.
    
    #sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
    
    Output:
    Nagios Core 4.4.6
    right (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 2020-04-28
    License: GPL
    Website: https://www.nagios.org
    Reading configuration data...
    Read main config file okay...
    Read object config files okay...
    Running pre-flight check on configuration data...
    Checking objects...
    Checked 8 services.
    Checked 1 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
    Checking for circular paths...
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
    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

    Then, start and enable the Nagios service with the below command

    #sudo systemctl enable --now nagios

    Now navigate to the following URL in your web browser to view the Nagios web interface.
    Enter the login (nagiosadmin) and password for the Nagios account you previously created at

    http://ip/nagios/

    You will see Nagios’ main page after successfully logging in.

    To view the services that Nagios is watching, click Services in the left pane.

    Now use the following command to install NRPE Add-on and Nagios plugins for adding Host.

    #sudo apt update
    #sudo apt install -y nagios-nrpe-server nagios-pluginss.

    Set up NRPE Add-on
    To accept the connection from the Nagios server, modify the NRPE configuration file, Change the file /etc/nagios/nrpe.cfg.

    #sudo nano /etc/nagios/nrpe.cfg

    Add the Nagios servers IP address, separated by comma like below.

    #allowed_hosts=192.168.9.4
    
    
    With the use of Nagios plugins, the command lines below allow you to keep an eye on the number of active processes, the number of logged-in users, the system load, root filesystem utilization, and swap consumption.
    
    

    #sudo nano /etc/nagios/nrpe.cfg

    Firewall
    Set up the firewall so that the NRPE server operating on a distant Linux computer may be contacted by the Nagios server. Use a remote Linux computer to execute these instructions.

    #firewall-cmd –permanent –add-port=5666/tcp
    #firewall-cmd –reload

    IP Tables

    #iptables -I INPUT -p tcp –dport 5666 -m conntrack –ctstate NEW,ESTABLISHED -j ACCEPT
    #iptables -I OUTPUT -p tcp –sport 5666 -m conntrack –ctstate ESTABLISHED -j ACCEPT
    #/etc/init.d/iptables save

    Install the NRPE plugin on the Nagios server.
    To verify the services or resources, this NRPE plugin offers the check nrpe plugin, which makes communication with the NRPE server on distant computers.

    Use the following command to install the NRPE plugin on your machine.

    #sudo apt install -y nagios-nrpe-plugin

    Configuration Editing
    To add all.cfg files located in the /usr/local/nagios/etc/servers directory, edit the Nagios configuration file.

    #sudo nano /usr/local/nagios/etc/nagios.cfg

    Add or uncomment the following line.

    cfg_dir=/usr/local/nagios/etc/servers

    Create a configuration directory.

    #sudo mkdir /usr/local/nagios/etc/servers
    
    To the Nagios server, add a Linux host
    To define the host and service definitions of a remote Linux host, create a client configuration file at /usr/local/nagios/etc/servers/client.itzgeek.local.cfg in your system.
    
    
    #sudo nano /usr/local/nagios/etc/servers/client.itsupportbd.local.cfg

    Add the following text to the file mentioned above.

    The template below can also be used, and it can be customized to meet your needs. For monitoring logged-in users, system load, disk utilization (/ – partition), swap, and overall process, use the template below.

    define host{
                               
                use                     linux-server            
                host_name               client.itsupportbd.local            
                alias                   client.itsupportbd.local            
                address                 192.168.9.10
                                        
    }

     

    Restart the Nagios server.
    #sudo systemctl restart nagios
    
    
    That is it. Please provide feedback in the section below.

     

    • 0
    • Reply
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 125
  • Answers 193
  • Best Answers 72
  • Users 88
  • Popular
  • Answers
  • admin

    How to approach applying for a job at a company ...

    • 7 Answers
  • admin

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • admin

    What is a programmer’s life like?

    • 5 Answers
  • admin
    admin added an answer How can you set up a new Windows 11 laptop… March 25, 2023 at 11:54 am
  • admin
    admin added an answer How to use Quillbot Premium for a lifetime with the… March 21, 2023 at 9:42 am
  • IT BD
    IT BD added an answer o configure a static IP address and internet connection on… March 4, 2023 at 11:47 pm

Related Questions

  • How to create own remote desktop server infrastructure.

    • 1 Answer
  • I want to host site using xamp on internet

    • 1 Answer
  • How can I Create own storage server and intagreate it ...

    • 1 Answer
  • Why is my server always signing out

    • 1 Answer
  • How to create a free Webhosting Cpanel server.

    • 1 Answer

Top Members

admin

admin

  • 34 Questions
  • 1k Points
IT Admin
Arif

Arif

  • 35 Questions
  • 675 Points
IT Moderator
Support

Support

  • 29 Questions
  • 402 Points
IT Coordinator

Trending Tags

analytics company computer custom rom english google javascript language microsoft office mobile nas network os php programs server storage website whatsapp wordpress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Shop

Footer

We hope you enjoy our blog as much as We enjoy offering them to you. If you have any questions or comments, please don't hesitate to contact us.

About Us

  • Meet The Team
  • Blog
  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Terms and Conditions
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2018-2023 IT Support BD. All Rights Reserved

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Close Refresh

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.