<?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>CentOS 7 &#8211; Nagios Library</title>
	<atom:link href="https://library.nagios.com/tag/centos-7/feed/" rel="self" type="application/rss+xml" />
	<link>https://library.nagios.com</link>
	<description>Complete Nagios monitoring resources and documentation</description>
	<lastBuildDate>Mon, 23 Feb 2026 18:54:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://library.nagios.com/wp-content/uploads/2024/11/Nagios-Blue-N.svg</url>
	<title>CentOS 7 &#8211; Nagios Library</title>
	<link>https://library.nagios.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Log Forwarding to Nagios Log Server R2 on CentOS 7</title>
		<link>https://library.nagios.com/monitoring/nagios-log-server-r2-on-centos-7/</link>
		
		<dc:creator><![CDATA[Tucker Falen]]></dc:creator>
		<pubDate>Wed, 26 Mar 2025 14:26:11 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[CentOS 7]]></category>
		<category><![CDATA[CentOS Linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Log Monitoring]]></category>
		<category><![CDATA[Operating System Monitoring]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=53179</guid>

					<description><![CDATA[Nagios Log Server R2 introduces a revamped logging system, making it easier to centralize and analyze logs from various sources. This guide will walk you through setting up a CentOS 7 machine to send its logs to the Nagios Log Server R2 using both automatic and manual methods. Getting Started After setup, logs that would [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Nagios Log Server R2 introduces a revamped logging system, making it easier to centralize and analyze logs from various sources. This guide will walk you through setting up a CentOS 7 machine to send its logs to the Nagios Log Server R2 using both automatic and manual methods.</p>



<p><strong>Getting Started</strong></p>



<p>After setup, logs that would typically appear in <code>/var/log/messages</code> will be forwarded to the Nagios Log Server R2, allowing centralized monitoring and alerting.</p>



<p><strong>Automatic Setup Using a Script</strong></p>



<p>The easiest way to configure log forwarding is by using the provided script. This method requires <code>rsyslog</code> to be installed on your CentOS 7 machine.</p>



<p><strong>Steps to Run the Script:</strong></p>



<ol class="wp-block-list">
<li><strong>Ensure Rsyslog is Installed:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo yum install rsyslog -y
sudo systemctl enable --now rsyslog</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo yum install rsyslog -y</span></span>
<span class="line"><span style="color: #D4D4D4">sudo systemctl enable --now rsyslog</span></span></code></pre></div>



<ol start="2" class="wp-block-list">
<li><strong>Download the Script from the Nagios Log Server R2:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>curl -sS -O http://192.168.1.49/nagioslogserver/scripts/setup-linux.sh</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">curl -sS -O http://192.168.1.49/nagioslogserver/scripts/setup-linux.sh</span></span></code></pre></div>



<ol start="3" class="wp-block-list">
<li><strong>Execute the Script to Configure Rsyslog:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo bash setup-linux.sh -s 192.168.1.49 -p 5544</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo bash setup-linux.sh -s 192.168.1.49 -p 5544</span></span></code></pre></div>



<ul class="wp-block-list">
<li>Replace <code>192.168.1.49</code> with your Nagios Log Server R2’s IP address.</li>



<li>The <code>-p 5544</code> option specifies the port for log transmission.</li>
</ul>



<p><strong>Manual Setup Using Rsyslog Configuration</strong></p>



<p>If you prefer manual setup or need more control over configurations, follow these steps:</p>



<ol class="wp-block-list">
<li><strong>Edit Rsyslog Configuration:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;code>sudo nano /etc/rsyslog.d/99-nagios.conf</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">&lt;code&gt;sudo nano /etc/rsyslog.d/99-nagios.conf</span></span></code></pre></div>



<p><strong>2. Add the following configuration:</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>*.* @@192.168.1.49:5544</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">*.* @@192.168.1.49:5544</span></span></code></pre></div>



<ul class="wp-block-list">
<li>Replace <code>192.168.1.49</code> with the IP address of your Nagios Log Server R2.</li>



<li>The <code>@@</code> symbol indicates TCP transmission; use <code>@</code> for UDP if needed.</li>
</ul>



<ol start="3" class="wp-block-list">
<li><strong>Restart Rsyslog to Apply Changes:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo systemctl restart rsyslog&lt;br></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo systemctl restart rsyslog&lt;br&gt;</span></span></code></pre></div>



<ol start="4" class="wp-block-list">
<li><strong>Check Status to Ensure it&#8217;s Running:</strong></li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo systemctl status rsyslog&lt;br></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo systemctl status rsyslog&lt;br&gt;</span></span></code></pre></div>



<h2 class="wp-block-heading"><strong>Receiving Logs in Log Server</strong></h2>



<p>On your Log Server&#8217;s GUI, click <strong>Add Log Source</strong>.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1.png"><img fetchpriority="high" decoding="async" width="1024" height="530" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1-1024x530.png" alt="Screenshot 2025 03 21 131259 1" class="wp-image-53120" title="Log Forwarding to Nagios Log Server R2 on CentOS 7 1" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1-1024x530.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1-300x155.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1-768x397.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1-1536x794.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131259-1.png 1868w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Nagios Log Server home page</figcaption></figure>



<p>Click <strong>Linux</strong>.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1.png"><img decoding="async" width="1024" height="226" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1-1024x226.png" alt="Screenshot 2025 03 21 131443 1" class="wp-image-53122" title="Log Forwarding to Nagios Log Server R2 on CentOS 7 2" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1-1024x226.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1-300x66.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1-768x170.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-131443-1.png 1248w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Add log source</figcaption></figure>



<p>Type in your machine&#8217;s IP address to see if you are receiving logs. If it&#8217;s working, the interface will confirm that logs are being received.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1.png"><img decoding="async" width="1024" height="642" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1-1024x642.png" alt="Screenshot 2025 03 21 132800 1" class="wp-image-53121" title="Log Forwarding to Nagios Log Server R2 on CentOS 7 3" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1-1024x642.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1-300x188.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1-768x482.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-21-132800-1.png 1481w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Verify incoming logs</figcaption></figure>



<p><strong>Conclusion</strong></p>



<p>Whether using the automatic script or manual setup, forwarding logs from CentOS 7 to Nagios Log Server R2 ensures centralized log management for better monitoring and alerting. Use the method that best fits your deployment needs.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing Nagios Cross Platform Agent (NCPA) on CentOS 7 and Monitoring with Nagios XI</title>
		<link>https://library.nagios.com/monitoring/installing-ncpa-on-centos-7/</link>
		
		<dc:creator><![CDATA[Tucker Falen]]></dc:creator>
		<pubDate>Wed, 19 Mar 2025 17:07:18 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[CentOS 7]]></category>
		<category><![CDATA[CentOS Linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NCPA]]></category>
		<category><![CDATA[Operating System Monitoring]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=52528</guid>

					<description><![CDATA[Monitoring your infrastructure is essential for maintaining system health and performance. The Nagios Cross Platform Agent (NCPA) is a powerful and versatile monitoring agent that allows Nagios to monitor Linux, Windows, and macOS systems with ease. This guide will walk you through installing and configuring NCPA on CentOS 7. Step 1: Add the Nagios Repository [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Monitoring your infrastructure is essential for maintaining system health and performance. The Nagios Cross Platform Agent (NCPA) is a powerful and versatile monitoring agent that allows Nagios to monitor Linux, Windows, and macOS systems with ease. This guide will walk you through installing and configuring NCPA on CentOS 7.</p>



<h3 class="wp-block-heading">Step 1: Add the Nagios Repository</h3>



<p>First, add the Nagios repository to your system to access the NCPA package:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo rpm -Uvh https://repo.nagios.com/nagios/7/nagios-repo-7-4.el7.noarch.rpm</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo rpm -Uvh https://repo.nagios.com/nagios/7/nagios-repo-7-4.el7.noarch.rpm</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 2: Install NCPA</h3>



<p>Once the repository is added, install NCPA with:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo yum install ncpa -y</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo yum install ncpa -y</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 3: Start and Enable NCPA Services</h3>



<p>After installation, start and enable the NCPA services to run at boot:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo systemctl enable ncpa
sudo systemctl start ncpa</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo systemctl enable ncpa</span></span>
<span class="line"><span style="color: #D4D4D4">sudo systemctl start ncpa</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 4: Configure NCPA</h3>



<p>The main configuration file for NCPA is located at:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>/etc/ncpa/ncpa.cfg</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">/etc/ncpa/ncpa.cfg</span></span></code></pre></div>



<p>Before making changes, back up the original file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo cp /etc/ncpa/ncpa.cfg /etc/ncpa/ncpa.cfg.bak</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo cp /etc/ncpa/ncpa.cfg /etc/ncpa/ncpa.cfg.bak</span></span></code></pre></div>



<p>Now, edit the configuration file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo nano /etc/ncpa/ncpa.cfg</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo nano /etc/ncpa/ncpa.cfg</span></span></code></pre></div>



<p>Locate the <code>[api]</code> section and update the <code>community_string</code> value:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&#91;api&#93;
community_string = YourCommunity</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">&#91;api&#93;</span></span>
<span class="line"><span style="color: #D4D4D4">community_string = YourCommunity</span></span></code></pre></div>



<p>Save and exit the file, then restart the NCPA services:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo systemctl restart ncpa_listener
sudo systemctl restart ncpa_passive</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo systemctl restart ncpa_listener</span></span>
<span class="line"><span style="color: #D4D4D4">sudo systemctl restart ncpa_passive</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 5: Adjust Firewall Rules</h3>



<p>To allow NCPA traffic, open the necessary ports:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo firewall-cmd --permanent --add-port=5693/tcp
sudo firewall-cmd --reload</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --permanent --add-port=5693/tcp</span></span>
<span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --reload</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 6: Verify NCPA Functionality</h3>



<p>To check if NCPA is running correctly, open a web browser and navigate to:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>https://&lt;server-ip>:5693</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">https://&lt;server-ip&gt;:5693</span></span></code></pre></div>



<p>Log in using the community string configured earlier. If you see the NCPA web interface, the agent is working correctly.</p>



<h3 class="wp-block-heading">Monitoring with Nagios</h3>



<p>On your Nagios web GUI, click <strong>Run a wizard</strong> and find the <strong>NCPA</strong> wizard.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2.png"><img loading="lazy" decoding="async" width="1024" height="524" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2-1024x524.png" alt="Screenshot 2025 02 11 102857 2" class="wp-image-52156" title="Installing Nagios Cross Platform Agent (NCPA) on CentOS 7 and Monitoring with Nagios XI 4" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2-1024x524.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2-300x154.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2-768x393.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2-1536x786.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-102857-2.png 1745w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Wizards page</figcaption></figure>



<p>Type in the <strong>Address</strong> of your machine running NCPA. You can leave the <strong>Port</strong> as default. Enter the <strong>Token</strong> that you created earlier and click <strong>Next, </strong>and <strong>Finish with Defaults</strong>.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1.png"><img loading="lazy" decoding="async" width="1346" height="757" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1-edited.png" alt="Screenshot 2025 02 11 103046 1 edited" class="wp-image-52159" title="Installing Nagios Cross Platform Agent (NCPA) on CentOS 7 and Monitoring with Nagios XI 5" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1-edited.png 1346w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1-edited-300x169.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1-edited-1024x576.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-11-103046-1-edited-768x432.png 768w" sizes="(max-width: 1346px) 100vw, 1346px" /></a><figcaption class="wp-element-caption">Config wizard</figcaption></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p>You have successfully installed and configured the Nagios Cross Platform Agent (NCPA) on CentOS 7. This setup allows Nagios to monitor the server efficiently, providing real-time insights into system performance and resource utilization. By integrating NCPA with Nagios, you enhance your network monitoring capabilities, ensuring proactive management of system health and performance.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Monitor CentOS 7 with SNMP in Nagios XI</title>
		<link>https://library.nagios.com/monitoring/monitor-centos7-with-nagiosxi/</link>
		
		<dc:creator><![CDATA[Tucker Falen]]></dc:creator>
		<pubDate>Wed, 19 Mar 2025 15:47:18 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[CentOS 7]]></category>
		<category><![CDATA[CentOS Linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating System Monitoring]]></category>
		<category><![CDATA[SNMP]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=52512</guid>

					<description><![CDATA[SNMP (Simple Network Management Protocol) is a powerful tool for monitoring network devices and servers. This guide will walk you through installing and configuring SNMP on CentOS 7. Step 1: Install SNMP and Utilities CentOS 7 uses yum as the default package manager. Install SNMP packages with: Step 2: Start and Enable the SNMP Service [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>SNMP (Simple Network Management Protocol) is a powerful tool for monitoring network devices and servers. This guide will walk you through installing and configuring SNMP on CentOS 7.</p>



<h3 class="wp-block-heading">Step 1: Install SNMP and Utilities</h3>



<p>CentOS 7 uses <code>yum</code> as the default package manager. Install SNMP packages with:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo yum install net-snmp net-snmp-utils -y</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo yum install net-snmp net-snmp-utils -y</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 2: Start and Enable the SNMP Service</h3>



<p>Once installed, start and enable the SNMP service so that it runs at boot:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo systemctl enable snmpd
sudo systemctl start snmpd</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo systemctl enable snmpd</span></span>
<span class="line"><span style="color: #D4D4D4">sudo systemctl start snmpd</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 3: Configure SNMP</h3>



<p>The main configuration file for SNMP is located at:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>/etc/snmp/snmpd.conf</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">/etc/snmp/snmpd.conf</span></span></code></pre></div>



<p>Before making changes, back up the original file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak</span></span></code></pre></div>



<p>Now, edit the configuration file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo nano /etc/snmp/snmpd.conf</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo nano /etc/snmp/snmpd.conf</span></span></code></pre></div>



<p>Modify or add the following lines to set up SNMPv2c with a community string (replace <code>YourCommunity</code> with a strong name):</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>com2sec readonly  default  YourCommunity
group   MyROGroup v2c        readonly
view    all    included   .1
access  MyROGroup ""      any       noauth    exact  all    none   none
syslocation "Data Center"
syscontact "Admin &lt;admin@example.com>"</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">com2sec readonly  default  YourCommunity</span></span>
<span class="line"><span style="color: #D4D4D4">group   MyROGroup v2c        readonly</span></span>
<span class="line"><span style="color: #D4D4D4">view    all    included   .1</span></span>
<span class="line"><span style="color: #D4D4D4">access  MyROGroup &quot;&quot;      any       noauth    exact  all    none   none</span></span>
<span class="line"><span style="color: #D4D4D4">syslocation &quot;Data Center&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">syscontact &quot;Admin &lt;admin@example.com&gt;&quot;</span></span></code></pre></div>



<p>Save and exit the file, then restart the SNMP service:</p>



<pre class="wp-block-code"><code>sudo systemctl restart snmpd</code></pre>



<h3 class="wp-block-heading">Step 4: Adjust Firewall Rules</h3>



<p>To allow SNMP traffic, open the necessary UDP port (161):</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo firewall-cmd --permanent --add-port=161/udp
sudo firewall-cmd --reload</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --permanent --add-port=161/udp</span></span>
<span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --reload</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 5: Verify SNMP Functionality</h3>



<p>Test if SNMP is working correctly with:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>snmpwalk -v2c -c YourCommunity -O e 127.0.0.1</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">snmpwalk -v2c -c YourCommunity -O e 127.0.0.1</span></span></code></pre></div>



<p>If you see output with system information, SNMP is working correctly.</p>



<h3 class="wp-block-heading">Step 6: Open Firewall for SNMP</h3>



<p>If you want to allow SNMP traffic from remote machines, open the firewall to allow SNMP traffic:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo firewall-cmd --permanent --add-port=161/udp
sudo firewall-cmd --reload</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --permanent --add-port=161/udp</span></span>
<span class="line"><span style="color: #D4D4D4">sudo firewall-cmd --reload</span></span></code></pre></div>



<p>This command opens port 161 (the default SNMP port) for UDP traffic, allowing SNMP queries from remote systems.</p>



<h3 class="wp-block-heading">Step 7: Test SNMP from a Remote System</h3>



<p>Finally, to ensure SNMP is accessible remotely, test it from another system using <code>snmpwalk</code>:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-Geist-Mono" style="font-size:.875rem;font-family:Code-Pro-Geist-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>snmpwalk -v2c -c YourCommunityString &lt;server-ip></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">snmpwalk -v2c -c YourCommunityString &lt;server-ip&gt;</span></span></code></pre></div>



<p>Replace <code>&lt;server-ip&gt;</code> with the IP address of your CentOS 7 server. If SNMP is correctly configured, you will receive SNMP data from the remote server.</p>



<h3 class="wp-block-heading">Monitoring with Nagios XI</h3>



<p>In Nagios XI, navigate to <code>Run a Wizard</code> and click on the <code>SNMP wizard</code>.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716.png"><img loading="lazy" decoding="async" width="1024" height="546" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716-1024x546.png" alt="Screenshot 2025 02 12 135716" class="wp-image-51997" title="How to Monitor CentOS 7 with SNMP in Nagios XI 6" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716-1024x546.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716-300x160.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716-768x410.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716-1536x819.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-02-12-135716.png 1730w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Wizards page</figcaption></figure>



<ul class="wp-block-list">
<li>Add your Host Name and type in the SNMP Community string that you created.</li>



<li>Pick the SNMP Services that you want to monitor and then click <code>Next</code> and <code>Finish with Defaults</code>.</li>
</ul>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626.png"><img loading="lazy" decoding="async" width="1024" height="729" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626-1024x729.png" alt="Screenshot 2025 03 12 115626" class="wp-image-51999" title="How to Monitor CentOS 7 with SNMP in Nagios XI 7" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626-1024x729.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626-300x214.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626-768x547.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-03-12-115626.png 1230w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">SNMP Wizard page</figcaption></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p>You have successfully installed and configured SNMP on CentOS 7. This setup allows your server to be monitored remotely, enhancing network management capabilities. You also configured SNMP monitoring with Nagios XI, which provides a powerful interface for tracking system performance and network activity. By adding your SNMP-enabled server to Nagios XI, you can gain deeper insights into system health, set up alerts, and optimize network monitoring for better performance.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
