check_ncpa.py and config file
Posted: Tue Feb 16, 2021 12:27 pm
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
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