YouTube Icon

Code Playground.

How to Install Nagios on Ubuntu 20.04

CFG

How to Install Nagios on Ubuntu 20.04

Nagios is a well known open-source checking framework. 

Nagios keeps a stock of your whole IT framework and guarantees your organizations, workers, applications, administrations, and cycles are going. If there should be an occurrence of disappointment or imperfect execution, Nagios will send warning alarms through different techniques. 

This article discloses how to introduce Nagios on Ubuntu 20.04. 

Installing Nagios on Ubuntu 20.04

Nagios 4 is accessible in the Ubuntu programming archive. Establishment is entirely clear, simply run the accompanying orders as a client with sudo benefits : 

sudo apt update
sudo apt install nagios4 nagios-plugins-contrib nagios-nrpe-plugin

The order above will introduce a lot of bundles, including Nagios Core, Nagios Plugins, and Apache. 

The Apache setup record that ships with Nagios rely upon the mod_authz_groupfile and mod_auth_digest modules, which are not empowered naturally. mod_authz_groupfile module is utilized to permit or deny admittance to verified by bunch enrollment, and mod_authz_groupfile empowers the MD5 digest validation. 

Run the orders beneath to empower the two modules: 

sudo a2enmod authz_groupfile auth_digest

The default the Apache setup permits admittance to Nagios just from localhost and private IPs. We'll change the setup so just verified clients can see the interface and issue orders. 

Open the design document with your content tool: 

sudo nano /etc/apache2/conf-enabled/nagios4-cgi.conf

Remark the lines beginning with Require ip, "<Files "cmd.cgi">", "" and Require all conceded and uncomment the line containing Require legitimate client, as demonstrated as follows: 

/etc/apache2/conf-enabled/nagios4-cgi.conf

The document likewise incorporates directions for designing distinctive access levels. 

When done restart Apache: 

sudo systemctl restart apache2

You can confirm that both Apache and Nagios are working appropriately by checking their status: 

sudo systemctl status apache2
sudo systemctl status nagios4

Creating User Account

Naturally, Nagios is arranged to allow authoritative benefits to a client named "nagiosadmin". With this client, you can sign in to the Nagios web interface and deal with your stock. Utilize the accompanying htdigest order to make the client: 

sudo htdigest -c /etc/nagios4/htdigest.users Nagios4 nagiosadmin

You will be provoked to enter and affirm the client's secret phrase. 

Output

New password: 
Re-type new password: 
Adding password for user nagiosadmin

Restart the Apache administration for changes to produce results: 

sudo systemctl restart apache2

Arranging Firewall 

Ubuntu ships with a firewall arrangement device called UFW. On the off chance that the firewall is empowered on your framework, try to open the HTTP and HTTPS ports: 

sudo ufw allow Apache

Accessing the Nagios Web Interface

To get to the Nagios web interface open your preferred program and type your worker's area name or public IP address followed by/nagios: 

http(s)://your_domain_or_ip_address/nagios

Enter the nagiosadmin client login certifications, and you will be diverted to the default Nagios landing page. 

Conclusion

We've given you how introduced Nagios on Ubuntu workers. 

For more data about how to arrange and utilize Nagios, check their Documentation . 

In the event that you hit an issue or have input, leave a remark beneath.




CFG