<?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/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Training &#8211; Nagios Library</title>
	<atom:link href="https://library.nagios.com/training/feed/" rel="self" type="application/rss+xml" />
	<link>https://library.nagios.com</link>
	<description>Complete Nagios monitoring resources and documentation</description>
	<lastBuildDate>Thu, 02 Apr 2026 19:14:49 +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>Training &#8211; Nagios Library</title>
	<link>https://library.nagios.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Route Hops: How to Create a Nagios Plugin to Monitor Them</title>
		<link>https://library.nagios.com/training/route-hops-nagios-plugin/</link>
		
		<dc:creator><![CDATA[Tyler Larson]]></dc:creator>
		<pubDate>Tue, 04 Nov 2025 14:45:00 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Network Monitoring]]></category>
		<category><![CDATA[Router and Switch Monitoring]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=41190</guid>

					<description><![CDATA[An important metric in network diagnostics is the number of hops it takes to reach a target host. In this article, we will create a plugin for Nagios using Python to monitor route hops to a target host. Step 1: Prerequisites Step 2: Set Up the Python Script Create a new Python file named check_route_hops.py [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>An important metric in network diagnostics is the number of hops it takes to reach a target host. In this article, we will create a plugin for Nagios using Python to monitor route hops to a target host.</p>



<h2 class="wp-block-heading">Step 1: Prerequisites</h2>



<ul class="wp-block-list">
<li>Python 3: The script uses Python, so make sure you have it installed so you can test your plugin as you develop it. It can be downloaded <a href="https://www.python.org/downloads/" target="_blank" rel="noreferrer noopener">here</a>.</li>



<li>A code editor: To create this plugin I used VS Code, which can be downloaded <a href="https://code.visualstudio.com/" data-type="link" data-id="https://code.visualstudio.com/" target="_blank" rel="noreferrer noopener">here</a>.</li>
</ul>



<h2 class="wp-block-heading">Step 2: Set Up the Python Script</h2>



<p>Create a new Python file named <em>check_route_hops.py</em> and begin with a shebang line and essential import statements.</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"><span role="button" data-code="#!/usr/bin/env python3
import sys
import traceback
import argparse
import subprocess
def main():
if __name__ == &quot;__main__&quot;:
    main()" style="color:#adbac7" aria-label="Copy" class="code-block-pro-copy-button"></span><pre class="shiki github-dark-dimmed" style="background-color: #22272e"><code><span class="line"><span style="color: #768390">#!/usr/bin/env python3</span></span>
<span class="line"></span>
<span class="line"><span style="color: #F47067">import</span><span style="color: #ADBAC7"> sys</span></span>
<span class="line"><span style="color: #ADBAC7">import traceback</span></span>
<span class="line"><span style="color: #ADBAC7">import argparse</span></span>
<span class="line"><span style="color: #ADBAC7">import subprocess</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">def main():</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">if __name__ == </span><span style="color: #96D0FF">&quot;__main__&quot;</span><span style="color: #ADBAC7">:</span></span>
<span class="line"><span style="color: #ADBAC7">    main()</span></span></code></pre></div>



<p>Define the Nagios status codes to make the code more readable.</p>



<pre class="wp-block-code has-adbac-7-color has-text-color has-875-rem-font-size"><code>OK = 0
WARNING = 1
CRITICAL = 2
UNKNOWN = 3</code></pre>



<p>Now, create a global variable for the command line arguments.</p>



<pre class="wp-block-code has-adbac-7-color has-text-color has-875-rem-font-size"><code>_args = None</code></pre>



<h2 class="wp-block-heading">Step 3: Parse Command-Line Arguments</h2>



<p>The plugin should accept arguments to specify the target host, thresholds, and other options. Use Python&#8217;s <code>argparse</code> module to define and handle these arguments. This code should be placed within the main function.</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"><span role="button" data-code="parser = argparse.ArgumentParser(
 description='This script checks the number of hops to a target host using traceroute.'
 'You can define warning and critical thresholds for hop counts. '
 'If the host is unreachable with the default protocol (UDP) other protocols will be       tried.')
        
        # Define the arguments
        parser.add_argument('-H', '--host', required=True, type=str, help='Target host IP to check hop count')
        parser.add_argument('-t', '--timeout', default=3, type=int, help='Timeout duration in seconds for the check (default is 3)')
        parser.add_argument('-w', '--warning', required=False, type=int, help='Warning threshold for hop count')
        parser.add_argument('-c', '--critical', required=False, type=int, help='Critical threshold for hop count')
        parser.add_argument('-v', '--verbose', required=False, type=int, default=0, help=(
            'The verbosity level of the output. '
            '(0: Single line summary, '
            '1: Single line with additional information, '
            '2: Multi line with configuration debug output)'
        ))
        parser.add_argument('-p', '--protocol', type=str, default='UDP', help='First protocol to attempt for traceroute (default: UDP)')
        parser.add_argument('--debug', action='store_true', help='Enable debug mode')
        
        _args = parser.parse_args(sys.argv[1:])" style="color:#adbac7" aria-label="Copy" class="code-block-pro-copy-button"></span><pre class="shiki github-dark-dimmed" style="background-color: #22272e"><code><span class="line"><span style="color: #ADBAC7">parser </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> argparse.</span><span style="color: #DCBDFB">ArgumentParser</span><span style="color: #ADBAC7">(</span></span>
<span class="line"><span style="color: #ADBAC7"> description</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;This script checks the number of hops to a target host using traceroute.&#039;</span></span>
<span class="line"><span style="color: #ADBAC7"> </span><span style="color: #96D0FF">&#039;You can define warning and critical thresholds for hop counts. &#039;</span></span>
<span class="line"><span style="color: #ADBAC7"> </span><span style="color: #96D0FF">&#039;If the host is unreachable with the default protocol (UDP) other protocols will be       tried.&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"><span style="color: #ADBAC7">        </span></span>
<span class="line"><span style="color: #ADBAC7">        # Define the </span><span style="color: #6CB6FF">arguments</span></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-H&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--host&#039;</span><span style="color: #ADBAC7">, required</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">True, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">str, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;Target host IP to check hop count&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-t&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--timeout&#039;</span><span style="color: #ADBAC7">, default</span><span style="color: #F47067">=</span><span style="color: #6CB6FF">3</span><span style="color: #ADBAC7">, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">int, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;Timeout duration in seconds for the check (default is 3)&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-w&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--warning&#039;</span><span style="color: #ADBAC7">, required</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">False, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">int, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;Warning threshold for hop count&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-c&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--critical&#039;</span><span style="color: #ADBAC7">, required</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">False, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">int, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;Critical threshold for hop count&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-v&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--verbose&#039;</span><span style="color: #ADBAC7">, required</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">False, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">int, default</span><span style="color: #F47067">=</span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">, </span><span style="color: #DCBDFB">help</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">(</span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #96D0FF">&#039;The verbosity level of the output. &#039;</span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #96D0FF">&#039;(0: Single line summary, &#039;</span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #96D0FF">&#039;1: Single line with additional information, &#039;</span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #96D0FF">&#039;2: Multi line with configuration debug output)&#039;</span></span>
<span class="line"><span style="color: #ADBAC7">        ))</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;-p&#039;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#039;--protocol&#039;</span><span style="color: #ADBAC7">, type</span><span style="color: #F47067">=</span><span style="color: #ADBAC7">str, default</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;UDP&#039;</span><span style="color: #ADBAC7">, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;First protocol to attempt for traceroute (default: UDP)&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ADBAC7">        parser.</span><span style="color: #DCBDFB">add_argument</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&#039;--debug&#039;</span><span style="color: #ADBAC7">, action</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;store_true&#039;</span><span style="color: #ADBAC7">, help</span><span style="color: #F47067">=</span><span style="color: #96D0FF">&#039;Enable debug mode&#039;</span><span style="color: #ADBAC7">)</span></span>
<span class="line"><span style="color: #ADBAC7">        </span></span>
<span class="line"><span style="color: #ADBAC7">        _args </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> parser.</span><span style="color: #DCBDFB">parse_args</span><span style="color: #ADBAC7">(sys.argv[</span><span style="color: #6CB6FF">1</span><span style="color: #ADBAC7">:])</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 4: Implement the Traceroute Logic</h2>



<p>Create a helper function to execute traceroute and calculate the number of hops to the host. Use subprocess.run to call the  traceroute command. The stdout result of the command is then used to count the number of hops to the host. Different protocols are used by adding additional arguments to the command.</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>def get_route_hops(protocol):
    global _args

    try:
        result = None
        if protocol == "UDP":
            result = subprocess.run(&#91;'traceroute', _args.host&#93;, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=_args.timeout)
        elif protocol == "ICMP":
            result = subprocess.run(&#91;'traceroute', _args.host, '-I'&#93;, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=_args.timeout)
        
        # Count the number of hops (lines returned by traceroute)
        hops = len(result.stdout.splitlines()) - 1

        return hops if hops > 0 else 0

    except subprocess.TimeoutExpired:
        return 0
    except Exception as e:
        return 0</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: #9CDCFE">def</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">get_route_hops</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">protocol</span><span style="color: #D4D4D4">):</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">global</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">_args</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">try</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #9CDCFE">result</span><span style="color: #D4D4D4"> = </span><span style="color: #9CDCFE">None</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">protocol</span><span style="color: #D4D4D4"> == </span><span style="color: #CE9178">&quot;UDP&quot;</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #9CDCFE">result</span><span style="color: #D4D4D4"> = </span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">run</span><span style="color: #D4D4D4">(&#91;</span><span style="color: #CE9178">&#39;traceroute&#39;</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">_args</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">host</span><span style="color: #D4D4D4">&#93;, </span><span style="color: #9CDCFE">stdout</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">PIPE</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">stderr</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">PIPE</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">text</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">True</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">timeout</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">_args</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">timeout</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #9CDCFE">elif</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">protocol</span><span style="color: #D4D4D4"> == </span><span style="color: #CE9178">&quot;ICMP&quot;</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #9CDCFE">result</span><span style="color: #D4D4D4"> = </span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">run</span><span style="color: #D4D4D4">(&#91;</span><span style="color: #CE9178">&#39;traceroute&#39;</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">_args</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">host</span><span style="color: #D4D4D4">, </span><span style="color: #CE9178">&#39;-I&#39;</span><span style="color: #D4D4D4">&#93;, </span><span style="color: #9CDCFE">stdout</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">PIPE</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">stderr</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #4FC1FF">PIPE</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">text</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">True</span><span style="color: #D4D4D4">, </span><span style="color: #9CDCFE">timeout</span><span style="color: #D4D4D4">=</span><span style="color: #9CDCFE">_args</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">timeout</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">        </span></span>
<span class="line"><span style="color: #D4D4D4">        # </span><span style="color: #9CDCFE">Count</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">the</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">number</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">of</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">hops</span><span style="color: #D4D4D4"> (</span><span style="color: #9CDCFE">lines</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">returned</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">by</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">traceroute</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #9CDCFE">hops</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">len</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">result</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">stdout</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">splitlines</span><span style="color: #D4D4D4">()) - </span><span style="color: #B5CEA8">1</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">hops</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">if</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">hops</span><span style="color: #D4D4D4"> &gt; </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">else</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">except</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">subprocess</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">TimeoutExpired</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">except</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">Exception</span><span style="color: #D4D4D4"> </span><span style="color: #C586C0">as</span><span style="color: #D4D4D4"> </span><span style="color: #4EC9B0">e</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 5: Combine Logic in the Main Function</h2>



<p>The main function shall do the following:</p>



<ol class="wp-block-list">
<li>Parse arguments.</li>



<li>Attempt traceroute on the specified protocol.</li>



<li>Fallback to alternative protocols if the specified protocol fails.</li>



<li>Compare the hop counts against the thresholds.</li>



<li>Build and print a Nagios status message.</li>



<li>Exit with the proper status code.</li>
</ol>



<p>For testing, you can add debug statements that print out additional information if the &#8211;debug argument exists.</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:#adbac7;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>    # Find the number of hops to the host using different protocols    
    protocols = &#91;'UDP', 'ICMP'&#93;    
    if _args.protocol in protocols:        
      protocols.remove(_args.protocol)       
      protocols.insert(0, _args.protocol)   
      
      hops = 0   
      used_protocol = _args.protocol  
      
      # Check the default protocol first   
      hops = get_route_hops(_args.protocol)  
      
      # If the default protocol fails, try the other protocols   
      if hops == 0:     
      for protocol in protocols&#91;1:&#93;:        
        hops = get_route_hops(protocol)
             
        if hops > 0:            
          used_protocol = protocol             
          break
        if hops == 0:       
          print("CRITICAL - Failed to determine hop count for all protocols")            
          sys.exit(CRITICAL)  
            
        # Set the status code based on the number of hops to the host    
        status_code = OK   
        if _args.warning and hops >= _args.warning:       
          status_code = WARNING   
        if _args.critical and hops >= _args.critical:       
          status_code = CRITICAL
          status_dict = {      
            0: "OK",       
            1: "WARNING",      
            2: "CRITICAL",   
          }
         
        # Build the status message   
        message = ''   
        if (hops == 1):      
          message = f"{status_dict&#91;status_code&#93;} - {hops} hop was counted to {_args.host}" 
        else:       
        message = f"{status_dict&#91;status_code&#93;} - {hops} hops were counted to {_args.host}"
         
        print(message)    
        sys.exit(status_code)</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 github-dark-dimmed" style="background-color: #22272e" tabindex="0"><code><span class="line"><span style="color: #ADBAC7">    # Find the number </span><span style="color: #F47067">of</span><span style="color: #ADBAC7"> hops to the host </span><span style="color: #F47067">using</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">different</span><span style="color: #ADBAC7"> protocols    </span></span>
<span class="line"><span style="color: #ADBAC7">    protocols </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> &#91;</span><span style="color: #96D0FF">&#39;UDP&#39;</span><span style="color: #ADBAC7">, </span><span style="color: #96D0FF">&#39;ICMP&#39;</span><span style="color: #ADBAC7">&#93;    </span></span>
<span class="line"><span style="color: #ADBAC7">    </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> _args.protocol </span><span style="color: #F47067">in</span><span style="color: #ADBAC7"> </span><span style="color: #F69D50">protocols</span><span style="color: #ADBAC7">:        </span></span>
<span class="line"><span style="color: #ADBAC7">      protocols.</span><span style="color: #DCBDFB">remove</span><span style="color: #ADBAC7">(_args.protocol)       </span></span>
<span class="line"><span style="color: #ADBAC7">      protocols.</span><span style="color: #DCBDFB">insert</span><span style="color: #ADBAC7">(</span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">, _args.protocol)   </span></span>
<span class="line"><span style="color: #ADBAC7">      </span></span>
<span class="line"><span style="color: #ADBAC7">      hops </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">   </span></span>
<span class="line"><span style="color: #ADBAC7">      used_protocol </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> _args.protocol  </span></span>
<span class="line"><span style="color: #ADBAC7">      </span></span>
<span class="line"><span style="color: #ADBAC7">      # Check the </span><span style="color: #F47067">default</span><span style="color: #ADBAC7"> protocol first   </span></span>
<span class="line"><span style="color: #ADBAC7">      hops </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #DCBDFB">get_route_hops</span><span style="color: #ADBAC7">(_args.protocol)  </span></span>
<span class="line"><span style="color: #ADBAC7">      </span></span>
<span class="line"><span style="color: #ADBAC7">      # If the </span><span style="color: #F47067">default</span><span style="color: #ADBAC7"> protocol fails, </span><span style="color: #F47067">try</span><span style="color: #ADBAC7"> the other protocols   </span></span>
<span class="line"><span style="color: #ADBAC7">      </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> hops </span><span style="color: #F47067">==</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">:     </span></span>
<span class="line"><span style="color: #ADBAC7">      for protocol </span><span style="color: #F47067">in</span><span style="color: #ADBAC7"> protocols&#91;</span><span style="color: #6CB6FF">1</span><span style="color: #ADBAC7">:&#93;:        </span></span>
<span class="line"><span style="color: #ADBAC7">        hops </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #DCBDFB">get_route_hops</span><span style="color: #ADBAC7">(protocol)</span></span>
<span class="line"><span style="color: #ADBAC7">             </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> hops </span><span style="color: #F47067">&gt;</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">:            </span></span>
<span class="line"><span style="color: #ADBAC7">          used_protocol </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> protocol             </span></span>
<span class="line"><span style="color: #ADBAC7">          </span><span style="color: #F47067">break</span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> hops </span><span style="color: #F47067">==</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">:       </span></span>
<span class="line"><span style="color: #ADBAC7">          </span><span style="color: #DCBDFB">print</span><span style="color: #ADBAC7">(</span><span style="color: #96D0FF">&quot;CRITICAL - Failed to determine hop count for all protocols&quot;</span><span style="color: #ADBAC7">)            </span></span>
<span class="line"><span style="color: #ADBAC7">          sys.</span><span style="color: #DCBDFB">exit</span><span style="color: #ADBAC7">(</span><span style="color: #6CB6FF">CRITICAL</span><span style="color: #ADBAC7">)  </span></span>
<span class="line"><span style="color: #ADBAC7">            </span></span>
<span class="line"><span style="color: #ADBAC7">        # Set the status code based on the number </span><span style="color: #F47067">of</span><span style="color: #ADBAC7"> hops to the host    </span></span>
<span class="line"><span style="color: #ADBAC7">        status_code </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">OK</span><span style="color: #ADBAC7">   </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> _args.warning and hops </span><span style="color: #F47067">&gt;=</span><span style="color: #ADBAC7"> _args.warning:       </span></span>
<span class="line"><span style="color: #ADBAC7">          status_code </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">WARNING</span><span style="color: #ADBAC7">   </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> _args.critical and hops </span><span style="color: #F47067">&gt;=</span><span style="color: #ADBAC7"> _args.critical:       </span></span>
<span class="line"><span style="color: #ADBAC7">          status_code </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">CRITICAL</span></span>
<span class="line"><span style="color: #ADBAC7">          status_dict </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> {      </span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #6CB6FF">0</span><span style="color: #ADBAC7">: </span><span style="color: #96D0FF">&quot;OK&quot;</span><span style="color: #ADBAC7">,       </span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #6CB6FF">1</span><span style="color: #ADBAC7">: </span><span style="color: #96D0FF">&quot;WARNING&quot;</span><span style="color: #ADBAC7">,      </span></span>
<span class="line"><span style="color: #ADBAC7">            </span><span style="color: #6CB6FF">2</span><span style="color: #ADBAC7">: </span><span style="color: #96D0FF">&quot;CRITICAL&quot;</span><span style="color: #ADBAC7">,   </span></span>
<span class="line"><span style="color: #ADBAC7">          }</span></span>
<span class="line"><span style="color: #ADBAC7">         </span></span>
<span class="line"><span style="color: #ADBAC7">        # Build the status message   </span></span>
<span class="line"><span style="color: #ADBAC7">        message </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> </span><span style="color: #96D0FF">&#39;&#39;</span><span style="color: #ADBAC7">   </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">if</span><span style="color: #ADBAC7"> (hops </span><span style="color: #F47067">==</span><span style="color: #ADBAC7"> </span><span style="color: #6CB6FF">1</span><span style="color: #ADBAC7">):      </span></span>
<span class="line"><span style="color: #ADBAC7">          message </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> f</span><span style="color: #96D0FF">&quot;{status_dict&#91;status_code&#93;} - {hops} hop was counted to {_args.host}&quot;</span><span style="color: #ADBAC7"> </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #F47067">else</span><span style="color: #ADBAC7">:       </span></span>
<span class="line"><span style="color: #ADBAC7">        message </span><span style="color: #F47067">=</span><span style="color: #ADBAC7"> f</span><span style="color: #96D0FF">&quot;{status_dict&#91;status_code&#93;} - {hops} hops were counted to {_args.host}&quot;</span></span>
<span class="line"><span style="color: #ADBAC7">         </span></span>
<span class="line"><span style="color: #ADBAC7">        </span><span style="color: #DCBDFB">print</span><span style="color: #ADBAC7">(message)    </span></span>
<span class="line"><span style="color: #ADBAC7">        sys.</span><span style="color: #DCBDFB">exit</span><span style="color: #ADBAC7">(status_code)</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 6: Test the Plugin</h2>



<p>Run your script manually to verify that your plugin functions as expected. Try different combinations of arguments to ensure everything functions as expected.</p>



<p>Here is an example of what you could run in your terminal:</p>



<pre class="wp-block-code"><code>python3 check_route_hops.py -H example.com -w 10 -c 20 -p ICMP --debug</code></pre>



<h2 class="wp-block-heading">Step 7: Upload your plugin to Nagios XI</h2>



<p>Follow the steps <a href="https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">here</a> to add your new plugin to Nagios XI!</p>



<h2 class="wp-block-heading">Video</h2>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Create A Nagios Plugin And Wizard To Monitor Hops Between Hosts Using Traceroute - Tyler Larson" width="800" height="450" src="https://www.youtube.com/embed/EPRfBj3W_oY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



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



<p>You’ve successfully created a custom Nagios plugin to monitor route hops. This plugin is highly customizable, allowing you to modify thresholds and protocols as needed. It’s a solid tool for monitoring network paths and troubleshooting connectivity issues.</p>



<p></p>
]]></content:encoded>
					
		
		
		<media:content url="https://www.youtube.com/embed/EPRfBj3W_oY" medium="video">
			<media:player url="https://www.youtube.com/embed/EPRfBj3W_oY" />
			<media:title type="plain">Training - Nagios Library</media:title>
			<media:description type="html"><![CDATA[Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.]]></media:description>
			<media:thumbnail url="https://library.nagios.com/wp-content/uploads/2025/10/Library-article-featured-image-route-hops.png" />
			<media:rating scheme="urn:simple">nonadult</media:rating>
		</media:content>
	</item>
		<item>
		<title>New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &#038; Support</title>
		<link>https://library.nagios.com/training/nagios-docs-and-support/</link>
		
		<dc:creator><![CDATA[Hannah Adamson]]></dc:creator>
		<pubDate>Fri, 11 Jul 2025 14:00:00 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Infrastructure Monitoring]]></category>
		<category><![CDATA[Setup & Installation]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=58525</guid>

					<description><![CDATA[Whether you&#8217;re just getting started with Nagios or are looking to find more resources and support, this guide walks you through the essential Nagios docs and resources available to you. From step-by-step documentation to webinars, here&#8217;s everything you need to get the most out of your Nagios setup. Nagios Documentation &#38; Guides ➤ We recently [&#8230;]]]></description>
										<content:encoded><![CDATA[
<div style="margin-top:0;margin-bottom:0;height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow">
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p style="font-size:16px">Whether you&#8217;re just getting started with Nagios or are looking to find more resources and support, this guide walks you through the essential Nagios docs and resources available to you. From step-by-step documentation to webinars, here&#8217;s everything you need to get the most out of your Nagios setup.</p>
</blockquote>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex">
<div style="height:47px;width:17px" aria-hidden="true" class="wp-block-spacer wp-container-content-fd0eeb70"></div>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Guide Overview</h2><nav><ul><li class=""><a href="#nagios-docs-guides">Documentation &amp; Guides</a></li><li class=""><a href="#video-resources-1-1">Support Options</a></li><li class=""><a href="#video-resources-1">Video Resources</a></li><li class=""><a href="#video-resources-1-1-2">Community Resources</a></li></ul></nav></div>
</div>
</div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<h2 class="wp-block-heading" id="nagios-docs-guides">Nagios Documentation &amp; Guides</h2>
</div><figure class="wp-block-media-text__media"><img fetchpriority="high" decoding="async" width="1024" height="556" src="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-16-1024x556.png" alt="Step-by-step tutorials and guides." class="wp-image-59076 size-full" title="New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &amp; Support 6" srcset="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-16-1024x556.png 1024w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-16-300x163.png 300w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-16-768x417.png 768w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-16.png 1326w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p>➤ We recently revamped all of our documentation, providing you with accurate, easy-to-understand instructions and helpful tips for using Nagios. These Nagios docs will guide you through the basics, help you get started, and support you in learning more about Nagios tools.</p>



<div style="height:27px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Documentation</strong></p>



<p>A new comprehensive documentation site replacing the legacy Support Knowledgebase. Here, you&#8217;ll find guides for commercial solutions and open-source projects with step-by-step tutorials, technical documentation, and best practices.</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://library.nagios.com/docs" target="_blank" rel="noreferrer noopener">Nagios Documentation</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Library</strong></p>



<p>Library is a central place for detailed Nagios training docs, how-to guides, articles on the latest industry insights, and real-life stories about using Nagios:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://library.nagios.com/" target="_blank" rel="noreferrer noopener">Nagios Library</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Admin Guides</strong></p>



<p>Looking for step-by-step instructions? These guides walk you through installation, configuration, and advanced setup:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://assets.nagios.com/downloads/nagiosxi/guides/administrator/" target="_blank" rel="noreferrer noopener">XI Admin Guide</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://assets.nagios.com/downloads/nagios-log-server/guides/administrator/" target="_blank" rel="noreferrer noopener">Log Server Admin Guide</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://assets.nagios.com/downloads/nagios-network-analyzer/guides/nna-ag/" target="_blank" rel="noreferrer noopener">Network Analyzer Admin Guide</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://assets.nagios.com/downloads/nagiosfusion/guides/administrator/" target="_blank" rel="noreferrer noopener">Fusion Admin Guide</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://assets.nagios.com/downloads/nagiosxi/guides/administrator/ccm.php" target="_blank" rel="noreferrer noopener">Core Admin Guide</a></div>
</div>



<div style="height:59px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<h2 class="wp-block-heading" id="video-resources-1-1">Nagios Support Options</h2>
</div><figure class="wp-block-media-text__media"><img decoding="async" width="1024" height="556" src="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-34-1024x556.png" alt="Nagios CSMs, support plans, and Answer Hub." class="wp-image-60650 size-full" title="New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &amp; Support 7" srcset="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-34-1024x556.png 1024w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-34-300x163.png 300w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-34-768x417.png 768w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-34.png 1326w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p>➤ Support options are designed to provide both quick answers and in-depth assistance. Nagios offers these resources with every license.</p>



<div style="height:39px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Customer Success Managers</strong></p>



<p>If you have a Nagios license, you can contact a Nagios Customer Success Manager (CSM). CSMs can help with a wide variety of Nagios-related information.&nbsp;They can help answer basic questions about Nagios, get you in contact with the right support, as well as help you renew or buy a new license.</p>



<p>To contact a Nagios CSM, email <a href="mailto:csm@nagios.com" target="_blank" rel="noreferrer noopener">csm@nagios.com</a>.</p>



<div style="height:44px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Support Plans</strong></p>



<p>Guaranteed one-business-day response from Nagios Technicians for support tickets (up to 10 per year), with the option to purchase additional support plans as needed:</p>



<div class="wp-block-buttons is-layout-flex wp-container-core-buttons-is-layout-9bedd9bf wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.nagios.com/support-plans/" target="_blank" rel="noreferrer noopener">Nagios Support Plans</a></div>
</div>



<div style="height:55px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Answer Hub</strong></p>



<p>Find answers to frequently asked questions and product-specific help:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://support.nagios.com/access-nagios-answer-hub/" target="_blank" rel="noreferrer noopener">Nagios Answer Hub</a></div>
</div>



<div style="height:55px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Support Website</strong></p>



<p>The Nagios Support makes it easy to find what you need, with quick access to the Knowledge Base, Library, Support Forum, and product-specific resource pages:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://support.nagios.com/" target="_blank" rel="noreferrer noopener">Nagios Support</a></div>
</div>



<div style="height:54px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<h2 class="wp-block-heading" id="video-resources-1">Nagios Video Resources</h2>
</div><figure class="wp-block-media-text__media"><img decoding="async" width="1024" height="556" src="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-18-1024x556.png" alt="Video tutorials and webinars." class="wp-image-59080 size-full" title="New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &amp; Support 8" srcset="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-18-1024x556.png 1024w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-18-300x163.png 300w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-18-768x417.png 768w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-18.png 1326w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p>➤ Prefer to learn visually? Our video resources walk through installation, setup, Nagios training, and more.</p>



<div style="height:29px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios YouTube Channel</strong></p>



<p>Explore our video tutorials, product demos, and best practices all in one place:</p>



<div class="wp-block-buttons is-layout-flex wp-container-core-buttons-is-layout-9bedd9bf wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.youtube.com/@nagiosvideo" target="_blank" rel="noreferrer noopener">Nagios YouTube Channel</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Webinars</strong></p>



<p>Want deeper insights? Nagios Webinars offer regular sessions covering best practices, use cases, and expert tips:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="http://nagios.com/webinars" target="_blank" rel="noreferrer noopener">Nagios Webinars</a></div>
</div>



<div style="height:51px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<h2 class="wp-block-heading" id="video-resources-1-1-2">Nagios Community Resources</h2>
</div><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="1024" height="556" src="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-19-1024x556.png" alt="Join the forums, share solutions." class="wp-image-59083 size-full" title="New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &amp; Support 9" srcset="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-19-1024x556.png 1024w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-19-300x163.png 300w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-19-768x417.png 768w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-19.png 1326w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-text-align-left">➤ Access years of collective experience, along with support options and answers to common questions.</p>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Support Forum</strong></p>



<p>The Nagios Support Forum is an ideal place to get quick answers to “how-to” questions.&nbsp;Ask questions, find answers, and contribute to active discussions:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://support.nagios.com/forum/" target="_blank" rel="noreferrer noopener">Nagios Support Forum</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Nagios Exchange</strong></p>



<p>Browse thousands of community-created plugins, add-ons, and integrations, or share your own projects with the Nagios Community.</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://exchange.nagios.org/" target="_blank" rel="noreferrer noopener">Nagios Exchange</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<h2 class="wp-block-heading" id="video-resources-1-1-8">Where to Go Next</h2>
</div><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="1024" height="556" src="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-2-1024x556.png" alt="Personalized demo, free Nagios trial, and QuickStart session." class="wp-image-59058 size-full" title="New to Nagios? Start Here: Your Guide to Nagios Docs, Resources, &amp; Support 10" srcset="https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-2-1024x556.png 1024w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-2-300x163.png 300w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-2-768x417.png 768w, https://library.nagios.com/wp-content/uploads/2025/06/noisy-gradients-2.png 1326w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p>➤ If you&#8217;re still looking for more resources, Nagios offers free one-on-one sessions with a Nagios Technician—plus free trials to help you get started.</p>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Personalized Demo</strong></p>



<p>See Nagios in action, explore key features, and discover how Nagios fits your infrastructure:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.nagios.com/request-demo/?utm_source=library&amp;utm_medium=article&amp;utm_campaign=schedule-demo-page" target="_blank" rel="noreferrer noopener">Personalized Demo</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Download a Free Trial</strong></p>



<p>Get a free, 30-day trial of any Nagios Enterprise Solution to try it out yourself:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.nagios.com/products/?utm_source=library&amp;utm_medium=article&amp;utm_campaign=free-trial" target="_blank" rel="noreferrer noopener">Get a Free Trial</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:24px"><strong>Quickstart Session</strong></p>



<p>Get your instance up and running, discuss your environment, and receive tailored configuration help:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.nagios.com/quickstart/?utm_source=library&amp;utm_medium=article&amp;utm_campaign=quickstart-session" target="_blank" rel="noreferrer noopener">Quickstart Session</a></div>
</div>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:59px" aria-hidden="true" class="wp-block-spacer"></div>



<p>There’s no single way to get started with Nagios. Some like to dig into the documentation, while others prefer more hands-on Nagios training, such as a product walkthrough or demo. However you like to learn, there’s a resource to match your style.</p>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:18px"><strong>Have Questions? Reach Out to Us</strong></p>



<p>Reach out anytime to <a class="" href="mailto:sales@nagios.com">sales@nagios.com</a> if you have questions or need support. We’re here to help you get the most out of Nagios.</p>



<div style="height:61px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<div style="height:22px" aria-hidden="true" class="wp-block-spacer"></div>



<p style="font-size:18px"><strong><em><strong>Helpful Extras to Check Out</strong></em></strong></p>



<div style="height:7px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p style="font-size:16px"><strong>Nagios Blog</strong></p>



<p>Check out industry insights, helpful solutions, and the benefits of network monitoring:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.nagios.com/articles/" target="_blank" rel="noreferrer noopener">Nagios Blog</a></div>
</div>
</div>
</div>



<div style="height:55px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>Nagios&#8217; Social Media</strong></p>



<p>Get the latest updates and stay in the loop:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.facebook.com/NagiosInc/#" target="_blank" rel="noopener">Facebook</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.pardot.com%2Fe%2F975333%2Fprises-llc-posts--feedView-all%2F7t9nt%2F578396248%2Fh%2FL-YWa3uEBF4dZL_Q_6_7D5h--pnLOo-Mtao6OumezKw&amp;data=05%7C02%7Chadamson%40nagios.com%7C100413b7cb17430dfdad08ddae8a30ce%7Caeb3589cecf7477db308d9b16ad9dd45%7C0%7C0%7C638858630742052163%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&amp;sdata=sgJ0ZSh%2FCxHSN%2B1mmzoNy7vc58GSP8pJ1drSgEcFSm8%3D&amp;reserved=0" target="_blank" rel="noopener">LinkedIn</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.instagram.com/nagiosinc/" target="_blank" rel="noopener">Instagram</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.pardot.com%2Fe%2F975333%2Fnagiosinc%2F7t9nm%2F578396248%2Fh%2FL-YWa3uEBF4dZL_Q_6_7D5h--pnLOo-Mtao6OumezKw&amp;data=05%7C02%7Chadamson%40nagios.com%7C100413b7cb17430dfdad08ddae8a30ce%7Caeb3589cecf7477db308d9b16ad9dd45%7C0%7C0%7C638858630741967834%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&amp;sdata=pR0pnoc97Y18i1g0cAlD5VMu%2B4P%2B%2Bnzz3quOC1ISbEU%3D&amp;reserved=0" target="_blank" rel="noopener">X</a></div>



<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://bsky.app/profile/nagiosinc.bsky.social" target="_blank" rel="noopener">Bluesky</a></div>
</div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>First Steps Hostgroup Inheritance</title>
		<link>https://library.nagios.com/monitoring/first-steps-hostgroup-inheritance/</link>
		
		<dc:creator><![CDATA[Michael Bellerue]]></dc:creator>
		<pubDate>Tue, 08 Jul 2025 13:45:00 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Host Groups]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=60129</guid>

					<description><![CDATA[Nagios Hostgroup Inheritance Series — Part 2: First Steps Hostgroup Inheritance Introduction In the first article in this series, I introduced the concept of hostgroup inheritance and (hopefully) laid it out in a way that it can be well understood. In this article, I&#8217;m going to start walking you through setting up a solid hostgroup [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h6 class="wp-block-heading">Nagios Hostgroup Inheritance Series — Part 2: First Steps Hostgroup Inheritance</h6>



<h2 class="wp-block-heading">Introduction</h2>



<p>In the <a href="https://library.nagios.com/training/intro-hostgroup-inheritance/" target="_blank" rel="noreferrer noopener">first article</a> in this series, I introduced the concept of hostgroup inheritance and (hopefully) laid it out in a way that it can be well understood. In this article, I&#8217;m going to start walking you through setting up a solid hostgroup inheritance foundation.</p>



<p>By the end of this article, you should have a functional hostgroup inheritance setup; however, I do not recommend running through these steps in your production environment. There will be future articles where we will expand on the functionality laid out here.</p>



<p>With that said, if you are running Nagios XI, you are allowed three instances of Nagios XI: Production, Test, and Disaster Recovery. This would be a good opportunity to fire up that &#8220;Test&#8221; instance of Nagios XI.</p>



<h2 class="wp-block-heading">Begin by Beginning</h2>



<p>For this first example, we&#8217;re going to setup hostgroup inheritance with a fresh install of Nagios XI. Once we&#8217;re done with this, you should have a good idea of how to retro fit an existing XI instance.</p>



<p>We&#8217;ll start this off by running a Configuration Wizard against a host that you want to monitor. The host that you want to monitor will, presumably, be one of a large number of similar hosts. In our example, we&#8217;ll use a basic Windows host being monitored using NCPA.</p>



<p>Now I don&#8217;t want to walk you through running the NCPA Wizard to monitor your Windows host. I&#8217;ll leave that as an exercise  to you. The end result is that in the Core Configuration Manager (CCM), you now have a host with multiple services being monitored. If you go to the Services section of the CCM and display the config for the Windows machine you are monitoring, you should see something similar to this:</p>



<figure class="wp-block-image size-full is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/06/CCMServices.png"><img loading="lazy" decoding="async" width="430" height="553" src="https://library.nagios.com/wp-content/uploads/2025/06/CCMServices.png" alt="The Services section of the CCM" class="wp-image-60130" style="width:432px;height:auto" title="First Steps Hostgroup Inheritance 11" srcset="https://library.nagios.com/wp-content/uploads/2025/06/CCMServices.png 430w, https://library.nagios.com/wp-content/uploads/2025/06/CCMServices-233x300.png 233w" sizes="(max-width: 430px) 100vw, 430px" /></a><figcaption>First Steps Hostgroup Inheritance 12</figcaption></figure>



<h2 class="wp-block-heading">Changing a Single Service Check</h2>



<p>You can see we&#8217;ve got CPU, disk, bandwidth, memory, and a service that we&#8217;re monitoring on this Windows box. Now we know that for all of our servers, whether Windows or Linux (or AIX, or Solaris, or FreeBSD, etc.), we want to monitor CPU and memory usage. Why create that over and over again? Why not just have that in some kind of template that can be applied to each server as you add it?</p>



<p>That&#8217;s what we&#8217;re going to do here. Before we modify that service, let&#8217;s create a hostgroup that will hold service checks for any OS. Click on Monitoring -&gt; Host Groups -&gt; Add New. Now for the Host Group Name and Alias fields, I like to keep this brief, yet descriptive. For this one I&#8217;m going to call it <code>ncpa-anyos</code>. Meaning the system is monitored using NCPA, and the service checks apply to any operating system. Click save.</p>



<p>Now go back to Monitoring -&gt; Services and open up the CPU Usage service check definition (or whatever service you want to make available via hostgroup inheritance) and let&#8217;s convert it.</p>



<p>The first field we want to change is the Config Name field. In Nagios XI, this field typically lines up with the name or IP of the host it is tied to. But it doesn&#8217;t have to be that way. Let&#8217;s create a new config name by changing this to <code>AnyOS</code>. Meaning the service checks in this config will apply to any operating system.</p>



<p>Next, click the <code>Manage Hosts</code> button and remove the assigned host. And finally, click the <code>Manage Host Groups</code> button, and add the service check to the <code>ncpa-anyos</code> hostgroup. Realistically, that&#8217;s it. Now any host that you put in the <code>ncpa-anyos</code> hostgroup will have that CPU Usage service check. Go ahead and add a host to the <code>ncpa-anyos</code> hostgroup, apply the configuration, and check your host status screen.</p>



<h2 class="wp-block-heading">Limitations</h2>



<p>There are some immediate limitations with this setup as it is right now. We&#8217;ll dive into the fixes for them in my next article for this series. For now, I just want to call out one in particular.</p>



<p>Not all of your hosts will have the same CPU warning and/or critical thresholds. Or maybe they have different NCPA tokens. For those of you who don&#8217;t want to wait for the next article, I&#8217;ll point you in the right direction. In the next article, we&#8217;ll touch on using custom host variables and host templates to deal with the limitation of needing to customize different pieces of a service check. We&#8217;ll also be touching on creating a new command.</p>



<h2 class="wp-block-heading">Additional Reading for Overachievers</h2>



<p><a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/macros.html" target="_blank" rel="noopener">Nagios Custom Macros</a>.</p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI-2024.pdf" target="_blank" rel="noopener">Managing Plugins in Nagios XI 2024</a>. Specifically, we will be looking at the <code>Define A Command</code> section of this document.</p>



<p>And since we&#8217;ll be talking about host and service templates, it might be good to brush up on <a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectinheritance.html" target="_blank" rel="noopener">Object Inheritance</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>3 Easy Ways to Use Capacity Planning in Nagios XI</title>
		<link>https://library.nagios.com/techtips/using-capacity-planning-in-nagios-xi/</link>
		
		<dc:creator><![CDATA[Shamas Demoret]]></dc:creator>
		<pubDate>Wed, 28 May 2025 19:33:56 +0000</pubDate>
				<category><![CDATA[Techtips]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Capacity Planning]]></category>
		<category><![CDATA[Performance Graphs]]></category>
		<category><![CDATA[Reports]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=57244</guid>

					<description><![CDATA[Learn 3 ways to use Nagios XI's Capacity Planning feature to project the resource usage of tomorrow, today! ]]></description>
										<content:encoded><![CDATA[
<p>Monitoring current system performance is critical to keeping things running smoothly in your IT infrastructure, but why not also make use of all the historical performance data you collect to create projections of future usage? With Nagios XI&#8217;s Capacity Planning capability, one of the most popular Enterprise Edition features, you&#8217;ll be able to visualize and alert on the usage of tomorrow, today!</p>



<h2 class="wp-block-heading">1. Using the Report</h2>



<p>To access the report, navigate to the <strong>Reports</strong> menu, then select <strong>Capacity Planning</strong>. Next, select the Period (how far into the future you want to project), and select the specific Host, Hostgroup, or Servicegroup to graph the results for.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1.png"><img loading="lazy" decoding="async" width="1024" height="512" src="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1-1024x512.png" alt="Screenshot of the capacity planning report in Nagios XI showing projected disk usage on a Linux machine." class="wp-image-57324" title="3 Easy Ways to Use Capacity Planning in Nagios XI 13" srcset="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1-1024x512.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1-300x150.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1-768x384.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1-1536x768.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-report-1.png 1893w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Head to Reports &gt; Capacity Planning to run a projection. </figcaption></figure>



<p>Once you make all of your customization selections, you can then save, email, export, and even (another great Enterprise Edition feature) schedule the report for automatic delivery at set times.</p>



<p>Alternately, you can navigate to the <strong>Status Detail</strong> page for a service and go to the <strong>Capacity Planning</strong> tab to view projections.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail.png"><img loading="lazy" decoding="async" width="1024" height="481" src="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail-1024x481.png" alt="Screenshot of the Service Status Detail page for Memory Usage on a Linux machine, showing a Capacity Planning graph in the Capacity Planning tab." class="wp-image-57346" title="3 Easy Ways to Use Capacity Planning in Nagios XI 14" srcset="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail-1024x481.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail-300x141.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail-768x361.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail-1536x722.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-service-detail.png 1610w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">You can also run projections in your Service Status Detail pages. </figcaption></figure>



<p>The options tabs to the right of the initial graph provide access to a data Summary, all of the individual data points, and the option to customize your Time Period and Extrapolation Method. </p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options.png"><img loading="lazy" decoding="async" width="1024" height="473" src="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options-1024x473.png" alt="Screenshot of the Summary tab of the Capacity Planning section of the Service Status Details for memory usage on a Linux system." class="wp-image-57352" title="3 Easy Ways to Use Capacity Planning in Nagios XI 15" srcset="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options-1024x473.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options-300x139.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options-768x355.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options-1536x710.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-options.png 1597w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Customize with the options tabs. </figcaption></figure>



<h2 class="wp-block-heading">2. Adding Graphs to Dashboards</h2>



<p>You&#8217;ll notice the Dashify icon on the upper left of each Capacity Planning graph, which you can click to easily add them to your Dashboards. This provides an easy way to quickly access at-a-glance projections for key services in your environment and to roll them into other Dashboards you&#8217;ve created.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2.png"><img loading="lazy" decoding="async" width="1024" height="518" src="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2-1024x518.png" alt="Screenshot of a Nagios XI Dashboard showing 4 capacity planning graphs projecting future disk usage on various machines running Nagios software." class="wp-image-57362" title="3 Easy Ways to Use Capacity Planning in Nagios XI 16" srcset="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2-1024x518.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2-300x152.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2-768x389.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2-1536x777.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-dash2.png 1901w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Add Capacity Planning graphs to your Dashboards with ease. </figcaption></figure>



<h2 class="wp-block-heading">3. Using the Wizard</h2>



<p>It&#8217;s even possible to set up alerts on projections using the Capacity Planning Wizard, found in the <strong>Configure &gt; Configuration Wizards</strong> menu. In <strong>Step 1</strong> you&#8217;ll choose which service to monitor. Then in <strong>Step 2</strong> you&#8217;ll choose how far ahead the check should look, what algorithm it should use, the projected value at which you want to be alerted, and how many days in advance of the resource hitting the custom value you wish to be alerted.</p>



<p>You can choose to either add the newly created services to the host under which the services producing the performance data reside or check the &#8220;<strong>Put all new services on a specific host</strong>&#8221; checkbox to assign them elsewhere (for example, to a dummy host reserved just for capacity planning checks).</p>



<p>You can click the <strong>Render Graph</strong> link at the bottom of the wizard to see a graph of current and projected data and to see where your Custom Value selection falls within it.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard.png"><img loading="lazy" decoding="async" width="1024" height="565" src="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard-1024x565.png" alt="Screenshot of Step 2 of the Nagios XI Capacity Planning wizard, showing the settings for a check on C: drive disk usage." class="wp-image-57339" title="3 Easy Ways to Use Capacity Planning in Nagios XI 17" srcset="https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard-1024x565.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard-300x165.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard-768x423.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard-1536x847.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/cap-planning-wizard.png 1687w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Alert on projections with the Capacity Planning wizard. </figcaption></figure>



<p>Once the checks are created, you can monitor them like any other service or even roll them into your Business Process Intelligence groups:</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-nagios-library wp-block-embed-nagios-library"><div class="wp-block-embed__wrapper">
https://library.nagios.com/techtips/nagios-xi-bpi-unlock-actionable-insights-for-it-monitoring-and-optimization
</div></figure>



<h2 class="wp-block-heading">Resources</h2>



<p>For a more detailed overview of using Capacity Planning, take a look at this guide:</p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Using-Capacity-Planning-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">How to Use Capacity Planning in Nagios XI </a></p>



<p>If you&#8217;d like a tour of all of the Enterprise Edition features, this article provides a comprehensive overview:</p>



<p><a href="https://library.nagios.com/solutions/nagios-xi-enterprise-edition-10-great-features/" target="_blank" rel="noreferrer noopener">10 Great Features of the Nagios XI Enterprise Edition</a></p>



<p>If you&#8217;d like to try Capacity Planning out for yourself, we offer a free trial version you can take for a spin:</p>



<p><a href="https://www.nagios.com/products/nagios-xi/downloads/#downloads" target="_blank" rel="noreferrer noopener">Nagios XI Free Trial Download</a></p>



<p>We&#8217;d also be happy to offer you a <a href="https://www.nagios.com/request-demo/" target="_blank" rel="noopener">custom Demo session</a> if want a guided tour of our solutions, or a <a href="https://www.nagios.com/quickstart/" target="_blank" rel="noopener">free Quickstart</a> remote session with a sales engineer to help you get a few things set up. You can email <strong>sales@nagios.com</strong> for details on setting up either option.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Compare Multi-tenancy Across 5 Nagios Tools</title>
		<link>https://library.nagios.com/training/compare-nagios-tool-multi-tenancy/</link>
		
		<dc:creator><![CDATA[Shamas Demoret]]></dc:creator>
		<pubDate>Wed, 21 May 2025 18:45:07 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Multi-tenancy]]></category>
		<category><![CDATA[User Management]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=56524</guid>

					<description><![CDATA[Multi-tenancy is a key feature of Nagios tools, enabling you to customize and limit user access and visibility in your Nagios monitoring setup.]]></description>
										<content:encoded><![CDATA[
<p>Multi-tenancy is a key feature of Nagios tools, enabling you to customize and limit user access and visibility in your Nagios monitoring setup. </p>



<p>This is especially important if you have an extensive environment or large team where different users and groups manage specific segments. You may wish to have everything from read-only viewers to full access superadmins accessing the Nagios user interfaces (UIs), with varying degrees in-between. </p>



<p>In this article we&#8217;ll take a look at the multi-tenancy options available in each Nagios solution.</p>



<h2 class="wp-block-heading">Nagios XI Multi-tenancy</h2>



<p>XI provides the most robust multi-tenancy capabilities of the entire Nagios suite. What each user you create can see and do in the user interface is deeply customizable. By default, the visibility and object control granted to regular users will be limited to those hosts and services they are a Contact on, but you can also check a box in the <strong>Security Settings</strong> section to allow them to see all hosts and services. You also decide which Users have access to the REST API, auto-deployment, and the Core Config Manager, and can click a single box to make any User read-only.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/XI-Security-Settings.png"><img loading="lazy" decoding="async" width="630" height="496" src="https://library.nagios.com/wp-content/uploads/2025/05/XI-Security-Settings.png" alt="Screenshot of the Security Settings section of the Nagios XI Add New User menu, showing it&#039;s deep multi-tenancy capabilities." class="wp-image-56579" title="Compare Multi-tenancy Across 5 Nagios Tools 18" srcset="https://library.nagios.com/wp-content/uploads/2025/05/XI-Security-Settings.png 630w, https://library.nagios.com/wp-content/uploads/2025/05/XI-Security-Settings-300x236.png 300w" sizes="(max-width: 630px) 100vw, 630px" /></a><figcaption class="wp-element-caption">Nagios XI offers deep control of User security settings. </figcaption></figure>



<p>To create and edit Users in Nagios XI, navigate to <strong>Admin &gt; Manage Users</strong>. </p>



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



<p>Dashboards in XI can be deployed to other users easily in the <strong>Dashboards &gt; Deploy Dashboards</strong> menu. You can even either let the users you deploy to update their copy of the Dashboard as they see fit or choose to keep it synced with changes you make.</p>



<h2 class="wp-block-heading">Nagios Core</h2>



<p>Nagios Core is the open source monitoring engine used by Nagios XI. Although all configuration is done from the Linux command line, it does provide a basic web display which shows status information and a includes a few options for interacting with the monitoring engine. Object visibility in the Core interface can be limited based on what hosts and services users are contacts on, as can their ability to send commands to the Core daemon.</p>



<figure class="wp-block-image size-large is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2.png"><img loading="lazy" decoding="async" width="1024" height="654" src="https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2-1024x654.png" alt="Screenshot of the Nagios Core UI, showing a list of Hostgroups." class="wp-image-56786" style="width:682px;height:auto" title="Compare Multi-tenancy Across 5 Nagios Tools 19" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2-1024x654.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2-300x192.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2-768x491.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/Core-CGI2.png 1510w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Core has a basic web UI, but is configured on the command line. </figcaption></figure>



<h2 class="wp-block-heading">Nagios Fusion Multi-tenancy</h2>



<p>In Nagios Fusion, users you create can either be a User or an Administrator. If you check the Administrator box in General Settings for a user, they will be able to see and access the <strong>Admin</strong> menu and all of its functions:</p>



<figure class="wp-block-image size-full is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-Admin.png"><img loading="lazy" decoding="async" width="827" height="571" src="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-Admin.png" alt="Screenshot of the Nagios Fusion Admin menu sidebar." class="wp-image-56914" style="width:682px;height:auto" title="Compare Multi-tenancy Across 5 Nagios Tools 20" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-Admin.png 827w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion-Admin-300x207.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion-Admin-768x530.png 768w" sizes="(max-width: 827px) 100vw, 827px" /></a><figcaption class="wp-element-caption">Fusion Administrators have access to the Admin menu sections. </figcaption></figure>



<p>Fusion also provides the ability to determine which of the fused servers you&#8217;re collecting data from each user should be able to see in the <strong>Server User Mapping</strong> section of their user settings. In the case of fused Nagios XI servers, you can also map your Fusion users to XI users so that within the Fusion UI, and when they click through to the XI UIs, the objects they can see will be tied to their XI user.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-User-Mapping.png"><img loading="lazy" decoding="async" width="476" height="472" src="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-User-Mapping.png" alt="Screenshot of the Server User Mapping section of the Nagios Fusion &gt; Manage Users menu." class="wp-image-56574" title="Compare Multi-tenancy Across 5 Nagios Tools 21" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Fusion-User-Mapping.png 476w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion-User-Mapping-300x297.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion-User-Mapping-150x150.png 150w" sizes="(max-width: 476px) 100vw, 476px" /></a><figcaption class="wp-element-caption">Map or exclude your Fusion Users to and from specific Nagios servers. </figcaption></figure>



<p>Your favorite Dashboards in Fusion can also be deployed to other users just like in Nagios XI. </p>



<p>To manage Fusion users, navigate to Admin <strong>Admin &gt; Manage Users</strong>. </p>



<h2 class="wp-block-heading">Nagios Log Server Multi-tenancy</h2>



<p>In Nagios Log Server, you have the ability to control both which log sources users can see data from, and which menus and functions they can access. Admin level users can modify and delete across all components and settings, while User level users are limited to editing only their account and personal dashboards, unless other User Permissions are granted using the checkboxes in the <strong>Admin &gt; User Management &gt; Create/Edit User</strong> menu, in the <strong>Permissions</strong> tab.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1.png"><img loading="lazy" decoding="async" width="1024" height="487" src="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1-1024x487.png" alt="Screenshot of the Nagios Log Server Create User menu, showing access levels and permissions." class="wp-image-56576" title="Compare Multi-tenancy Across 5 Nagios Tools 22" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1-1024x487.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1-300x143.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1-768x365.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms1.png 1066w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Controlling User permissions is easy in Nagios Log Server. </figcaption></figure>



<p>You can also restrict visibility of source log data to Host Lists (groups of sources you create), or individual sources, as well as determining whether API access is available.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms2b.png"><img loading="lazy" decoding="async" width="547" height="568" src="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms2b.png" alt="Restrict User visibility to individual sources or entire groups in Nagios Log Server." class="wp-image-56921" title="Compare Multi-tenancy Across 5 Nagios Tools 23" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms2b.png 547w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-User-Perms2b-289x300.png 289w" sizes="(max-width: 547px) 100vw, 547px" /></a><figcaption class="wp-element-caption">Restrict User visibility to individual sources or entire groups in Log Server. </figcaption></figure>



<p>On the Dashboards front, each Dashboard users create can be saved as a personal Dashboard visible only to them, or as a Global Dashboard visible to all Log Server users. </p>



<p>Finally, query-based Log Server alerts can be easily integrated with Nagios XI for additional control of user visibility. </p>



<h2 class="wp-block-heading">Nagios Network Analyzer Multi-tenancy</h2>



<p>In Network Analyzer, all users have full visibility of the entirety of Source data, but you determine whether they are a full access Admin, or a regular User which hides the configuration options and limits what they can edit. You also determine whether each regular user has API access:</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NNA-User-Perms.png"><img loading="lazy" decoding="async" width="822" height="323" src="https://library.nagios.com/wp-content/uploads/2025/05/NNA-User-Perms.png" alt="Screenshot of the User Access Level section of the Nagios Network Analyzer Create User menu." class="wp-image-56578" title="Compare Multi-tenancy Across 5 Nagios Tools 24" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NNA-User-Perms.png 822w, https://library.nagios.com/wp-content/uploads/2025/05/NNA-User-Perms-300x118.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/NNA-User-Perms-768x302.png 768w" sizes="(max-width: 822px) 100vw, 822px" /></a><figcaption class="wp-element-caption">Choose your Network Analyzer User access level. </figcaption></figure>



<p>You can also integrate Network Analyzer alerts with Nagios XI if you&#8217;re using both solutions, and limit access in the XI UI to only certain source alerts to control visibility. </p>



<p>Navigate to the <strong>Administration &gt; User Management </strong>menu to create and edit Network Analyzer users.</p>



<h2 class="wp-block-heading">Resources </h2>



<ul class="wp-block-list">
<li><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Understanding-User-Rights-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">Understanding User Rights in Nagios XI </a></li>
</ul>



<ul class="wp-block-list">
<li><a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/cgiauth.html" target="_blank" rel="noreferrer noopener">Authentication and Authorization in the Nagios Core CGIs</a></li>
</ul>



<ul class="wp-block-list">
<li><a href="https://assets.nagios.com/downloads/nagiosfusion/docs/Managing-Fusion-Users-in-Fusion-2024.pdf" target="_blank" rel="noreferrer noopener">Managing Nagios Fusion Users </a></li>
</ul>



<ul class="wp-block-list">
<li><a href="https://assets.nagios.com/downloads/nagios-log-server/docs/Managing-Users-In-Nagios-Log-Server.pdf" target="_blank" rel="noreferrer noopener">Managing Nagios Log Server Users </a></li>
</ul>



<ul class="wp-block-list">
<li><a href="https://assets.nagios.com/downloads/nagios-network-analyzer/docs/Managing-Users-in-NNA-2024.pdf" target="_blank" rel="noreferrer noopener">Managing Network Analyzer Users</a></li>
</ul>



<p>If you&#8217;d like to take any or all of the Nagios tools for a spin, you can find free trial download links here:</p>



<p><a href="https://www.nagios.com/products/" target="_blank" rel="noopener">Nagios Solutions</a> </p>



<p>Also feel free to contact us at <strong>sales@nagios.com</strong> if there are any questions we can assist you with, or if you&#8217;d like a custom Demo or Quickstart remote session to help you explore Nagios further.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Great Directions: Understand Architecture and Data Paths in Nagios Tools</title>
		<link>https://library.nagios.com/training/nagios-ecosystem-architecture/</link>
		
		<dc:creator><![CDATA[Shamas Demoret]]></dc:creator>
		<pubDate>Mon, 12 May 2025 15:47:00 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Architecture]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=55903</guid>

					<description><![CDATA[Nagios can monitor just about anything, and in a variety of ways and directions. Let's explore architecture and data flow across the Nagios ecosystem.  ]]></description>
										<content:encoded><![CDATA[
<p>Nagios solutions can monitor just about anything, and in a variety of ways and directions. There are also various methods available to combine results from multiple Nagios solutions and to architect your monitoring to suit large, geographically separated, and cloud infrastructures. Let&#8217;s explore architecture and the path data travels across the Nagios ecosystem.</p>



<h2 class="wp-block-heading">Nagios XI Check Architecture</h2>



<p>Nagios XI can monitor both actively and passively, using agent-based and agentless methods. The best approach will depend on the specifics of your environment and requirements. </p>



<h3 class="wp-block-heading">Agent-based vs. Agentless Checks</h3>



<p>With agent-based methods, a lightweight agent is installed on the monitored host, which enables Nagios to connect to it and run checks. Agents provide the flexibility to monitor a wider array of metrics than agentless methods, since they are not limited strictly to data made available by a native protocol and can incorporate custom plugins. However, agents slightly increase administrative overhead, since they need to be installed and updated. A smart agent like NCPA provides even more utility by enabling Nagios XI to scan your hosts for things like drives and running services/processes, and by providing powerful additional tools like a web UI and check API.</p>



<p>With agentless methods, a native protocol like SNMP is leveraged to run checks. Although, as stated above, an agentless method will be limited to the specific metrics the native protocol can produce, agentless methods don’t require direct updates outside of regular software and firmware updates. Native protocols may also enable you to scan your hosts for elements that can be monitored. For example, the Network Switch and Router wizard will scan your network device for interfaces.</p>



<h3 class="wp-block-heading">Active Checks</h3>



<p>Active checks in Nagios XI are scheduled and executed by the Nagios server, so communication is outbound from Nagios to the monitored host. Examples of active checks include:</p>



<ul class="wp-block-list">
<li>NCPA and NRPE agent checks.</li>



<li>SNMP polling (for example, checks configured using the Network Switch and Router wizard). </li>



<li>Checks created with the Network Analyzer or Log Server wizards.</li>



<li>Website checks (using the Website monitoring wizard).</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Active-Checks.drawio.png"><img loading="lazy" decoding="async" width="590" height="320" src="https://library.nagios.com/wp-content/uploads/2025/05/Active-Checks.drawio.png" alt="A diagram showing active check architecture, with arrows going from a Nagios XI server to various monitored hosts including servers, a printer, a router, and a database." class="wp-image-56277" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 25" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Active-Checks.drawio.png 590w, https://library.nagios.com/wp-content/uploads/2025/05/Active-Checks.drawio-300x163.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></a><figcaption class="wp-element-caption">Active checks start at Nagios XI, and head outbound to the monitored hosts. </figcaption></figure>



<p>Active checks tend to be easier to configure since they can often be set up using Nagios XI&#8217;s comprehensive suite of monitoring wizards but do require a direct inbound network path to your host.</p>



<h3 class="wp-block-heading">Passive Checks</h3>



<p>In a passive model, checks are initiated by the remote host and sent upstream to Nagios XI. </p>



<p>Examples of passive checks include:</p>



<ul class="wp-block-list">
<li>NCPA (which has both an active and passive capability) and NRDP agent checks.</li>



<li>SNMP Traps.</li>



<li>Nagios Network Analyzer and Nagios Log Server alerts configured in those tools (which use NRDP to send results upstream to Nagios XI). </li>
</ul>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Passive-Checks-XI.png"><img loading="lazy" decoding="async" width="610" height="325" src="https://library.nagios.com/wp-content/uploads/2025/05/Passive-Checks-XI.png" alt="A network diagram showing passive checks, with arrows starting at the monitored hosts and pointing at the Nagios XI server." class="wp-image-56312" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 26" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Passive-Checks-XI.png 610w, https://library.nagios.com/wp-content/uploads/2025/05/Passive-Checks-XI-300x160.png 300w" sizes="(max-width: 610px) 100vw, 610px" /></a><figcaption class="wp-element-caption">Passive checks are sent upstream to Nagios XI by the hosts. </figcaption></figure>



<p>Passive checks can be more challenging to initially configure but are useful in situations where inbound access to the monitored host network isn&#8217;t possible or desirable. Passive checks also reduce load on your Nagios XI server, enabling you to get more checks out of a single monitoring server.</p>



<h3 class="wp-block-heading">Event Handlers and Actions</h3>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Introduction-to-Event-Handlers-2024.pdf" target="_blank" rel="noreferrer noopener">Event handlers</a> are automated, scripted actions that Nagios XI can be configured to execute in response to detected state changes. <a href="https://library.nagios.com/techtips/take-action-leverage-custom-quick-actions-in-nagios-xi/" target="_blank" rel="noreferrer noopener">Actions</a> are manually executed using clickable icons in the UI. In both cases, Nagios executes the handler, and communication is outbound from Nagios to the target host. If the handler or action is designed to execute a script (for example, to restart a stopped service), this is often carried out by a local agent such as NCPA running on the remote host.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Handlers.drawio.png"><img loading="lazy" decoding="async" width="556" height="330" src="https://library.nagios.com/wp-content/uploads/2025/05/Handlers.drawio.png" alt="A diagram of event handler architecture, with a Nagios XI server at the top, and arrows pointing from it to a desktop and a ticketing server." class="wp-image-56280" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 27" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Handlers.drawio.png 556w, https://library.nagios.com/wp-content/uploads/2025/05/Handlers.drawio-300x178.png 300w" sizes="(max-width: 556px) 100vw, 556px" /></a><figcaption class="wp-element-caption">Make things happen with event handlers and Actions. </figcaption></figure>



<h2 class="wp-block-heading">Nagios Mod-Gearman</h2>



<p>Nagios Mod-Gearman (NMG) is a Nagios Event Broker (NEB) module that can be used for a variety of<br>purposes including load reduction, load balancing, and distributed monitoring.</p>



<p>Separate Linux servers running the NMG Worker module are assigned checks for the general host and<br>service queue, or specific hostgroups and servicegroups, which they execute locally, then forward the<br>results upstream to the NMG Server module running on the Nagios server. Worker communication and check result forwarding is inbound to the Nagios server from the workers, so inbound network access to the worker server from Nagios is not required for NMG itself to function.</p>



<p>Nagios XI 2024R2.1+ includes a <a href="https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Nagios-Mod-Gearman-in-the-Nagios-XI-UI.pdf" target="_blank" rel="noopener">Remote Workers</a> feature that enables the NMG Server module and workers to be managed right from the web UI. The ability to deploy, and sync workers from the XI UI does require inbound network access to the workers from the Nagios XI server via SSH on port 22. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="488" src="https://library.nagios.com/wp-content/uploads/2025/08/NMG-Arch.drawio-2-1024x488.png" alt="Diagram of a Nagios XI server and two Nagios Mod Gearman workers (one local, one remote), with arrows showing traffic direction of inbound to worker from XI on port 22 for worker deploy and sync, and inbound to the XI server on port 4730 for queue checking and result submission." class="wp-image-61355" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 28" srcset="https://library.nagios.com/wp-content/uploads/2025/08/NMG-Arch.drawio-2-1024x488.png 1024w, https://library.nagios.com/wp-content/uploads/2025/08/NMG-Arch.drawio-2-300x143.png 300w, https://library.nagios.com/wp-content/uploads/2025/08/NMG-Arch.drawio-2-768x366.png 768w, https://library.nagios.com/wp-content/uploads/2025/08/NMG-Arch.drawio-2.png 1531w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">NMG Workers can be both local and remote. </figcaption></figure>



<p>This article provides a detailed overview of NMG and links to key documentation: </p>



<p><a href="https://library.nagios.com/techtips/succeed-with-nagios-mod-gearman/">Gear Up with Nagios Mod-Gearman: Maximize and Distribute Checks Efficiently</a></p>



<h3 class="wp-block-heading">Nagios XI Application Architecture</h3>



<p>If you&#8217;d like to learn more about the components and architecture of the Nagios XI application itself, this document provides an in-depth overview and diagram:</p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Nagios-XI-Architecture-Overview.pdf" target="_blank" rel="noopener">Nagios XI Architecture Overview</a></p>



<h2 class="wp-block-heading">Network Analyzer</h2>



<p>Flow data from network devices and servers running flow clients travels upstream from the devices to <a href="https://library.nagios.com/solutions/network-analyzer-pro-with-the-flow/" target="_blank" rel="noreferrer noopener">Network Analyzer</a>, which acts as a collector and aggregator.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NNA.drawio.png"><img loading="lazy" decoding="async" width="524" height="341" src="https://library.nagios.com/wp-content/uploads/2025/05/NNA.drawio.png" alt="Diagram showing Nagios Network Analyzer receiving data from various network devices." class="wp-image-56325" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 29" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NNA.drawio.png 524w, https://library.nagios.com/wp-content/uploads/2025/05/NNA.drawio-300x195.png 300w" sizes="(max-width: 524px) 100vw, 524px" /></a><figcaption class="wp-element-caption">Flow data is sent upstream to Nagios Network Analyzer.</figcaption></figure>



<h2 class="wp-block-heading">Nagios Log Server</h2>



<p>Log data is sent upstream to <a href="https://library.nagios.com/nagios-updates/ready-to-rock-whats-new-in-log-server-2024r2/" target="_blank" rel="noreferrer noopener">Log Server</a> by the sources you are collecting from. Data is also passed back and forth between the cluster instances by Opensearch for clustered redundancy of your collected logs. One option is to send the data directly to individual Log Server instances.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB.drawio.png"><img loading="lazy" decoding="async" width="740" height="411" src="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB.drawio.png" alt="Diagram showing a 4 instance Nagios Log Server cluster with various hosts sending data upstream to individual instances." class="wp-image-56326" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 30" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB.drawio.png 740w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB.drawio-300x167.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><figcaption class="wp-element-caption">It is possible to send data directly to your Log Server instances. </figcaption></figure>



<p>This approach works well unless the instance breaks, in which case incoming log data will have nowhere to go and will queue on the sending source until the instance recovers. As long as you&#8217;re running a multi-instance cluster, previously collected logs will still be protected, but new results won&#8217;t be collected.</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB_onebroke.drawio.png"><img loading="lazy" decoding="async" width="760" height="431" src="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB_onebroke.drawio.png" alt="Diagram showing a 4 instance Nagios Log Server cluster with various hosts sending data upstream to individual instances. One instance is broken, covered by a red &#039;X&#039;. The sources are queuing the data since it has nowhere to go." class="wp-image-56360" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 31" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB_onebroke.drawio.png 760w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-noLB_onebroke.drawio-300x170.png 300w" sizes="(max-width: 760px) 100vw, 760px" /></a><figcaption class="wp-element-caption">Sending logs directly to Log Server works well, until it doesn&#8217;t.</figcaption></figure>



<p>A more resilient approach is to incorporate a load balancer or round robin DNS setup, so that incoming log events from the sources will always be routed to an available instance. </p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/05/NLS-wLB_onebroke.drawio.png"><img loading="lazy" decoding="async" width="761" height="561" src="https://library.nagios.com/wp-content/uploads/2025/05/NLS-wLB_onebroke.drawio.png" alt="Diagram showing a 4 instance Log Server cluster being fed data by a load balancer, with various network devices sending to the load balancer. One instance is broken, covered with a red &#039;X&#039;, but thanks the the load balancer all of the incoming logs have an instance to route to." class="wp-image-56361" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 32" srcset="https://library.nagios.com/wp-content/uploads/2025/05/NLS-wLB_onebroke.drawio.png 761w, https://library.nagios.com/wp-content/uploads/2025/05/NLS-wLB_onebroke.drawio-300x221.png 300w" sizes="(max-width: 761px) 100vw, 761px" /></a><figcaption class="wp-element-caption">Deploying a load balancer is time well spent. </figcaption></figure>



<h2 class="wp-block-heading">Nagios Fusion</h2>



<p><a href="https://library.nagios.com/solutions/nagios-fusion-comprehensive-vigilance/" target="_blank" rel="noreferrer noopener">Nagios Fusion</a> polls remote Nagios XI, Nagios Core, Nagios Log Server, and Nagios Network Analyzer servers via HTTP/HTTPS. Communication is initiated by an outbound connection from Fusion to your fused Nagios servers, but since standard web ports are used it&#8217;s often easier to get approval for this architecture from network security teams. </p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio.png"><img loading="lazy" decoding="async" width="1024" height="421" src="https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio-1024x421.png" alt="Diagram of Nagios Fusion architecture, showing Fusion server connecting to remote Nagios XI and Core servers via HTTP/HTTPS with blue arrows pointing at them" class="wp-image-56304" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 33" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio-1024x421.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio-300x123.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio-768x316.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio-1536x631.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/Fusion.drawio.png 1800w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Fusion connects to remote Nagios servers via HTTP(S). </figcaption></figure>



<h2 class="wp-block-heading">Federated Monitoring</h2>



<p>In a federated architecture, data is sent upstream from remote Nagios XI and Core servers to a centralized XI server. The <a href="https://assets.nagios.com/downloads/nagiosxi/docs/Configuring-Outbound-Checks-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">transmission </a>is handled by NRDP, so it is sent via HTTP/HTTPS just like regular NRDP passive checks.</p>



<p>The pro of this model is that it provides centralized reporting and notification management capabilities, and since the incoming results are passive, enables the centralized XI server to handle more total checks than if it were running the checks itself. However, Fusion is better suited to handle massive scale.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1.png"><img loading="lazy" decoding="async" width="1024" height="421" src="https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1-1024x421.png" alt="Diagram showing a Federated Nagios model, with remote XI and Core servers pointing data upstream to a centralized XI server." class="wp-image-56328" title="Great Directions: Understand Architecture and Data Paths in Nagios Tools 34" srcset="https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1-1024x421.png 1024w, https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1-300x123.png 300w, https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1-768x316.png 768w, https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1-1536x631.png 1536w, https://library.nagios.com/wp-content/uploads/2025/05/Federated.drawio1.png 1800w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">The Federated model. </figcaption></figure>



<p>You can find more details about the above distributed architecture options in this document:</p>



<p><a href="https://assets.nagios.com/downloads/general/docs/Monitoring_Architecture_Solutions_For_Large_Organizations.pdf" target="_blank" rel="noreferrer noopener">Nagios Monitoring Architecture Solutions For Large Organizations</a></p>



<p>Hopefully, the above overview has provided you with great directions to help you navigate the planning, execution, and cultivation of your Nagios deployment. Here are a few additional resources to help you succeed with Nagios:</p>



<p><a href="https://library.nagios.com/techtips/maximize-your-free-trial-of-nagios-xi/" target="_blank" rel="noreferrer noopener">How to Maximize Your Free Trial of Nagios XI</a></p>



<p><a href="https://library.nagios.com/solutions/nagios-xi-enterprise-edition-10-great-features/?search=" target="_blank" rel="noreferrer noopener">Nagios XI Enterprise Edition: 10 Great Features</a></p>



<p>Please feel free to email us at <strong>sales@nagios.com</strong> if there&#8217;s anything we can assist with! </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CCM Clarity: Unlock the Nagios XI Core Config Manager</title>
		<link>https://library.nagios.com/training/unlock-the-nagios-xi-ccm/</link>
		
		<dc:creator><![CDATA[Shamas Demoret]]></dc:creator>
		<pubDate>Thu, 01 May 2025 14:35:20 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Techtips]]></category>
		<category><![CDATA[CCM]]></category>
		<category><![CDATA[Configuration]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=55489</guid>

					<description><![CDATA[Capable as Nagios XI's monitoring wizards are, they're no match for the CCM when it comes to managing existing objects and advanced settings. Let's dig in! ]]></description>
										<content:encoded><![CDATA[
<p>Nagios XI&#8217;s comprehensive suite of Monitoring Wizards provides a simple, step-by-step approach to configure monitoring of a wide variety of common devices and applications. Wizards also have an additive property when run using the same host name as an existing host, which can be used to add new services and modify existing ones.</p>



<p>Capable as the wizards are, they&#8217;re no match for the Core Config Manager (CCM) when it comes to managing existing objects and advanced settings. In this article, we&#8217;ll dig into the CCM and explore how it works, what it does, and how it&#8217;s used.</p>



<h2 class="wp-block-heading">Accessing the CCM</h2>



<p>To get to the Core Config Manager, go to <strong>Configure &gt; Core Config Manager</strong>.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM.png"><img loading="lazy" decoding="async" width="1024" height="524" src="https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM-1024x524.png" alt="Screenshot of the Nagios XI Core Config Manager ( CCM ) main menu." class="wp-image-55497" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 35" srcset="https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM-1024x524.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM-300x154.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM-768x393.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM-1536x786.png 1536w, https://library.nagios.com/wp-content/uploads/2025/04/Accessing-CCM.png 1887w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Access the CCM via the Configure menu.</figcaption></figure>



<p>On the CCM main page, you&#8217;ll see an Object Summary of all the Core objects, a list of Recent Snapshots, and a left-hand menu full of options. Let&#8217;s explore some key functions and capabilities.</p>



<h2 class="wp-block-heading">Making Small Changes</h2>



<p>One of the most common tasks you&#8217;ll complete in the CCM is making granular changes to specific settings on your monitored hosts and services. We&#8217;ll cover a simple example here, and you can refer to the full guides for complete details:</p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Using-the-CCM-for-Services-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">Service management with the CCM </a></p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Using-The-Nagios-XI-Core-Config-Manager-For-Host-Management.pdf" target="_blank" rel="noopener">H</a><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Using-the-CCM-for-Hosts-in-Nagios-XI-2024.pdf" target="_blank" rel="noreferrer noopener">ost management with the CCM</a></p>



<p>If you wanted to make the check interval on a key service more aggressive, you&#8217;d simply click Services in the left-hand submenu, then do a quick search to locate your service:</p>



<figure class="wp-block-image size-large is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm.png"><img loading="lazy" decoding="async" width="1024" height="512" src="https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm-1024x512.png" alt="Screenshot of the nagios xi core config manager showing how to find a service." class="wp-image-55725" style="width:720px;height:auto" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 36" srcset="https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm-1024x512.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm-300x150.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm-768x384.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/to-a-service-nagios-xi-ccm.png 1155w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Locating objects is easy with the CCM search function. </figcaption></figure>



<p>Once you locate the service and click through, you&#8217;ll be brought to the Service Management section. Hit the Check Settings tab, update the Check Interval to your new setting, and click Save.</p>



<figure class="wp-block-image size-large is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm.png"><img loading="lazy" decoding="async" width="1024" height="540" src="https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm-1024x540.png" alt="Screenshot of the Service Management settings for a Memory Usage service on a CentOS 9 server in the Nagios XI CCM, with the Check Interval setting highlighted in the Check Settings tab." class="wp-image-55726" style="width:726px;height:auto" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 37" srcset="https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm-1024x540.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm-300x158.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm-768x405.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/change-check-interval-ccm.png 1157w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Changing the Check Interval in the CCM. </figcaption></figure>



<h2 class="wp-block-heading">Applying Your Config</h2>



<p>Once you&#8217;ve saved your change, you will be returned to the Services directory and will notice a banner at the top indicating you need to Apply Configuration:</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/04/changes-detected.png"><img loading="lazy" decoding="async" width="765" height="168" src="https://library.nagios.com/wp-content/uploads/2025/04/changes-detected.png" alt="Screenshot of the &#039;Changes Detected-Apply Configuration&#039; banner in the Nagios XI CCM after changing the check interval on a service." class="wp-image-55727" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 38" srcset="https://library.nagios.com/wp-content/uploads/2025/04/changes-detected.png 765w, https://library.nagios.com/wp-content/uploads/2025/04/changes-detected-300x66.png 300w" sizes="(max-width: 765px) 100vw, 765px" /></a><figcaption class="wp-element-caption">Until your new config is applied, the Nagios Core engine won&#8217;t know about it. </figcaption></figure>



<p>Changes made in the Nagios XI user interface need to be written to the underlying Nagios Core monitoring engine in order to take effect. Apply Configuration verifies that your configuration changes are valid, then updates the Core configs.</p>



<h2 class="wp-block-heading">Uh-oh&#8230; Something Went Wrong</h2>



<p>If you apply the config and an error is detected, you&#8217;ll see a screen like this:</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1.png"><img loading="lazy" decoding="async" width="1024" height="349" src="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1-1024x349.png" alt="Screenshot of the Nagios XI Core Config Manager showing an Apply Configuration failure page with the related error." class="wp-image-55757" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 39" srcset="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1-1024x349.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1-300x102.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1-768x261.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-1.png 1175w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Errors will be listed to help you remedy the problems. </figcaption></figure>



<p><strong>Don&#8217;t panic! </strong>Until you apply a working config, the Core engine will continue monitoring based on the last known good config, so your monitoring will continue uninterrupted.</p>



<p>In this example, we can see that our service is missing a service description. If we navigate to the Apache-Weblogger services, we can quickly spot the problem, which shows red &#8216;Not Applied&#8217; text in the Status column: </p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4.png"><img loading="lazy" decoding="async" width="1024" height="491" src="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4-1024x491.png" alt="Screenshot of the Services directory in the Nagios XI Core Config Manager, showing the services for an Apache webserver, with the service that has a config error showing red &#039;Not Applied&#039; text in the Status column." class="wp-image-55759" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 40" srcset="https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4-1024x491.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4-300x144.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4-768x368.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/apply-fail-4.png 1172w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">It&#8217;s easy to spot the problem service. </figcaption></figure>



<p>Simply update the settings (in this case by adding a Service Description) and Apply Configuration again to write the changes.</p>



<p>Also note that each time you Apply Configuration, a snapshot is taken. These can be viewed in the <strong>Quick Tools &gt; Configuration Snapshots</strong> section of the CCM. You can roll back to previous configurations anytime by clicking the circular arrow icon in the Actions column.</p>



<p>You can also review exactly what was changed by clicking the View diff button in the Diff Changes column for an entry:</p>



<figure class="wp-block-image size-full is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/04/view-diff-button.png"><img loading="lazy" decoding="async" width="812" height="382" src="https://library.nagios.com/wp-content/uploads/2025/04/view-diff-button.png" alt="Screenshot of Nagios XI&#039;s Configuration Snapshots menu with the View Diff button highlighted with a yellow square." class="wp-image-55821" style="width:682px;height:auto" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 41" srcset="https://library.nagios.com/wp-content/uploads/2025/04/view-diff-button.png 812w, https://library.nagios.com/wp-content/uploads/2025/04/view-diff-button-300x141.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/view-diff-button-768x361.png 768w" sizes="(max-width: 812px) 100vw, 812px" /></a><figcaption class="wp-element-caption">Click this to see details on all of the changes. </figcaption></figure>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/04/view-diff.png"><img loading="lazy" decoding="async" width="1024" height="319" src="https://library.nagios.com/wp-content/uploads/2025/04/view-diff-1024x319.png" alt="Screenshot of the View Diff section of Config Snapshots in the Nagios XI CCM showing changes made to the Warning threshold for memory usage on a Windows server." class="wp-image-55783" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 42" srcset="https://library.nagios.com/wp-content/uploads/2025/04/view-diff-1024x319.png 1024w, https://library.nagios.com/wp-content/uploads/2025/04/view-diff-300x93.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/view-diff-768x239.png 768w, https://library.nagios.com/wp-content/uploads/2025/04/view-diff.png 1260w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">See exactly what changed with the View Diff button. </figcaption></figure>



<h2 class="wp-block-heading">Managing Groups</h2>



<p>The CCM is also where you&#8217;ll manage your host groups and service groups, which enable you to quickly filter things like dashboards and reports to focus on specific subsets of your monitored assets and to carry out advanced approaches like <a href="https://library.nagios.com/training/intro-hostgroup-inheritance/" target="_blank" rel="noreferrer noopener">hostgroup inheritance</a>, whereby any host added to a group inherits various common services automatically. You can learn more about managing groups in this article:</p>



<p><a href="https://library.nagios.com/techtips/organize-host-service-groups-nagios-xi/" target="_blank" rel="noreferrer noopener">Master Host and Service Groups in Nagios XI</a></p>



<h2 class="wp-block-heading">Advanced Options</h2>



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



<p>Host and Service <a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/dependencies.html" target="_blank" rel="noopener">Dependencies</a> can be managed in the Advanced section of the CCM. You may already be familiar with parent/child relationships, which enable you to define host topology so that Nagios XI alerts you intelligently based on its ability to reach hosts. When a parent breaks, the child hosts and their services are marked as Unreachable rather than Critical, and you can customize whether and how Unreachable states alert.</p>



<p>Dependencies function in a similar way but aren&#8217;t meant to be dictated by topology alone. Any host or service can be made dependent on any other hosts or services you wish, providing a way to define advanced relationships based on the specifics of your environment. Note that, unlike Parent/Child relationships, dependencies don&#8217;t impact auto-generated topology diagrams like the <a href="https://library.nagios.com/solutions/the-power-of-nagios-xi-reports/#section-18" target="_blank" rel="noreferrer noopener">Hypermap</a> and Network Status Map.</p>



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



<p>Host and Service <a href="https://assets.nagios.com/downloads/nagiosxi/docs/Understanding-Notification-Escalations-in-Nagios-XI-2024.pdf" target="_blank" rel="noopener">Escalations</a> provide a way to customize notifications when problems persist for too long, for example, sending an email to a manager if a host is still down after three notifications are sent to admins. These can be managed in either the <strong>Alerting &gt; Host Escalations/Service Escalations</strong> section or via the handy <strong>Escalation Wizard</strong> in the Tools section of the CCM.</p>



<h3 class="wp-block-heading">Event Handlers</h3>



<p>Event handlers are automated actions you set XI to take when state changes occur. A simple example would be to execute a restart script on a host when Nagios detects that a key service is stopped, but ultimately, anything you can script can be done, so the possibilities are vast. This document provides full details and an example to try:</p>



<p><a href="https://assets.nagios.com/downloads/nagiosxi/docs/Understanding-Notification-Escalations-in-Nagios-XI-2024.pdf" target="_blank" rel="noopener">Introduction to Event Handlers in Nagios XI</a></p>



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



<p>These are the commands Nagios runs to do things like execute status checks, send notifications, and fire off event handlers. You&#8217;ll notice 160+ pre-loaded commands that XI uses to support the default monitoring wizards and alerting functions and can add your own as needed. This example shows the <code>check_xi_ncpa</code> command, which is run when Nagios executes a check on a host running the NCPA agent:</p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/04/commands.png"><img loading="lazy" decoding="async" width="958" height="770" src="https://library.nagios.com/wp-content/uploads/2025/04/commands.png" alt="Screenshot of the Command Management window for the check_xi_ncpa command in the Nagios XI CCM." class="wp-image-55834" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 43" srcset="https://library.nagios.com/wp-content/uploads/2025/04/commands.png 958w, https://library.nagios.com/wp-content/uploads/2025/04/commands-300x241.png 300w, https://library.nagios.com/wp-content/uploads/2025/04/commands-768x617.png 768w" sizes="(max-width: 958px) 100vw, 958px" /></a><figcaption class="wp-element-caption">The check_ncpa.py command. </figcaption></figure>



<h3 class="wp-block-heading">Import Config Files</h3>



<p>If you&#8217;re currently using Nagios Core and would like to import your config files into Nagios XI, you can learn more about the <a href="https://assets.nagios.com/downloads/nagiosxi/docs/Importing-Config-Files-from-2024.pdf" target="_blank" rel="noreferrer noopener">process</a>, the ready-made Import Prep Tool, and carry out the import in this section of the CCM.</p>



<h2 class="wp-block-heading">Making Big Changes</h2>



<p>The Bulk Modifications Tool has long been a favorite of <a href="https://library.nagios.com/solutions/nagios-xi-enterprise-edition-10-great-features/" target="_blank" rel="noreferrer noopener">Enterprise Edition</a> users, especially those with large and dynamic environments. The tool enables you to quickly modify a key setting on as many hosts or services as you’d like with a few clicks.</p>



<p>Bulk Renaming not only provides a way to rename many objects at once but, even better (unlike renaming one at a time in the Core Config Manager) ensures that your historical performance data is retained even after changing the name of an object.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://library.nagios.com/wp-content/uploads/2025/04/Bulk-Mod-Bulk-Rename.png"><img loading="lazy" decoding="async" width="821" height="843" src="https://library.nagios.com/wp-content/uploads/2025/04/Bulk-Mod-Bulk-Rename.png" alt="A screenshot of the Bulk Modifications tool in Nagios XI&#039;s Core Config Manager." class="wp-image-55008" style="width:684px;height:auto" title="CCM Clarity: Unlock the Nagios XI Core Config Manager 44" srcset="https://library.nagios.com/wp-content/uploads/2025/04/Bulk-Mod-Bulk-Rename.png 821w, https://library.nagios.com/wp-content/uploads/2025/04/Bulk-Mod-Bulk-Rename-292x300.png 292w, https://library.nagios.com/wp-content/uploads/2025/04/Bulk-Mod-Bulk-Rename-768x789.png 768w" sizes="(max-width: 821px) 100vw, 821px" /></a><figcaption class="wp-element-caption">The Bulk Modifications Tool in the Core Config Manager.</figcaption></figure>



<h2 class="wp-block-heading">Give it a Try </h2>



<p>As you can see, understanding and utilizing the CCM&#8217;s key capabilities is an important element of mastering XI administration.</p>



<p>If you&#8217;re not already using Nagios XI, the free trial version is a great way to experience the power of the Core Config Manager for yourself:</p>



<p><a href="https://www.nagios.com/products/nagios-xi/downloads/#downloads" target="_blank" rel="noreferrer noopener">Nagios XI Free Trial</a></p>



<p>If you have any questions or need a hand, you can reach us at <strong>sales@nagios.com</strong>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Intro To Hostgroup Inheritance</title>
		<link>https://library.nagios.com/training/intro-hostgroup-inheritance/</link>
		
		<dc:creator><![CDATA[Michael Bellerue]]></dc:creator>
		<pubDate>Tue, 29 Apr 2025 15:06:59 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Host Groups]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=55737</guid>

					<description><![CDATA[Nagios Hostgroup Inheritance Series — Part 1: Intro To Hostgroup Inheritance This article kicks off our Nagios Hostgroup Inheritance Series, where you will learn helpful tips and best practices for Hostgroup Inheritance. Hostgroup Inheritance: What Is It? Having worked in support and technical sales here at Nagios Enterprises, one of the requests I&#8217;ve regularly seen [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h6 class="wp-block-heading">Nagios Hostgroup Inheritance Series — Part 1: Intro To Hostgroup Inheritance</h6>



<p>This article kicks off our Nagios Hostgroup Inheritance Series, where you will learn helpful tips and best practices for Hostgroup Inheritance.</p>



<h2 class="wp-block-heading">Hostgroup Inheritance: What Is It?</h2>



<p>Having worked in support and technical sales here at Nagios Enterprises, one of the requests I&#8217;ve regularly seen is the ability to have a &#8220;template of services&#8221; that can be assigned to a host. I put &#8220;template of services&#8221; in quotes because I don&#8217;t want you to confuse them with Service Templates, which are already a thing in Nagios, but they are distinctly <em>not</em> what people are looking for.</p>



<p>Currently, we don&#8217;t have an Easy Button for this, but there is a process called Hostgroup Inheritance that effectively gives people that &#8220;template of services&#8221; option. Upfront, there is a good chunk of work to be done. But in large environments, it will save you a <em>ton</em> of time.</p>



<p>It should also be noted that for smaller environments, Nagios XI has the Bulk Host Cloning &amp; Import Wizard. This wizard can serve as a happy medium between running wizards against all of your hosts individually and implementing Hostgroup Inheritance.</p>



<p>The goal of this article series is to lay out the best features to use with Hostgroup Inheritance and how to set it up. I&#8217;ll be taking you through step by step, introducing each feature and the issue that it solves as we go.</p>



<p>In this article, I&#8217;m going to talk about configuration management and growing that configuration management, then I&#8217;ll be listing off all of the features we&#8217;ll be going over in the coming articles. In addition to all of that, I&#8217;ll lay out how to build a service check to use Hostgroup Inheritance from the ground up, followed by a shortcut that is specific to Nagios XI users.</p>



<p>There is a lot to cover, so let&#8217;s get started.</p>



<h2 class="wp-block-heading">Out-Of-The-Box Nagios XI Config Management</h2>



<p>The way that a person defines objects like hosts and services within Nagios Core (and by extension, Nagios XI) is through the use of plain text configuration files. There is no specific directory structure that you must use, which is somewhat of a double-edged sword. On the one hand, it offers maximum flexibility. On the other hand, I&#8217;ve seen countless systems where all hosts were defined in host.cfg, and all services were defined in services.cfg. Certainly, a valid way to do it. But that can get tricky when you try to implement it in larger environments.</p>



<p>The way Nagios XI manages configuration files is by using hosts and services directories. Each host has its host definition in the hosts directory. All of its services are defined in the services directory, in a file named after the hostname in the host definition.</p>



<p>So, in Nagios XI, when you look at a service definition in the Core Config Manager, you&#8217;ll see <code><em>Config Name</em></code> as the first setting. On the surface, this is a very safe and clean way to manage host and service configuration files. But there may be some issues of scaling when we look at larger environments.</p>



<h2 class="wp-block-heading">Making Config Management Scale</h2>



<p>The standard Nagios XI configuration management scheme does have plenty of upsides. However, I don&#8217;t feel like it scales very well. If you think about it, if you&#8217;re monitoring 100 servers, you&#8217;ve got 100 CPU service check definitions hanging out. Now, if you need to change the baseline for all 100 CPU service checks, you have to change 100 configuration entries.</p>



<p>Now that&#8217;s something that could be mitigated by the Bulk Modification Tools, Bulk Host Cloning &amp; Import, or even some handy scripting with the Nagios XI API. But what if we also added configuration standardization into the mix?</p>



<p>Let&#8217;s say you&#8217;ve got a thousand or more servers you need to monitor properly. And let&#8217;s also say that a good chunk of them run Microsoft SQL Server. Like a good SQL Server admin, you configured those systems to have a drive for the OS, a drive for the data, and a drive for the transaction logs. Your other Windows servers only have a single drive. But these have three.</p>



<p>Do you want to remember to add monitoring for the two additional drives? Or do you want to assign a handy template to the host, a template with the name of the software the host is running, and have all of the appropriate service checks just show up? One of these sounds a heck of a lot better to me.</p>



<h3 class="wp-block-heading">Why Doesn&#8217;t Nagios XI Just Do This?</h3>



<p>Hostgroup Inheritance takes more than a little bit of setup. I&#8217;ve got dreams and aspirations of making a configuration wizard to help streamline the setup of Hostgroup Inheritance, but for right now, it does require a certain amount of thought, planning, and execution. More so than just standing up Nagios XI and running wizards against everything you need to monitor.</p>



<p>Thus, for many of our smaller customers, Hostgroup Inheritance isn&#8217;t worth the price of entry. Now, Nagios has always been about customization and fitting into as many environments as possible. To that end, I do want to see Hostgroup Inheritance made easier, making that price of entry come down, and making it available to more of our customers who fall somewhere between small and large environments.</p>



<h2 class="wp-block-heading">Features You Need To Know</h2>



<p>This article is already getting long. So, I&#8217;m going to lay out some additional reading that will help you in your Hostgroup Inheritance journey. I&#8217;ll cover the need-to-know in future articles related to Hostgroup Inheritance. But if you&#8217;re interested in the nitty-gritty, you might get a kick out of the features below.</p>



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



<p>Well, we&#8217;re working with Hostgroup Inheritance. So, it&#8217;s best to know about hostgroups.<br><a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectdefinitions.html#hostgroup" target="_blank" rel="noreferrer noopener">https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectdefinitions.html#hostgroup</a></p>



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



<p>The second word in Hostgroup Inheritance, is worth knowing about.<br><a href="https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectinheritance.html" target="_blank" rel="noreferrer noopener">https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectinheritance.html</a></p>



<h3 class="wp-block-heading">Host Templates</h3>



<p>Host Templates will be key in our configuration of Hostgroup Inheritance.<br><a href="https://support.nagios.com/kb/article/managing-host-templates-906.html" target="_blank" rel="noreferrer noopener">https://support.nagios.com/kb/article/managing-host-templates-906.html</a></p>



<h3 class="wp-block-heading">Custom Variables</h3>



<p>Custom Variables will also be extremely important later in this series.<br><a href="https://library.nagios.com/techtips/custom-variables-in-nagios-xi/" target="_blank" rel="noreferrer noopener">https://library.nagios.com/techtips/custom-variables-in-nagios-xi/</a></p>



<p>Stay tuned for Part 2 in the next article of the Nagios Hostgroup Inheritance Series!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Master Using the Nagios XI API</title>
		<link>https://library.nagios.com/training/using-the-nagios-xi-api/</link>
		
		<dc:creator><![CDATA[Louie Mattia]]></dc:creator>
		<pubDate>Wed, 02 Apr 2025 19:49:22 +0000</pubDate>
				<category><![CDATA[Training]]></category>
		<category><![CDATA[API]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=49234</guid>

					<description><![CDATA[The built-in Nagios XI API (Application Programming Interface) provides access to a wide range of data, including hosts, services, users, and more. There are times when you may need to interact with the API. To do that you need to learn how to access the API as well as what it contains. What is Contained [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>The built-in Nagios XI API (Application Programming Interface) provides access to a wide range of data, including hosts, services, users, and more. There are times when you may need to interact with the API. To do that you need to learn how to access the API as well as what it contains.</p>



<h2 class="wp-block-heading">What is Contained in the API</h2>



<p>The Nagios XI API is divided into three core sections: Objects, Config, and System. Each section serves a distinct purpose, making the API highly flexible and powerful.</p>



<p><strong>Objects</strong>: This section is read-only and provides detailed information about various elements within Nagios XI. It allows users to query important resources, such as hosts, services, and other objects, providing insight into their current states and configurations. The data retrieved from this section can be delivered in either XML or JSON formats, making it easy to integrate and process within other applications or systems.</p>



<p><strong>Config</strong>: The Config section is designed for administrative tasks, giving administrators the ability to add, remove, and modify objects such as hosts, services, and other configurations within Nagios XI. This section works directly with the Core Config Manager, allowing the creation and deletion of items. It provides a more dynamic role within the API, as it enables direct management and updates of system configurations to meet specific needs or changes in the infrastructure.</p>



<p><strong>System</strong>: Like the Config section, the System section is reserved for administrators and provides the ability to manage the core subsystems of Nagios XI. It allows admins to execute system-level commands, configure system settings, and perform administrative tasks that impact the overall functionality and health of the Nagios XI environment.</p>



<h3 class="wp-block-heading">Types of API Requests</h3>



<p>When interacting with the Nagios XI API, you&#8217;ll primarily use four types of HTTP requests to interact with the system: <strong>GET</strong>, <strong>POST</strong>, <strong>PUT</strong>, and <strong>DELETE</strong>. Each request type serves a different purpose, allowing you to retrieve, create, update, or delete data.</p>



<ol class="wp-block-list">
<li><strong>GET</strong> – <strong>Retrieve Data</strong><br>The <strong>GET</strong> request is used to retrieve information from the Nagios XI API. It is typically used to query data such as host status, service status, or configuration details. This is a read-only operation and does not modify any data within the system. For example, you might use a GET request to check the current status of a host or service.<br><strong>Example</strong>: Retrieve host status or service details.</li>



<li><strong>POST</strong> – <strong>Create or Submit Data</strong><br>The <strong>POST</strong> request is used to send data to the server, typically to create new resources or submit information. For example, when adding a new host or service to Nagios XI, you’ll use a POST request to submit the necessary configuration data. It is used when creating new objects or triggering actions that modify the state of the system.<br><strong>Example</strong>: Add a new host, service, or update configuration.</li>



<li><strong>PUT</strong> – <strong>Update Data</strong><br>The <strong>PUT</strong> request is used to update or modify an existing resource. It’s typically used when you want to change the configuration of a current host, service, or other object in Nagios XI. Unlike POST, which creates new resources, PUT is meant for updating existing ones.<br><strong>Example</strong>: Update the configuration of an existing host or service.</li>



<li><strong>DELETE</strong> – <strong>Remove Data</strong><br>The <strong>DELETE</strong> request is used to remove a resource from the Nagios XI system. It’s used when you want to delete objects such as hosts, services, or configurations. Deleting data through the API is a permanent operation, so it&#8217;s important to be sure before making this type of request.<br><strong>Example</strong>: Remove a host or service from the system.</li>
</ol>



<h2 class="wp-block-heading">How to Access the API via URL</h2>



<p>The Nagios XI API can be accessed in a similar way to how you interact with Nagios XI itself—using a web browser. However, it&#8217;s important to note that this method is limited to <strong>GET </strong>requests, which allow you to retrieve and view data from the system. For tasks like creating, updating, or deleting resources (such as adding hosts or modifying configurations), you’ll need to use a different approach, typically by making <strong>POST</strong>, <strong>PUT</strong>, or <strong>DELETE</strong> requests through code. To get started, simply enter the following URL in your browser:</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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>http://&lt;Your Nagios XI IP>/nagiosxi/api/v1/</textarea><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">http://&lt;Your Nagios XI IP&gt;/nagiosxi/api/v1/</span></span></code></pre></div>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921.png"><img loading="lazy" decoding="async" width="1024" height="430" src="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921-1024x430.png" alt="Screenshot 2025 02 24 095921" class="wp-image-49530" title="Master Using the Nagios XI API 45" srcset="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921-1024x430.png 1024w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921-300x126.png 300w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921-768x322.png 768w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-095921.png 1465w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">API Error</figcaption></figure>



<p>At this point, you’ll see an error message—this is expected since no requests have been made yet. To retrieve data, you need to specify the section of the API you want to query and the resource you&#8217;re interested in. The URL should look like this:</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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>http://&lt;Your Nagios XI IP>/nagiosxi/api/v1/&lt;section>/&lt;resource></textarea><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">http://&lt;Your Nagios XI IP&gt;/nagiosxi/api/v1/&lt;section&gt;/&lt;resource&gt;</span></span></code></pre></div>



<p>The section refers to a main area of the API, like <code>objects</code>, <code>config</code>, or <code>system</code>, each offering access to different data or functions. For example, the <code>objects</code> section retrieves information about items like hosts and services, while the <code>config</code> section allows administrators to manage those objects. A resource is a specific data type or object within that section that you query or manipulate. In the <code>objects</code> section, a resource might be <code>hoststatus</code>, showing the current status of hosts, while in the <code>config</code> section, a resource could be service, used to manage service configurations.</p>



<p>To access the API, you&#8217;ll also need to include your API key in the URL. This key grants you access to the system and helps determine the permissions you have based on your user role. Depending on your level of access, different sections and resources may be available to you. </p>



<p>To find your API key, navigate to the admin section of Nagios XI. Once you have it, append it to the URL like this:</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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>http://&lt;Your Nagios XI IP>/nagiosxi/api/v1/&lt;section>/&lt;resource>?apikey=&lt;API key></textarea><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">http://&lt;Your Nagios XI IP&gt;/nagiosxi/api/v1/&lt;section&gt;/&lt;resource&gt;?apikey=&lt;API key&gt;</span></span></code></pre></div>



<p>With everything set up correctly, you should now see real data returned from the API. We’ll use the results from querying hoststatus objects as an example.</p>



<figure class="wp-block-image size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341.png"><img loading="lazy" decoding="async" width="1024" height="292" src="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341-1024x292.png" alt="API Query Results" class="wp-image-49560" title="Master Using the Nagios XI API 46" srcset="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341-1024x292.png 1024w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341-300x85.png 300w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341-768x219.png 768w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341-1536x438.png 1536w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-115341.png 1902w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Object Host Status Query Results</figcaption></figure>



<p>By default, the output can appear a bit messy. To improve readability, you can check the Pretty-print checkbox in the UI, which automatically organizes the response. Alternatively, append <code>&amp;pretty=1</code> to the end of the URL for instant formatting. This makes the output clean, organized, and easy to digest. </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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>http://&lt;Your Nagios XI IP>/nagiosxi/api/v1/objects/hoststatus?apikey=&lt;API key>&amp;pretty=1</textarea><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">http://&lt;Your Nagios XI IP&gt;/nagiosxi/api/v1/objects/hoststatus?apikey=&lt;API key&gt;&amp;pretty=1</span></span></code></pre></div>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-120446.png"><img loading="lazy" decoding="async" width="710" height="931" src="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-120446.png" alt="API Query results( Clean)" class="wp-image-49562" title="Master Using the Nagios XI API 47" srcset="https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-120446.png 710w, https://library.nagios.com/wp-content/uploads/2025/02/Screenshot-2025-02-24-120446-229x300.png 229w" sizes="(max-width: 710px) 100vw, 710px" /></a><figcaption class="wp-element-caption">Object Host Status Query Results Cleaned</figcaption></figure>



<p>Objects are for displaying information, while Config and System are used for adding, removing, or modifying objects. What you write will depend on the action you want to perform with the API. For tasks like editing or modifying data, you’ll need to use code, as this involves making requests that modify the system.</p>



<h2 class="wp-block-heading">Using with Code</h2>



<p>There are many reasons why you might want to access the Nagios XI API programmatically. For instance, you may want to fetch the data posted to the system, monitor host/service statuses, or edit configurations directly through your code. Interacting with the API via code provides flexibility and automation, streamlining your workflow.</p>



<p>To access the API, we can use the appropriate method for interacting with URLs in the programming language you&#8217;re working with. Since Nagios XI runs on a web-based interface, the most common language for writing programs inside Nagios XI itself is PHP.</p>



<p>Below is an example of how to access and interact with the Nagios XI API using PHP:</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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>&lt;?php
// Define the server IP and API token
$server_ip = &#8216;&lt;Your Nagios XI IP>&#8217;;  // Replace with your Nagios XI IP
$api_token = &#8216;&lt;Your API Key>&#8217;;  // Replace with your Nagios XI API key
// Build the URL for the API request
$url = &#8220;http://$server_ip/nagiosxi/api/v1/&lt;section>/&lt;resource>?apikey=$api_token&amp;pretty=1&#8221;;
// Initialize cURL session
$ch = curl_init();
// Set the URL for the request
curl_setopt($ch, CURLOPT_URL, $url);
// Set option to return the response as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the request and store the response
$response = curl_exec($ch);
// Check if the request was successful
if ($response === false) {
    echo &#8220;Error: &#8221; . curl_error($ch);  // Handle errors if the request fails
} else {
    // Decode the JSON response
    $data = json_decode($response, true);
    
    // Output the response (for testing or processing)
    echo &#8220;&lt;pre>&#8221;;
    print_r($data);  // Print the data in a readable format
    echo &#8220;&lt;/pre>&#8221;;
}
// Close the cURL session
curl_close($ch);
?>
</textarea><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;?php</span></span>
<span class="line"><span style="color: #6A9955">// Define the server IP and API token</span></span>
<span class="line"><span style="color: #9CDCFE">$server_ip</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&#39;&lt;Your Nagios XI IP&gt;&#39;</span><span style="color: #D4D4D4">;  </span><span style="color: #6A9955">// Replace with your Nagios XI IP</span></span>
<span class="line"><span style="color: #9CDCFE">$api_token</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&#39;&lt;Your API Key&gt;&#39;</span><span style="color: #D4D4D4">;  </span><span style="color: #6A9955">// Replace with your Nagios XI API key</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Build the URL for the API request</span></span>
<span class="line"><span style="color: #9CDCFE">$url</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;http://</span><span style="color: #9CDCFE">$server_ip</span><span style="color: #CE9178">/nagiosxi/api/v1/&lt;section&gt;/&lt;resource&gt;?apikey=</span><span style="color: #9CDCFE">$api_token</span><span style="color: #CE9178">&amp;pretty=1&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Initialize cURL session</span></span>
<span class="line"><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">curl_init</span><span style="color: #D4D4D4">();</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Set the URL for the request</span></span>
<span class="line"><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_URL, </span><span style="color: #9CDCFE">$url</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Set option to return the response as a string</span></span>
<span class="line"><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_RETURNTRANSFER, </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Execute the request and store the response</span></span>
<span class="line"><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">curl_exec</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Check if the request was successful</span></span>
<span class="line"><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (</span><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4"> === </span><span style="color: #569CD6">false</span><span style="color: #D4D4D4">) {</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">echo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;Error: &quot;</span><span style="color: #D4D4D4"> </span><span style="color: #D4D4D4">.</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">curl_error</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);  </span><span style="color: #6A9955">// Handle errors if the request fails</span></span>
<span class="line"><span style="color: #D4D4D4">} </span><span style="color: #C586C0">else</span><span style="color: #D4D4D4"> {</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Decode the JSON response</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$data</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">json_decode</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4">, </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Output the response (for testing or processing)</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">echo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;&lt;pre&gt;&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">print_r</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$data</span><span style="color: #D4D4D4">);  </span><span style="color: #6A9955">// Print the data in a readable format</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">echo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;&lt;/pre&gt;&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">// Close the cURL session</span></span>
<span class="line"><span style="color: #DCDCAA">curl_close</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">?&gt;</span></span>
<span class="line"></span></code></pre></div>



<p>This code example demonstrates how to send a request to the API, process the response, and display the data in a readable format. It&#8217;s a simple and efficient way to automate interactions with Nagios XI.</p>



<p>When interacting with the Nagios XI API to modify data, such as adding a new host, the process differs significantly from simply retrieving information. Instead of making a <strong>GET</strong> request, we’ll use a <strong>POST</strong> request, which allows us to send data to the server to create or modify resources. The <code>Config</code> section of the API is used for this purpose, as it enables administrators to make changes to the Nagios XI configuration.</p>



<p>Here’s an example of how you can easily add a host to your Nagios XI setup using the API and PHP. This example walks you through how to structure the API request, send the necessary data, and handle the response. By automating the process like this, you can quickly add hosts to your Nagios XI environment, saving time and reducing the need for manual configuration.</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"><textarea class="code-block-pro-copy-button-textarea" aria-hidden="true" readonly>function add_host_via_api($api_token)
{
    // Example: Prepare the POST data
    $data = [
        &#8216;host_name&#8217;                => &#8216;testapihost&#8217;,
        &#8216;address&#8217;                  => &#8216;127.0.0.1&#8217;,
        &#8216;check_command&#8217;            => &#8216;check_ping!3000,80%!5000,100%&#8217;,
        &#8216;max_check_attempts&#8217;       => 2,
        &#8216;check_period&#8217;             => &#8217;24&#215;7&#8242;,
        &#8216;contacts&#8217;                 => &#8216;nagiosadmin&#8217;,
        &#8216;notification_interval&#8217;    => 5,
        &#8216;notification_period&#8217;      => &#8217;24&#215;7&#8242;,
        &#8216;applyconfig&#8217;              => 1
    ];
    // Set up the POST fields
    $post_fields = http_build_query($data);
    // Get the Nagios server IP address
    $server_ip = get_nagios_server_ip();
    // Prepare the URL for the API call
    $url = &#8220;http://$server_ip/nagiosxi/api/v1/config/host?apikey=$api_token&#8221;;
    // Use cURL to send the POST request
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
    // Execute the cURL request and get the response
    $response = curl_exec($ch);
    // Check for errors in the cURL request
    if ($response === false) {
        return curl_error($ch);
    }
    // Close the cURL handle
    curl_close($ch);
    // Decode the response (optional)
    $response_data = json_decode($response, true);
    
    // Check for success or failure in response
    if (isset($response_data[&#8216;error&#8217;])) {
        return &#8220;API Error: &#8221; . $response_data[&#8216;error&#8217;];
    }
    return true;  // Return true if the host was added successfully
}</textarea><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: #569CD6">function</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">add_host_via_api</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$api_token</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Example: Prepare the POST data</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$data</span><span style="color: #D4D4D4"> = [</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;host_name&#39;</span><span style="color: #D4D4D4">                =&gt; </span><span style="color: #CE9178">&#39;testapihost&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;address&#39;</span><span style="color: #D4D4D4">                  =&gt; </span><span style="color: #CE9178">&#39;127.0.0.1&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;check_command&#39;</span><span style="color: #D4D4D4">            =&gt; </span><span style="color: #CE9178">&#39;check_ping!3000,80%!5000,100%&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;max_check_attempts&#39;</span><span style="color: #D4D4D4">       =&gt; </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;check_period&#39;</span><span style="color: #D4D4D4">             =&gt; </span><span style="color: #CE9178">&#39;24x7&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;contacts&#39;</span><span style="color: #D4D4D4">                 =&gt; </span><span style="color: #CE9178">&#39;nagiosadmin&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;notification_interval&#39;</span><span style="color: #D4D4D4">    =&gt; </span><span style="color: #B5CEA8">5</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;notification_period&#39;</span><span style="color: #D4D4D4">      =&gt; </span><span style="color: #CE9178">&#39;24x7&#39;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&#39;applyconfig&#39;</span><span style="color: #D4D4D4">              =&gt; </span><span style="color: #B5CEA8">1</span></span>
<span class="line"><span style="color: #D4D4D4">    ];</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Set up the POST fields</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$post_fields</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">http_build_query</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$data</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Get the Nagios server IP address</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$server_ip</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">get_nagios_server_ip</span><span style="color: #D4D4D4">();</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Prepare the URL for the API call</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$url</span><span style="color: #D4D4D4"> = </span><span style="color: #CE9178">&quot;http://</span><span style="color: #9CDCFE">$server_ip</span><span style="color: #CE9178">/nagiosxi/api/v1/config/host?apikey=</span><span style="color: #9CDCFE">$api_token</span><span style="color: #CE9178">&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Use cURL to send the POST request</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">curl_init</span><span style="color: #D4D4D4">();</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_URL, </span><span style="color: #9CDCFE">$url</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_RETURNTRANSFER, </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_POST, </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">curl_setopt</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">, CURLOPT_POSTFIELDS, </span><span style="color: #9CDCFE">$post_fields</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Execute the cURL request and get the response</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">curl_exec</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Check for errors in the cURL request</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (</span><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4"> === </span><span style="color: #569CD6">false</span><span style="color: #D4D4D4">) {</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">curl_error</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Close the cURL handle</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">curl_close</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$ch</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Decode the response (optional)</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">$response_data</span><span style="color: #D4D4D4"> = </span><span style="color: #DCDCAA">json_decode</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$response</span><span style="color: #D4D4D4">, </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">    </span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">// Check for success or failure in response</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (</span><span style="color: #DCDCAA">isset</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">$response_data</span><span style="color: #D4D4D4">[</span><span style="color: #CE9178">&#39;error&#39;</span><span style="color: #D4D4D4">])) {</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;API Error: &quot;</span><span style="color: #D4D4D4"> </span><span style="color: #D4D4D4">.</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$response_data</span><span style="color: #D4D4D4">[</span><span style="color: #CE9178">&#39;error&#39;</span><span style="color: #D4D4D4">];</span></span>
<span class="line"><span style="color: #D4D4D4">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">;  </span><span style="color: #6A9955">// Return true if the host was added successfully</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p>Once the request is made, the response will let you know if the host was added successfully or if there were any issues. We’ve included error handling to catch potential problems, such as network errors or invalid parameters. If everything goes as planned, the function will return <code>true</code>, confirming the host was added with no issues.</p>



<p>This example highlights how modifying your Nagios XI configuration through the API is quite different from just retrieving data. With <strong>POST</strong> requests, you gain the ability to create, update, and delete resources, giving you full control over your Nagios XI instance.</p>



<p>The other types of calls that can be made are <strong>PUT </strong>requests which are used to edit existing data in the API and <strong>DELETE </strong>requests, which deletes aspects of the API. We are going to finish with a look at a <strong>DELETE </strong>request to the API.</p>



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



<p>The Nagios XI API is a powerful tool for managing your Nagios XI instance, offering programmatic access to key data and configuration management capabilities. By following the steps outlined here, you can quickly integrate the API into your processes, improving your workflow. Whether you&#8217;re querying status data, managing configurations, or integrating with other systems, the Nagios XI API gives you the flexibility to enhance your Nagios XI experience.</p>



<p>For additional assistance, be sure to check the Nagios XI help section for more in-depth resources and support regarding the API. </p>



<figure class="wp-block-image size-full"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-04-02-111353marked.png"><img loading="lazy" decoding="async" width="278" height="482" src="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-04-02-111353marked.png" alt="API help location " class="wp-image-54096" title="Master Using the Nagios XI API 48" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-04-02-111353marked.png 278w, https://library.nagios.com/wp-content/uploads/2025/03/Screenshot-2025-04-02-111353marked-173x300.png 173w" sizes="(max-width: 278px) 100vw, 278px" /></a><figcaption class="wp-element-caption">Where the API docs are located</figcaption></figure>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Send Logs from Kali Linux to Nagios Log Server</title>
		<link>https://library.nagios.com/tutorials/send-logs-kali-linux-nagios-ls/</link>
		
		<dc:creator><![CDATA[Steven Phan]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 21:57:18 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Kali Linux]]></category>
		<category><![CDATA[Nagios Log Server]]></category>
		<guid isPermaLink="false">https://library.nagios.com/?p=53709</guid>

					<description><![CDATA[Sending logs from a Kali Linux system to Nagios Log Server involves configuring your Kali system to forward its logs to the NLS instance. This process ensures that all relevant log data from your Kali Linux system is collected, monitored, and analyzed by the Nagios Log Server, providing comprehensive insights into system activities and potential [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Sending logs from a Kali Linux system to Nagios Log Server involves configuring your Kali system to forward its logs to the NLS instance. This process ensures that all relevant log data from your Kali Linux system is collected, monitored, and analyzed by the Nagios Log Server, providing comprehensive insights into system activities and potential security events. Here is a detailed breakdown of how to send logs from Kali Linux to Nagios Log Server.</p>



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



<p>Here is what you need before you begin:</p>



<ul class="wp-block-list">
<li>A system running Kali Linux</li>



<li>Nagios Log Server instance to access the web interface</li>



<li>Root or sudo access for advanced operations</li>



<li>Internet access to download packages</li>
</ul>



<h3 class="wp-block-heading">Step 1: Install Rsyslog</h3>



<p>Open the terminal and update your packages, and then install rsyslog, which is typically used for log management.</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" data-code="sudo apt update
sudo apt install rsyslog" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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: #9CDCFE">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">apt</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">update</span></span>
<span class="line"><span style="color: #9CDCFE">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">apt</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">install</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">rsyslog</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 2: Configure the Rsyslog File</h3>



<p>Configure rsyslog by editing the rsyslog configuration file in <strong>/etc/rsyslog.conf</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" data-code="sudo nano /etc/rsyslog.conf" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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: #9CDCFE">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">nano</span><span style="color: #D4D4D4"> /</span><span style="color: #9CDCFE">etc</span><span style="color: #D4D4D4">/</span><span style="color: #9CDCFE">rsyslog</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">conf</span></span></code></pre></div>



<p>Add the following lines to the end of the file; switch <strong>nagios_log_server_ip</strong> with the IP address of your Nagios Log Server.</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" data-code="*.* @nagios_log_server_ip:5544" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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">*.* @</span><span style="color: #9CDCFE">nagios_log_server_ip</span><span style="color: #D4D4D4">:</span><span style="color: #B5CEA8">5544</span></span></code></pre></div>



<p>Save your file and restart rsyslog.</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" data-code="sudo systemctl restart rsyslog" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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: #9CDCFE">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">systemctl</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">restart</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">rsyslog</span></span></code></pre></div>



<h3 class="wp-block-heading">Step 3. Add a New Log Source in Nagios Log Server</h3>



<p>Boot up a browser and login to your Nagios Log Server web interface.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali.png"><img loading="lazy" decoding="async" width="1024" height="618" src="https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali-1024x618.png" alt="Nagios LS Login Kali" class="wp-image-53767" title="How to Send Logs from Kali Linux to Nagios Log Server 49" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali-1024x618.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali-300x181.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali-768x464.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali-1536x927.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Nagios-LS-Login-Kali.png 1718w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Nagios Log Server Login</figcaption></figure>



<p>From the homepage, click <strong>+ Linux</strong>&nbsp;to configure your logs.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali.png"><img loading="lazy" decoding="async" width="1024" height="618" src="https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali-1024x618.png" alt="Homepage LS Kali" class="wp-image-53770" title="How to Send Logs from Kali Linux to Nagios Log Server 50" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali-1024x618.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali-300x181.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali-768x464.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali-1536x927.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Homepage-LS-Kali.png 1716w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Log Server Homepage</figcaption></figure>



<p>On the Linux configuration page, Nagios Log Server provides a setup script to configure rsyslog from the box below.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali.png"><img loading="lazy" decoding="async" width="1024" height="620" src="https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali-1024x620.png" alt="Linux Configure LS Kali" class="wp-image-53771" title="How to Send Logs from Kali Linux to Nagios Log Server 51" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali-1024x620.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali-300x182.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali-768x465.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali-1536x930.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Linux-Configure-LS-Kali.png 1718w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Linux Configuration</figcaption></figure>



<p>Run the setup using&nbsp;<code>curl</code> and execute the downloaded script to configure rsyslog. Change <strong>&lt;your-nagios-log-server-address&gt;</strong> to your IP address of your Nagios Log Server.</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" data-code="curl -sS -O http://&lt;your-nagios-log-server-address&gt;/nagioslogserver/scripts/setup-linux.sh" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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: #9CDCFE">curl</span><span style="color: #D4D4D4"> -</span><span style="color: #9CDCFE">sS</span><span style="color: #D4D4D4"> -</span><span style="color: #4FC1FF">O</span><span style="color: #D4D4D4"> </span><span style="color: #C8C8C8">http</span><span style="color: #D4D4D4">:</span><span style="color: #6A9955">//&lt;your-nagios-log-server-address&gt;/nagioslogserver/scripts/setup-linux.sh</span></span></code></pre></div>



<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" data-code="sudo bash setup-linux.sh -s &lt;your-nagios-log-server-address&gt; -p 5544" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><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: #9CDCFE">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">bash</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">setup</span><span style="color: #D4D4D4">-</span><span style="color: #9CDCFE">linux</span><span style="color: #D4D4D4">.</span><span style="color: #9CDCFE">sh</span><span style="color: #D4D4D4"> -</span><span style="color: #9CDCFE">s</span><span style="color: #D4D4D4"> &lt;</span><span style="color: #9CDCFE">your</span><span style="color: #D4D4D4">-</span><span style="color: #9CDCFE">nagios</span><span style="color: #D4D4D4">-</span><span style="color: #9CDCFE">log</span><span style="color: #D4D4D4">-</span><span style="color: #9CDCFE">server</span><span style="color: #D4D4D4">-</span><span style="color: #9CDCFE">address</span><span style="color: #D4D4D4">&gt; -</span><span style="color: #9CDCFE">p</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">5544</span></span></code></pre></div>



<p>Put your Kali Linux IP address and check if the logs are being sent to the Nagios Log Server.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali.png"><img loading="lazy" decoding="async" width="1024" height="168" src="https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali-1024x168.png" alt="Verified Logs LS Kali" class="wp-image-53772" title="How to Send Logs from Kali Linux to Nagios Log Server 52" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali-1024x168.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali-300x49.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali-768x126.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Verified-Logs-LS-Kali.png 1049w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Verified Incoming Logs</figcaption></figure>



<h3 class="wp-block-heading">Step 4: Verify the Logs from the Dashboard</h3>



<p>Navigate to the Nagios Log Server dashboard by clicking the four squares icon. Verify that logs from your Kali Linux machine are being received by running a query for its IP address.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1.png"><img loading="lazy" decoding="async" width="1024" height="619" src="https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1-1024x619.png" alt="Dashboard LS Kali 1" class="wp-image-53815" title="How to Send Logs from Kali Linux to Nagios Log Server 53" srcset="https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1-1024x619.png 1024w, https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1-300x181.png 300w, https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1-768x464.png 768w, https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1-1536x928.png 1536w, https://library.nagios.com/wp-content/uploads/2025/03/Dashboard-LS-Kali-1.png 1718w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Log Server Dashboard</figcaption></figure>



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



<p>By following these steps, you can efficiently send logs from Kali Linux to Nagios Log Server, centralizing your log data for easier monitoring and analysis. This setup helps you track system events, troubleshoot issues, and maintain a secure network environment. If you have additional questions or other support-related questions, please visit us at our <a href="https://support.nagios.com/forum/" data-type="link" data-id="https://support.nagios.com/forum/" target="_blank" rel="noopener">Nagios Support Forum</a>, <a href="https://support.nagios.com/kb/" data-type="link" data-id="https://support.nagios.com/kb/" target="_blank" rel="noopener">Nagios Knowledge Base</a>, or <a href="https://library.nagios.com/" target="_blank" data-type="link" data-id="https://library.nagios.com/" rel="noreferrer noopener">Nagios Library</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
