<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>how to install nagios Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/how-to-install-nagios/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 07 Dec 2020 08:51:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Monitor Remote Linux Machines With Nagios on Linux</title>
		<link>https://www.osradar.com/how-to-monitor-remote-linux-machines-with-nagios-on-linux/</link>
					<comments>https://www.osradar.com/how-to-monitor-remote-linux-machines-with-nagios-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Wed, 20 May 2020 09:21:49 +0000</pubDate>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[how to install nagios]]></category>
		<category><![CDATA[how to monitor remote hosts with nagios]]></category>
		<category><![CDATA[nagios guide linux]]></category>
		<category><![CDATA[nagios monitoring tool]]></category>
		<category><![CDATA[nagios network monitoring]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20035</guid>

					<description><![CDATA[<p>Today we are going to learn that how to monitor remote Linux machines with Nagios on Linux. We&#8217;ve previously installed and configured Nagios on Ubuntu 20.04 and now we are moving forward to monitor the remote machines with Nagios. If you didn&#8217;t follow the previous article click on the below link first to set up [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-monitor-remote-linux-machines-with-nagios-on-linux/">How To Monitor Remote Linux Machines With Nagios on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today we are going to learn that <a href="https://www.osradar.com/?p=20035">how to monitor remote Linux machines with Nagios</a> on Linux. We&#8217;ve previously installed and configured Nagios on Ubuntu 20.04 and now we are moving forward to monitor the remote machines with Nagios. If you didn&#8217;t follow the previous article click on the below link first to set up the Nagios on your Ubuntu 20.04 system.</p>



<p><a href="https://www.osradar.com/how-to-install-nagios-on-ubuntu-20-04/">How To Install Nagios on Ubuntu 20.04</a></p>



<p>Here I&#8217;ll add CentOS  machine as a remote host on Ubuntu 20.04. You can also add other Linux remote hosts. For easy setup just follow the below steps.</p>



<h3><strong>Step 1: Update Your System</strong></h3>



<p>As usual we do, first of all update the system to fetch latest updates before going to install any new package.</p>



<pre class="wp-block-verse">sudo apt update &amp;&amp; sudo apt upgrade</pre>



<h3><strong>Step2: Install NRPE Add-on and Nagios Plugins on Ubuntu 20.04</strong></h3>



<p>NRPE (Nagios Remote Plugin Executor) helps you to monitor the remote machines as well as monitor the local resources of the remote machine like CPU usage, Memory usage, Disk and other resources information&#8217;s. Install it by hitting the below command.</p>



<p><strong>On Ubuntu</strong></p>



<pre class="wp-block-verse">sudo apt install -y nagios-nrpe-server nagios-plugins</pre>



<p><strong>On CentOS :</strong></p>



<p>To install Nagios server on CentOS  firstly add EPEL repository.</p>



<pre class="wp-block-verse">sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm</pre>



<p>As Nagios requires some other packages install them by typing</p>



<p></p>



<p>And then run the below command to install it.</p>



<pre class="wp-block-verse">sudo yum install -y nrpe nagios-plugins-all</pre>



<h3><strong>Step 3: Configure NRPE Add-on</strong></h3>



<p>After installing the NRPE Add-on configure it to work best with our environment. Add the Nagios Server IP address by updating the <strong>/etc/nagios/nrpe.cfg</strong> file. Type the command to edit the file.</p>



<pre class="wp-block-verse">sudo nano /etc/nagios/nrpe.cfg</pre>



<p>And then add the Nagios server IP address like below.</p>



<pre class="wp-block-verse">allowed_hosts=192.168.0.10</pre>



<p>You can also add multiple Nagios servers by separating them with commas.</p>



<h3><strong>Step 4: Configuring Nagios Checks</strong></h3>



<p>Nrpe configuration file <strong>/etc/nagios/nrpe.cfg</strong> consists of basic commands to find the CPU, Memory, Disk usage etc.</p>



<p>Given command lines allow you to monitor logged in users, system load, root filesystem usage, swap usage and the total number of the processes by Nagios plugins. Run the below command.</p>



<pre class="wp-block-verse">sudo nano /etc/nagios/nrpe.cfg</pre>



<h3><strong>Commands Explanation For CentOS &amp; Ubuntu </strong></h3>



<pre class="wp-block-verse">command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10<br>command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20<br>command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /<br>command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%<br>command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200</pre>



<p><strong>Note:</strong><br>-w stand for WARNING<br>-c stand for CRITICAL</p>



<p>You can verify the check results by hitting the below command.</p>



<pre class="wp-block-verse">/usr/lib/nagios/plugins/check_procs -w 150 -c 200</pre>



<p><strong>Output:</strong></p>



<p>You&#8217;ll see the similar output</p>



<pre class="wp-block-verse">PROCS CRITICAL: 283 processes | procs=190;150;200;0;</pre>



<p>You can also change the warnings and critical to your own value like </p>



<pre class="wp-block-preformatted">/usr/lib/nagios/plugins/check_procs -w 300 -c 350</pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-verse">PROCS OK: 282 processes | procs=282;300;350;0;</pre>



<p>To enable the monitoring, add the given destinations to the template file on the Nagios Server. Now, restart the NRPE services by hitting the below command.</p>



<pre class="wp-block-verse">sudo systemctl restart nagios-nrpe-server</pre>



<h3><strong>Step 5: Allow Firewall Access</strong></h3>



<p>After setting up the Nagios NRPE allow Nagios server to reach the NRPE server by giving access through firewall. To do this simply fire the below command in your terminal.</p>



<pre class="wp-block-verse">firewall-cmd --permanent --add-port=5666/tcp</pre>



<p>And then reload the firewall by</p>



<pre class="wp-block-verse">firewall-cmd --reload</pre>



<p>Add the following IP Tables rules.</p>



<pre class="wp-block-verse">iptables -I INPUT -p tcp --dport 5666 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT<br>iptables -I OUTPUT -p tcp --sport 5666 -m conntrack --ctstate ESTABLISHED -j ACCEPT<br>/etc/init.d/iptables save</pre>



<h3><strong>Step 6: Installing NRPE Plugin on Nagios Server</strong></h3>



<p>Simply fire the below command to install the NRPE plugin on Nagios server.</p>



<p><strong>On CentOS</strong>:</p>



<pre class="wp-block-verse">sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum -y install nagios-plugins-nrpe</pre>



<p><strong>On Ubuntu:</strong></p>



<pre class="wp-block-verse">sudo apt install -y nagios-nrpe-plugin</pre>



<p>Now, edit the <strong>/usr/local/nagios/etc/nagios.cfg</strong> file and uncomment the below line:</p>



<pre class="wp-block-verse">cfg_dir=/usr/local/nagios/etc/servers</pre>



<p>Then make a new config directory.</p>



<p><strong>On CentOS:</strong></p>



<pre class="wp-block-verse">sudo nano /usr/local/nagios/etc/objects/commands.cfg</pre>



<p><strong>On Ubuntu:</strong></p>



<pre class="wp-block-verse">sudo mkdir /usr/local/nagios/etc/servers</pre>



<p>After setting up all these, it&#8217;s time to configure the Nagios server for monitoring the remote client machines. For this you&#8217;ll have to use the check_nrpe plugi. So, here we&#8217;ll add the command definition in order to remotely monitor our hosts. Type the below command.</p>



<p><strong>On CentOS:</strong></p>



<pre class="wp-block-verse">sudo nano /usr/local/nagios/etc/objects/commands.cfg</pre>



<p>Paste the below content into file and save it.</p>



<pre class="wp-block-verse">.check_nrpe. command definition
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
}</pre>



<p><strong>On Ubuntu:</strong></p>



<p>Create a file.</p>



<pre class="wp-block-verse">sudo nano /usr/local/nagios/etc/objects/commands.cfg</pre>



<p>Then paste the below data</p>



<pre class="wp-block-verse">.check_nrpe. command definition
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
}</pre>



<h3><strong>Step 7: Adding a Linux Host To Nagios Server</strong></h3>



<p>Now, we&#8217;ll add the remote host to monitor it by creating a client config file for defining the host &amp; services definition of remote Linux host.</p>



<p><strong>On CentOS:</strong></p>



<pre class="wp-block-verse">sudo nano /usr/local/nagios/etc/servers/client.osradar.local.cfg</pre>



<p><strong>On Ubuntu:</strong></p>



<pre class="wp-block-verse">sudo nano /usr/local/nagios/etc/servers/client.osradar.local.cfg</pre>



<p>Then paste the below configuration into the file and save it.</p>



<pre class="wp-block-verse">define host{
use linux-server host_name client.osradar.local alias client.osradar.local address 192.168.135.135
}
define hostgroup{
hostgroup_name linux-server alias Linux Servers members client.osradar.local
}
define service{
use local-service host_name client.osradar.local service_description SWAP Uasge check_command check_nrpe!check_swap
}
define service{
use local-service host_name client.osradar.local service_description Root / Partition check_command check_nrpe!check_root
}
define service{
use local-service host_name client.osradar.local service_description Current Users check_command check_nrpe!check_users
}
define service{
use local-service host_name client.osradar.local service_description Total Processes check_command check_nrpe!check_total_procs
}
define service{
use local-service host_name client.osradar.local service_description Current Load check_command check_nrpe!check_load
}</pre>



<p>After it make sure to verify the Nagios by hitting the below commands.</p>



<p><strong>On CentOS:</strong></p>



<pre class="wp-block-verse">sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</pre>



<p><strong>On Ubuntu:</strong></p>



<pre class="wp-block-verse">/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</pre>



<p>And then restart the services.</p>



<pre class="wp-block-verse">sudo systemctl restart nagios</pre>



<h3><strong>Step 8: Monitor Remote Hosts with Nagios .</strong></h3>



<p>Now, access the Nagios Dashboard as we&#8217;ve already installed Nagios in previous article. So, access it by typing<em><strong> IP/nagios/</strong></em> and provide credentials to login.</p>



<p>Here you can see the remote hosts.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1024" height="427" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/1-14-1024x427.png" alt="" class="wp-image-20444" srcset="https://www.osradar.com/wp-content/uploads/2020/05/1-14-1024x427.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/1-14-300x125.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/1-14-768x320.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/1-14-696x290.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/1-14-1068x445.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/1-14.png 1288w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>Wait for a minute and you&#8217;ll see the status of the services running on the remote machine as well as on your local machine.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="427" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/2-18-1024x427.png" alt="" class="wp-image-20445" srcset="https://www.osradar.com/wp-content/uploads/2020/05/2-18-1024x427.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/2-18-300x125.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/2-18-768x320.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/2-18-696x290.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/2-18-1068x446.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/2-18.png 1282w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>So, this is how you can add remote Linux machines to monitor with the help of Nagios.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-monitor-remote-linux-machines-with-nagios-on-linux/">How To Monitor Remote Linux Machines With Nagios on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-monitor-remote-linux-machines-with-nagios-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Nagios 4 on Centos 8 / RHEL 8.</title>
		<link>https://www.osradar.com/how-to-install-nagios-4-on-centos-8-rhel-8/</link>
					<comments>https://www.osradar.com/how-to-install-nagios-4-on-centos-8-rhel-8/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Mon, 11 Nov 2019 11:42:23 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Centos 8]]></category>
		<category><![CDATA[Dnf tools]]></category>
		<category><![CDATA[how to install nagios]]></category>
		<category><![CDATA[nagios 4]]></category>
		<category><![CDATA[Nagios Plugins]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RHEL]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=15465</guid>

					<description><![CDATA[<p>Nagios is network monitoring tool. In this tutorial, we will learn how to Install and configure Nagious 4 on Centos / RHEL 8. Nagious is configured using text files &#38; provides web interface for ease to use for administration and Monitoring. Just follow these steps to quickly install &#38; configure Nagious 4: Pre-requisites: SELinux (Passive [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-nagios-4-on-centos-8-rhel-8/">How To Install Nagios 4 on Centos 8 / RHEL 8.</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Nagios is network monitoring tool. In this tutorial, we will learn how to Install and configure Nagious 4 on Centos  / RHEL  8. Nagious is configured using text files &amp; provides web interface for ease to use for administration and Monitoring. Just follow these steps to quickly install &amp; configure Nagious 4: </p>



<h3><strong>Pre-requisites:</strong></h3>



<ul><li><strong>SELinux (Passive mode):</strong></li></ul>



<pre class="wp-block-verse">sudo sed -i 's/SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config<br>sudo setenforce 0</pre>



<h3><strong>Step 1: Installing Dependencies</strong></h3>



<p>Update your system.</p>



<pre class="wp-block-verse">sudo dnf updates</pre>



<p>Install required Dependencies.</p>



<pre class="wp-block-verse">sudo dnf install @php<br>
sudo dnf install @perl @httpd wget unzip glibc automake glibc-common gettext autoconf php php-cli gcc gd gd-devel net-snmp openssl-devel unzip net-snmp postfix net-snmp-utils</pre>



<p>Guide for <a href="https://www.osradar.com/how-to-install-gcc-development-tools-on-centos-8-rhel-8/">Installing Development Tools on RHEL 8 / Cento 8.</a></p>



<pre class="wp-block-verse">sudo dnf groupinstall "Development Tools"</pre>



<p>Now, start and enable httpd and php-fpm services.</p>



<pre class="wp-block-verse">sudo systemctl enable --now httpd php-fpm</pre>



<p>Checki status is running.</p>



<pre class="wp-block-verse">systemctl status http php-fpm</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="736" height="498" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/php-httpd-status.png" alt="" class="wp-image-15467" srcset="https://www.osradar.com/wp-content/uploads/2019/11/php-httpd-status.png 736w, https://www.osradar.com/wp-content/uploads/2019/11/php-httpd-status-300x203.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/php-httpd-status-696x471.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/php-httpd-status-621x420.png 621w" sizes="(max-width: 736px) 100vw, 736px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="727" height="313" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/php-fpm-services.png" alt="" class="wp-image-15468" srcset="https://www.osradar.com/wp-content/uploads/2019/11/php-fpm-services.png 727w, https://www.osradar.com/wp-content/uploads/2019/11/php-fpm-services-300x129.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/php-fpm-services-696x300.png 696w" sizes="(max-width: 727px) 100vw, 727px" /></figure></div>



<p>Detailed instructions for the  Installation of<a href="https://www.osradar.com/how-to-install-cacti-on-centos-rhel-8/"> PHP</a> and <a href="https://www.osradar.com/how-to-install-cacti-on-centos-rhel-8/">httpd</a>.</p>



<h3><strong>Step 2: Downloading Nagios Core</strong></h3>



<p>Change  directory to <strong>/usr/src/</strong>. Go to <a href="https://github.com/NagiosEnterprises/nagioscore/releases">latest-release page of Nagios</a> to download.</p>



<pre class="wp-block-verse">sudo su -<br>cd /usr/src</pre>



<p>Create <strong>nagios-$VER</strong> directory.</p>



<p>Download &amp; extract Nagios tarball.</p>



<pre class="wp-block-verse"><a href="https://github.com/NagiosEnterprises/nagioscore/releases">https://github.com/NagiosEnterprises/nagioscore/releases</a></pre>



<p>Change path to created folder.</p>



<pre class="wp-block-verse">cd nagios-$VER</pre>



<h3><strong>Step 3: Compile Nagios Core on Centos 8 / RHEL 8.</strong></h3>



<p><strong>a.</strong> Run the configure script by command below:</p>



<pre class="wp-block-verse">./configure</pre>



<p>Output:</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="735" height="496" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/configure-summary-ngios.png" alt="" class="wp-image-15469" srcset="https://www.osradar.com/wp-content/uploads/2019/11/configure-summary-ngios.png 735w, https://www.osradar.com/wp-content/uploads/2019/11/configure-summary-ngios-300x202.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/configure-summary-ngios-696x470.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/configure-summary-ngios-622x420.png 622w" sizes="(max-width: 735px) 100vw, 735px" /></figure></div>



<p><strong>b.</strong> To compile the main program and CGIs, run the make command with <strong>all </strong>options.</p>



<pre class="wp-block-verse">sudo make all</pre>



<p>Output:</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="798" height="601" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/sudo-make-all-nagios.png" alt="" class="wp-image-15471" srcset="https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios.png 798w, https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios-300x226.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios-768x578.png 768w, https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios-696x524.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/sudo-make-all-nagios-558x420.png 558w" sizes="(max-width: 798px) 100vw, 798px" /></figure></div>



<p><strong>c.</strong> Create User And Group</p>



<p>This will create user and groups in Nagios</p>



<p>Add apache user to Nagios Group.</p>



<pre class="wp-block-verse">make install-groups-users<br>usermod -a -G nagios apache</pre>



<p><strong>d. </strong>Install Nagios on Centos / RHEL 8.</p>



<p>Install Nagios base.</p>



<pre class="wp-block-verse">make install</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="790" height="579" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/make-install.png" alt="" class="wp-image-15473" srcset="https://www.osradar.com/wp-content/uploads/2019/11/make-install.png 790w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-300x220.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-768x563.png 768w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-696x510.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-573x420.png 573w" sizes="(max-width: 790px) 100vw, 790px" /></figure></div>



<p><strong>e.</strong> Install the init script in <strong>/lib/systemd/system</strong>.</p>



<pre class="wp-block-verse">make install-init</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="707" height="88" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/make-install-init.png" alt="" class="wp-image-15474" srcset="https://www.osradar.com/wp-content/uploads/2019/11/make-install-init.png 707w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-init-300x37.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-init-696x88.png 696w" sizes="(max-width: 707px) 100vw, 707px" /></figure></div>



<p><strong>f.</strong> Install and configure the permissions on the directory for holding the external command file.</p>



<pre class="wp-block-verse">make install-commandmode</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="728" height="128" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/commandmode-config.png" alt="" class="wp-image-15475" srcset="https://www.osradar.com/wp-content/uploads/2019/11/commandmode-config.png 728w, https://www.osradar.com/wp-content/uploads/2019/11/commandmode-config-300x53.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/commandmode-config-696x122.png 696w" sizes="(max-width: 728px) 100vw, 728px" /></figure></div>



<p><strong>g.</strong> Install sample config files in <strong>/usr/local/nagios/etc</strong>.</p>



<pre class="wp-block-verse">make install-config</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="734" height="498" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/make-install-config.png" alt="" class="wp-image-15476" srcset="https://www.osradar.com/wp-content/uploads/2019/11/make-install-config.png 734w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-config-300x204.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-config-696x472.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-config-619x420.png 619w" sizes="(max-width: 734px) 100vw, 734px" /></figure></div>



<p><strong>h.</strong> Install the Apache config file for the Nagios web interface.</p>



<pre class="wp-block-verse">make install-webconf</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="740" height="202" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/make-install-webconfig.png" alt="" class="wp-image-15477" srcset="https://www.osradar.com/wp-content/uploads/2019/11/make-install-webconfig.png 740w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-webconfig-300x82.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/make-install-webconfig-696x190.png 696w" sizes="(max-width: 740px) 100vw, 740px" /></figure></div>



<p><strong>i.</strong> Install the Exfoliation theme for the Nagios web interface.</p>



<pre class="wp-block-verse">make install-exfoliation</pre>



<p><strong>j. </strong> You can install classic theme for Nagios web interface by given command</p>



<pre class="wp-block-verse">make install-classicui</pre>



<h3><strong>Step 4: Creating Nagios Web User</strong></h3>



<p>We need to create a user account for  Nagios web interface . Use the given command:</p>



<pre class="wp-block-verse">sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="797" height="601" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/nagios-account-creation-users.png" alt="" class="wp-image-15480" srcset="https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users.png 797w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users-300x226.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users-768x579.png 768w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users-696x525.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-account-creation-users-557x420.png 557w" sizes="(max-width: 797px) 100vw, 797px" /></figure></div>



<p>Restart Apache services to take effect.</p>



<pre class="wp-block-verse">systemctl restart httpd</pre>



<h3><strong>Step 5: Installing Nagios Plugins</strong></h3>



<p>Plugins are used to provide more monitoring features.<br>Switch to<strong> /usr/src</strong> directory.</p>



<pre class="wp-block-verse">cd /usr/src</pre>



<p>Create new directory as <strong>nagios-plugins-$VER</strong></p>



<pre class="wp-block-verse">mkdir nagios-plugins-$VER</pre>



<p>Download Nagios plugins from <a href="https://github.com/nagios-plugins/nagios-plugins/releases">Github releases page</a>.</p>



<p>Extract it to <strong>/usr/src/nagios-plugins-$VER</strong> directory.</p>



<p>Now, change directory to nagios-$VER.</p>



<pre class="wp-block-verse">cd 'nagios-$VER'</pre>



<p>Use this command to install and compile Nagios Plugins.</p>



<pre class="wp-block-verse">./configure --with-nagios-user=nagios --with--nagios-group=nagios<br>make &amp;&amp; make install</pre>



<p>Output:</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="727" height="496" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/nagios-plugin-result.png" alt="" class="wp-image-15486" srcset="https://www.osradar.com/wp-content/uploads/2019/11/nagios-plugin-result.png 727w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-plugin-result-300x205.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-plugin-result-218x150.png 218w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-plugin-result-696x475.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-plugin-result-616x420.png 616w" sizes="(max-width: 727px) 100vw, 727px" /></figure></div>



<h3><strong>Step 6: Verifying Installation &amp; Starting Nagios Services.</strong></h3>



<p>Make sure your Nagios installation is working properly.</p>



<pre class="wp-block-verse"> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg </pre>



<figure class="wp-block-image"><img loading="lazy" width="723" height="495" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/plugins-config-summary-2.png" alt="" class="wp-image-15488" srcset="https://www.osradar.com/wp-content/uploads/2019/11/plugins-config-summary-2.png 723w, https://www.osradar.com/wp-content/uploads/2019/11/plugins-config-summary-2-300x205.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/plugins-config-summary-2-218x150.png 218w, https://www.osradar.com/wp-content/uploads/2019/11/plugins-config-summary-2-696x477.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/plugins-config-summary-2-613x420.png 613w" sizes="(max-width: 723px) 100vw, 723px" /></figure>



<p>Start &amp; Enable Nagios service to start at boot.</p>



<pre class="wp-block-verse">sudo systemctl enable --now nagios</pre>



<p>Re-check the service status.</p>



<pre class="wp-block-verse">systemctl status nagios</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="725" height="496" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/service-check-nagios.png" alt="" class="wp-image-15489" srcset="https://www.osradar.com/wp-content/uploads/2019/11/service-check-nagios.png 725w, https://www.osradar.com/wp-content/uploads/2019/11/service-check-nagios-300x205.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/service-check-nagios-218x150.png 218w, https://www.osradar.com/wp-content/uploads/2019/11/service-check-nagios-696x476.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/service-check-nagios-614x420.png 614w" sizes="(max-width: 725px) 100vw, 725px" /></figure></div>



<h3><strong>Step 7: Accessing Nagios Web Dashboard</strong></h3>



<p>Remove firewall restrictions:</p>



<pre class="wp-block-verse">sudo firewall-cmd --permanent --add-service={http,https}<br>sudo firewall-cmd --reload</pre>



<p>Access Dashboard by visiting <a href="https://www.osradar.com">http:[IP/hostname]/nagios/</a><br> Fill out Authentication details:</p>



<pre class="wp-block-verse">Username:<strong> nagiosadmin</strong></pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="799" height="601" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/authentication.png" alt="" class="wp-image-15490" srcset="https://www.osradar.com/wp-content/uploads/2019/11/authentication.png 799w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-300x226.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-768x578.png 768w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-265x198.png 265w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-696x524.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/authentication-558x420.png 558w" sizes="(max-width: 799px) 100vw, 799px" /></figure></div>



<p>You can add device to be monitored in Dashboard.</p>



<figure class="wp-block-image"><img loading="lazy" width="798" height="600" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/nagios-dashboard.png" alt="" class="wp-image-15491" srcset="https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard.png 798w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-300x226.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-768x577.png 768w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-265x198.png 265w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-696x523.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/nagios-dashboard-559x420.png 559w" sizes="(max-width: 798px) 100vw, 798px" /></figure>



<p></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-nagios-4-on-centos-8-rhel-8/">How To Install Nagios 4 on Centos 8 / RHEL 8.</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-nagios-4-on-centos-8-rhel-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
