{"id":4030,"date":"2024-01-03T14:15:01","date_gmt":"2024-01-03T14:15:01","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4030"},"modified":"2024-01-03T14:15:02","modified_gmt":"2024-01-03T14:15:02","slug":"ncpa-agent-install-configuration-and-example-usage","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4030","title":{"rendered":"NCPA Agent Install, Configuration and Example Usage"},"content":{"rendered":"\n<p>NagiosXI has a multitude of ways of monitoring hosts or services. Typically with a Microsoft Windows or Linux host you can monitor using SNMP, but you may also now want to check out the NCPA agent as a way to monitor from NagiosXI. Newer versions of NagiosXI also give the ability to administer, update and track the status of the NCPA agent on each monitored host, so you can tell when you need to upgrade the agent, handy!<\/p>\n\n\n\n<p>The NCPA Agent is a custom monitoring agent that can be installed on Microsoft Windows or Linux machines for both active and passive monitoring of the standard CPU, RAM, Disk, Network and Services, but also for running of local custom plugins.<\/p>\n\n\n\n<p>To avoid just repeating the official documentation, you can find the full installation and configuration guides here:&nbsp;<a href=\"https:\/\/www.nagios.org\/ncpa\/getting-started.php\">NCPA Getting Started<\/a>.<\/p>\n\n\n\n<p>Once installed, you can use the NCPA Web Interface at:&nbsp;<a>https:\/\/&lt;FQDN&gt;:5693<\/a>, you need the Token you&#8217;ll specify during installation.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"NCPAAgentInstall,ConfigurationandExampleUsage-MicrosoftWindows-InstallationQuickStart\">Microsoft Windows &#8211; Installation Quick Start<\/h1>\n\n\n\n<p>Download the latest version from:\u00a0<a href=\"https:\/\/www.nagios.org\/ncpa\/#downloads\">https:\/\/www.nagios.org\/ncpa\/#downloads<\/a>, then install as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>ncpa-3.0.1.exe \/S \/TOKEN='&lt;MY_TOKEN>'<\/code><\/code><\/pre>\n\n\n\n<p>The above installation only installs the NCPA agent in active monitoring mode, for enabling the passive monitoring mode you need to configure the ncpa.cfg file with additional options, but this is beyond the scope of this document.<\/p>\n\n\n\n<p>You may also need to open the firewall for the Port 5693, it is strongly advised to restrict the sources to only the NagiosXI Servers.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"NCPAAgentInstall,ConfigurationandExampleUsage-Linux-InstallationQuickStart\">Linux &#8211; Installation Quick Start<\/h1>\n\n\n\n<p>Download the latest version from:&nbsp;<a href=\"https:\/\/www.nagios.org\/ncpa\/#downloads\">https:\/\/www.nagios.org\/ncpa\/#downloads<\/a>&nbsp;and install using the following procedure:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add to the apt sources list\r\necho \"deb https:\/\/repo.nagios.com\/deb\/$(lsb_release -cs) \/\" > \/etc\/apt\/sources.list.d\/nagios.list\r\n \r\n# Add our public GPG key\r\nwget -qO - https:\/\/repo.nagios.com\/GPG-KEY-NAGIOS-V3 | apt-key add -\r\n \r\n# Update your repositories\r\napt-get update\r\n \r\n# Install NCPA Agent\r\napt-get install ncpa<\/code><\/pre>\n\n\n\n<p>The above installation only installs the NCPA agent in active monitoring mode, for enabling the passive monitoring mode you need to configure the ncpa.cfg file with additional options, but this is beyond the scope of this document.<\/p>\n\n\n\n<p>You may also need to open the firewall as follows, it is strongly advised to restrict the sources to only the NagiosXI Servers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ufw allow from &lt;Nagios Server IP> to any port 5693\r\n\r \r\nufw status<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"NCPAAgentInstall,ConfigurationandExampleUsage-ExampleUsage\">Example Usage<\/h1>\n\n\n\n<p>Example CPU Average Utilisation active monitoring:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/check_ncpa.py -H server.domain.com -t '&lt;MY_TOKEN>' -M 'cpu\/percent' -w 70 -c 90 -q 'aggregate=avg'\r\nOK: Percent was 50.00 % | 'percent'=50.00%;70;90;<\/code><\/pre>\n\n\n\n<p>Example service status monitoring (&#8220;Task Scheduler&#8221;):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>.\/check_ncpa.py -H server.domain.com -t '&lt;MY_TOKEN>' -M 'services' -q 'service=Schedule,status=running'OK: Schedule is running<\/code><\/code><\/pre>\n\n\n\n<p>For other available API endpoints you can monitor you can consult the NCPA Web Interface at:\u00a0<a>https:\/\/&lt;FQDN>:5693<\/a>\u00a0API section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NagiosXI has a multitude of ways of monitoring hosts or services. Typically with a Microsoft Windows or Linux host you can monitor using SNMP, but you may also now want to check out the NCPA agent as a way to monitor from NagiosXI. Newer versions of NagiosXI also give the ability to administer, update and &#8230; <a title=\"NCPA Agent Install, Configuration and Example Usage\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4030\" aria-label=\"Read more about NCPA Agent Install, Configuration and Example Usage\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-4030","post","type-post","status-publish","format-standard","hentry","category-nagios-and-nagiosxi"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4030"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4030\/revisions"}],"predecessor-version":[{"id":4031,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4030\/revisions\/4031"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}