<?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>nagios agent Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/nagios-agent/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Sat, 01 Feb 2020 23:32:41 +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 install Nagios agent on Ubuntu 18.04?</title>
		<link>https://www.osradar.com/install-nagios-agent-ubuntu-linux-mint/</link>
					<comments>https://www.osradar.com/install-nagios-agent-ubuntu-linux-mint/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 07 Feb 2020 23:25:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bionic]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios agent]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=17943</guid>

					<description><![CDATA[<p>We continue with some articles on Nagios. Well, once we have installed the server and the plugins come to another step. In this post, I&#8217;ll show you how to install Nagios agent on Ubuntu 18.04 / Linux Mint 19. So, we have already talked a lot about Nagios and its potential. But for everything to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-nagios-agent-ubuntu-linux-mint/">How to install Nagios agent on Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We continue with some articles on Nagios. Well, once we have <a href="https://www.osradar.com/install-nagios-debian/" target="_blank" rel="noopener noreferrer">installed the server</a> and the <a href="https://www.osradar.com/install-the-nagios-plugins-debian-10/" target="_blank" rel="noopener noreferrer">plugins</a> come to another step. In this post, I&#8217;ll show you how to install Nagios agent on Ubuntu 18.04 / Linux Mint 19.</p>
<p>So, we have already talked a lot about Nagios and its potential. But for everything to be complete, we need to install the agent in a client operating system so that the server can monitor it.</p>
<p>So that&#8217;s what we&#8217;re going to do.</p>
<h2>Install Nagios agent on Ubuntu 18.04</h2>
<h3>1.- Working on the client machine</h3>
<p>The Nagios agent is NRPE (Nagios Remote Plugin Executor) which according to the <a href="https://en.wikipedia.org/wiki/Nagios" target="_blank" rel="noopener noreferrer">Nagios wiki</a> is the following</p>
<blockquote>
<p>&#8220;it is a Nagios agent that allows remote system monitoring using scripts that are hosted on the remote systems.It allows for monitoring of resources such as disk usage, system load or the number of users currently logged in.&#8221;</p>
</blockquote>
<p>The big advantage is that this agent is available in the official Ubuntu repositories and you don&#8217;t have to do much to install it.</p>
<p>So, open a terminal in the client operating system. Not on the server. And run the following:</p>
<pre>:~$ sudo apt-get install nagios-nrpe-server nagios-plugins</pre>
<figure id="attachment_17981" aria-describedby="caption-attachment-17981" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17981" src="https://www.osradar.com/wp-content/uploads/2020/02/1.png" alt="1.- Install Nagios agent on Ubuntu 18.04 / Linux Mint 19" width="1365" height="443" srcset="https://www.osradar.com/wp-content/uploads/2020/02/1.png 1365w, https://www.osradar.com/wp-content/uploads/2020/02/1-300x97.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/1-1024x332.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/1-768x249.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/1-696x226.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/1-1068x347.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/1-1294x420.png 1294w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-17981" class="wp-caption-text">1.- Install Nagios agent on Ubuntu 18.04 / Linux Mint 19</figcaption></figure>
<p>When the installation is finished, a configuration file must be modified to tell the client where the Nagios server is.</p>
<pre>:~$ sudo nano /etc/nagios/nrpe.cfg</pre>
<p>In the <code>allowed_hosts</code> directive add the IP address of the computer where Nagios is installed. However, you can specify multiple IP addresses if there are multiple Nagios servers.</p>
<pre>allowed_hosts=127.0.0.1, 192.168.250.32</pre>
<p>In my case, this is the file.</p>
<figure id="attachment_17982" aria-describedby="caption-attachment-17982" style="width: 991px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17982" src="https://www.osradar.com/wp-content/uploads/2020/02/2.png" alt="2.- Configuring the plugin" width="991" height="562" srcset="https://www.osradar.com/wp-content/uploads/2020/02/2.png 991w, https://www.osradar.com/wp-content/uploads/2020/02/2-300x170.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/2-768x436.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/2-696x395.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/2-741x420.png 741w" sizes="(max-width: 991px) 100vw, 991px" /><figcaption id="caption-attachment-17982" class="wp-caption-text">2.- Configuring the plugin</figcaption></figure>
<p>Then save the changes and close the file.</p>
<p>For all these changes to take effect, the Nagios client service has to be restarted.</p>
<pre>:~$ sudo systemctl restart nagios-nrpe-server</pre>
<p>Finally, we check if the agent is working with the following command:</p>
<pre>:~$ /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20</pre>
<p>If you get a screen output like this:</p>
<pre>OK - load average: 0.74, 0.62, 0.68|load1=0.740;15.000;30.000;0; load5=0.620;10.000;25.000;0; load15=0.680;5.000;20.000;0;</pre>
<p>It means that everything is fine.</p>
<h3>2.- Working on the server</h3>
<p>It is now necessary to install NRPE on the server. This is so that you can establish communication with the client.</p>
<p>So, on the server open a terminal and run the following:</p>
<pre>:~$ sudo apt install nagios-nrpe-plugin</pre>
<figure id="attachment_17983" aria-describedby="caption-attachment-17983" style="width: 1023px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17983" src="https://www.osradar.com/wp-content/uploads/2020/02/3.png" alt="3.- Installing the Nagios agent on the server" width="1023" height="193" srcset="https://www.osradar.com/wp-content/uploads/2020/02/3.png 1023w, https://www.osradar.com/wp-content/uploads/2020/02/3-300x57.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/3-768x145.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/3-696x131.png 696w" sizes="(max-width: 1023px) 100vw, 1023px" /><figcaption id="caption-attachment-17983" class="wp-caption-text">3.- Installing the Nagios agent on the server</figcaption></figure>
<p>Now that it is installed, some configuration files need to be modified. The first one is the Nagios configuration file where we have to enable the server folder.</p>
<pre>:~$ sudo nano /usr/local/nagios/etc/nagios.cfg</pre>
<p>You do it by decomposing the next line:</p>
<pre>cfg_dir=/usr/local/nagios/etc/servers</pre>
<figure id="attachment_17984" aria-describedby="caption-attachment-17984" style="width: 1008px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17984" src="https://www.osradar.com/wp-content/uploads/2020/02/4.png" alt="4.- Configuring the Nagios agent on the server" width="1008" height="390" srcset="https://www.osradar.com/wp-content/uploads/2020/02/4.png 1008w, https://www.osradar.com/wp-content/uploads/2020/02/4-300x116.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/4-768x297.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/4-696x269.png 696w" sizes="(max-width: 1008px) 100vw, 1008px" /><figcaption id="caption-attachment-17984" class="wp-caption-text">4.- Configuring the Nagios agent on the server</figcaption></figure>
<p>Again, save the changes and close the file. Then create the folder in question.</p>
<pre>:~$ sudo mkdir /usr/local/nagios/etc/servers</pre>
<p>After that, another file has to be modified to add a command that the Nagios server has to run to communicate with the client.</p>
<pre>:~$ sudo nano /usr/local/nagios/etc/objects/commands.cfg</pre>
<p>At the end of the file, add the following:</p>
<pre>define command {<br />    command_name check_nrpe<br />    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br />}</pre>
<figure id="attachment_17985" aria-describedby="caption-attachment-17985" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17985" src="https://www.osradar.com/wp-content/uploads/2020/02/5.png" alt="5.- Adding a command to monitoring the client" width="1365" height="481" srcset="https://www.osradar.com/wp-content/uploads/2020/02/5.png 1365w, https://www.osradar.com/wp-content/uploads/2020/02/5-300x106.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/5-1024x361.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/5-768x271.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/5-696x245.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/5-1068x376.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/5-1192x420.png 1192w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-17985" class="wp-caption-text">5.- Adding a command to monitoring the client</figcaption></figure>
<p>Again, save the changes and close the file.</p>
<p>Now we have to create a new configuration file for the client that we are going to add.</p>
<pre>:~$ sudo nano /usr/local/nagios/etc/servers/client.cfg</pre>
<p>And add the following:</p>
<pre>define host{<br />use                             linux-server<br />host_name                       laptop.osradar<br />alias                           Ubuntu 18<br />address                         192.168.250.6<br />}<br /><br />define service{<br />        use                     generic-service<br />        host_name               laptop.osradar<br />        service_description     CPU Load<br />        check_command           check_nrpe!check_load<br />        }<br /><br />define service{<br />        use                     generic-service<br />        host_name               laptop.osradar<br />        service_description     Total Processes<br />        check_command           check_nrpe!check_total_procs<br />        }<br /><br />define service{<br />        use                     generic-service<br />        host_name               laptop.osradar<br />        service_description     Current Users<br />        check_command           check_nrpe!check_users<br />        }<br /><br />define service{<br />        use                     generic-service<br />        host_name               laptop.osradar<br />        service_description     SSH Monitoring<br />        check_command           check_nrpe!check_ssh<br />        }<br />define service{<br />        use                     generic-service<br />        host_name               laptop.osradar<br />        service_description     FTP Monitoring<br />        check_command           check_nrpe!check_ftp<br />        }</pre>
<p>Nagios is very flexible because in this file you can add or remove the services you want.</p>
<p>Also, you have to modify some parameters like the hostname of the client machine and the IP address. This is enough.</p>
<figure id="attachment_17986" aria-describedby="caption-attachment-17986" style="width: 1145px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17986" src="https://www.osradar.com/wp-content/uploads/2020/02/6.png" alt="6.- Creating a new file for the host" width="1145" height="649" srcset="https://www.osradar.com/wp-content/uploads/2020/02/6.png 1145w, https://www.osradar.com/wp-content/uploads/2020/02/6-300x170.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/6-1024x580.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/6-768x435.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/6-696x395.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/6-1068x605.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/6-741x420.png 741w" sizes="(max-width: 1145px) 100vw, 1145px" /><figcaption id="caption-attachment-17986" class="wp-caption-text">6.- Creating a new file for the host</figcaption></figure>
<p>Then, it is convenient to check if the configuration file has a syntax error. To do this, run the following command:</p>
<pre>:~$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</pre>
<figure id="attachment_17987" aria-describedby="caption-attachment-17987" style="width: 1064px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17987" src="https://www.osradar.com/wp-content/uploads/2020/02/7.png" alt="7.- Cheecking the nagios configuration file" width="1064" height="695" srcset="https://www.osradar.com/wp-content/uploads/2020/02/7.png 1064w, https://www.osradar.com/wp-content/uploads/2020/02/7-300x196.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/7-1024x669.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/7-768x502.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/7-696x455.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/7-643x420.png 643w" sizes="(max-width: 1064px) 100vw, 1064px" /><figcaption id="caption-attachment-17987" class="wp-caption-text">7.- Cheecking the nagios configuration file</figcaption></figure>
<p>Then test to see if the server can communicate with the client:</p>
<pre>:~$ cd /usr/lib/nagios/plugins/<br />:~$ ./check_nrpe -H 192.168.250.6</pre>
<figure id="attachment_17988" aria-describedby="caption-attachment-17988" style="width: 934px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17988" src="https://www.osradar.com/wp-content/uploads/2020/02/8.png" alt="8.- Checking the plugin" width="934" height="146" srcset="https://www.osradar.com/wp-content/uploads/2020/02/8.png 934w, https://www.osradar.com/wp-content/uploads/2020/02/8-300x47.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/8-768x120.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/8-696x109.png 696w" sizes="(max-width: 934px) 100vw, 934px" /><figcaption id="caption-attachment-17988" class="wp-caption-text">8.- Checking the plugin</figcaption></figure>
<p>Replace the IP address with the address of the computer that will be the client.</p>
<p>To avoid running problems with the plugin, copy it to the location where the rest of them are.</p>
<pre>:~$ sudo cp check_nrpe /usr/local/nagios/libexec</pre>
<p>And finally, restart the service.</p>
<pre>:~$ sudo systemctl restart nagios</pre>
<p>And that is it.</p>
<h3>3.- Testing the Nagios client on Ubuntu 18.04</h3>
<p>Now open your web browser and access Nagios. You will see the following:</p>
<figure id="attachment_17989" aria-describedby="caption-attachment-17989" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17989" src="https://www.osradar.com/wp-content/uploads/2020/02/9.png" alt="9.- Nagios agent working" width="1365" height="671" srcset="https://www.osradar.com/wp-content/uploads/2020/02/9.png 1365w, https://www.osradar.com/wp-content/uploads/2020/02/9-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/9-1024x503.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/9-768x378.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/9-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/02/9-533x261.png 533w, https://www.osradar.com/wp-content/uploads/2020/02/9-696x342.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/9-1068x525.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/9-854x420.png 854w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-17989" class="wp-caption-text">9.- Nagios agent working</figcaption></figure>
<p>And check the host information:</p>
<figure id="attachment_17990" aria-describedby="caption-attachment-17990" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-17990" src="https://www.osradar.com/wp-content/uploads/2020/02/10.png" alt="10.- Nagios server and agent working" width="1365" height="670" srcset="https://www.osradar.com/wp-content/uploads/2020/02/10.png 1365w, https://www.osradar.com/wp-content/uploads/2020/02/10-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/10-1024x503.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/10-768x377.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/10-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/02/10-533x261.png 533w, https://www.osradar.com/wp-content/uploads/2020/02/10-696x342.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/10-1068x524.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/10-856x420.png 856w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-17990" class="wp-caption-text">10.- Nagios server and agent working</figcaption></figure>
<p>So everything&#8217;s fine.</p>
<h2>Conclusion</h2>
<p>To monitor with Nagios it is necessary to install the agent in each of the computers you want. In this post, you have learned how to install it in Ubuntu 18.04 / Linux Mint 19.3.</p>
<p>Please share this post and join our <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">Telegram channel</a>.</p>


<p></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-nagios-agent-ubuntu-linux-mint/">How to install Nagios agent on Ubuntu 18.04?</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/install-nagios-agent-ubuntu-linux-mint/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
