check_ncpa.py and config file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ronafisher2
Posts: 11
Joined: Mon Feb 08, 2021 4:46 pm

check_ncpa.py and config file

Post by ronafisher2 »

Good morning,

Turned up a nagios 4.4.6 core install with 2.3.3 plugins on RHEL 8. Installed NCPA 2.3.1 agent on win2008r2. nagios server is able to query the NCPA agent via CLI but when executed from cfg file nagios svc won't start.

[nagios@tuktvops02 libexec]$ ./check_ncpa.py -H OPSTVAPP04 -t <token>-P 5693 -M 'processes'
OK: Process count was 42 | 'process_count'=42;;; 'cpu'=99.8%;;; 'memory'=37.27%;;; 'memory_vms'=1.41GB;;; 'memory_rss'=1.55GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
0: System Idle Process: NT AUTHORITY\SYSTEM: 0.0 % (VMS 0.00 GB, RSS 0.00 GB): 99.40 %
4: System: NT AUTHORITY\SYSTEM: 0.01 % (VMS 0.00 GB, RSS 0.00 GB): 0.00 %
252: smss.exe: NT AUTHORITY\SYSTEM: 0.03 % (VMS 0.00 GB, RSS 0.00 GB): 0.00 %[/color]

I seem to be having issues with the config file to setup monitors. Nagios service will not start when this config file is parsed. I took the service configs out since it doesn't even work for the host config. Ideas?

nagios.cfg

cfg_file=/usr/local/nagios/etc/objects/OPSTVAPP04.cfg

Config file

/usr/local/nagios/etc/objects/OPSTVAPP04.cfg

###############################################################################

# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host {

use windows-server ; Inherit default values from a template
host_name OPSTVAPP04 ; The name we're giving to this host
alias Win2008R2 test server ; A longer name associated with the host
address 10.129.0.21 ; IP address of the host
check_command check_ncpa!-t '<token>' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}

Service output:

Process: 72261 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0
Process: 72684 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, statu
Main PID: 72263 (code=exited, status=0/SUCCESS)

Feb 15 17:00:45 server nagios[72684]: ***> One or more problems was encountered while proce
Feb 15 17:00:45 server nagios[72684]: Check your configuration file(s) to ensure that
Feb 15 17:00:45 server nagios[72684]: directives and data definitions. If you are upg
Feb 15 17:00:45 server nagios[72684]: version of Nagios, you should be aware that some
Feb 15 17:00:45 servernagios[72684]: may have been removed or modified in this versio
Feb 15 17:00:45 server nagios[72684]: the HTML documentation regarding the config file
Feb 15 17:00:45 server nagios[72684]: 'Whats New' section to find out what has changed
Feb 15 17:00:45 server systemd[1]: nagios.service: Control process exited, code=exited stat
Feb 15 17:00:45 serversystemd[1]: nagios.service: Failed with result 'exit-code'.
Feb 15 17:00:45 server systemd[1]: Failed to start Nagios Core 4.4.6.


Thanks for any insight from this Nagios newb
Ron
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: check_ncpa.py and config file

Post by benjaminsmith »

Hi Ron,

Thanks for joining the Nagios Community Forum! Glad to have you here.

If you are a Nagios Core users, get to know the following page. It's really helpful.
https://assets.nagios.com/downloads/nag ... tions.html

Check your config to make sure the objects are not missing any required definitions. You can verify your configs at any time by running the following command for the CLI.

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
This will provide some more debug info to the output.

Benjamin
Nagios Support Team
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ronafisher2
Posts: 11
Joined: Mon Feb 08, 2021 4:46 pm

Re: check_ncpa.py and config file

Post by ronafisher2 »

Thanks Ben,

Perhaps I'm confused as I don't see any tokens being passed in the configs on the referenced object def site. How does Nagios authenticate to the NCPA client?

Thanks again for your reply.

Ron
ronafisher2
Posts: 11
Joined: Mon Feb 08, 2021 4:46 pm

Re: check_ncpa.py and config file

Post by ronafisher2 »

Oh my what a newb mistake. Normally we don't have windows firewall on but did on a test client. Things work fine now with the NCPA config.

Ron
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: check_ncpa.py and config file

Post by benjaminsmith »

Hi Ron,
Oh my what a newb mistake. Normally we don't have windows firewall on but did on a test client. Things work fine now with the NCPA config.
Great! Glad to hear it's working.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked