Page 2 of 2

Re: NSclient password

Posted: Thu Jan 21, 2016 1:59 pm
by rkennedy
As requested earlier, can you please run the command over the CLI and post the result? I just took your exact configuration (took the space out of the password, and changed my nagios server IP), and am having no issues at all. What version of check_nt are you using? Does your password contain special characters at all?

Here are the results over the CLI on my end -

Code: Select all

[root@suse11 libexec]# ./check_nt -H 192.168.5.47 -p 12489 -s thepassword -v CPULOAD -l 5,80,90
CPU Load 2% (5 min average) |   '5 min avg Load'=2%;80;90;0;100
[root@suse11 libexec]# ./check_nt -H 192.168.5.47 -p 12489 -s thepassword2 -v CPULOAD -l 5,80,90
NSClient - ERROR: Invalid password.
and, you're config that I am using -

Code: Select all

# If you want to fill this file with all avalible options run the followding command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/settings/default]

; PASSWORD - Password used to authenticate against server
password = thepassword

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 192.168.4.254

; Undocumented section
[/modules]

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 1

; CheckExternalScripts - Execute external scripts
CheckExternalScripts = 1

; CheckHelpers - Various helper function to extend other checks.
CheckHelpers = 1

; CheckEventLog - Check for errors and warnings in the event log.
CheckEventLog = 1

; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 1

; CheckNSCP - Use this module to check the healt and status of NSClient++ it self
CheckNSCP = 1

; NRPEServer - A server that listens for incoming NRPE connection and processes incoming requests.
NRPEServer = 1

; A list of templates for wrapped scripts.
%SCRIPT% will be replaced by the actual script an %ARGS% will be replaced by any given arguments.
[/settings/external scripts/wrappings]

; POWERSHELL WRAPPING -
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -

; BATCH FILE WRAPPING -
bat = scripts\\%SCRIPT% %ARGS%

; VISUAL BASIC WRAPPING -
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

; A list of aliases available.
An alias is an internal command that has been predefined to provide a single command without arguments. Be careful so you don't create 

loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]

; alias_volumes_loose - Alias for alias_volumes_loose. To configure this item add a section called: /settings/external 

scripts/alias/alias_volumes_loose
alias_volumes_loose = check_drivesize

; alias_volumes - Alias for alias_volumes. To configure this item add a section called: /settings/external scripts/alias/alias_volumes
alias_volumes = check_drivesize

; alias_sched_all - Alias for alias_sched_all. To configure this item add a section called: /settings/external 

scripts/alias/alias_sched_all
alias_sched_all = check_tasksched show-all "syntax=${title}: ${exit_code}" "crit=exit_code ne 0"

; alias_service - Alias for alias_service. To configure this item add a section called: /settings/external scripts/alias/alias_service
alias_service = check_service

; alias_process_stopped - Alias for alias_process_stopped. To configure this item add a section called: /settings/external 

scripts/alias/alias_process_stopped
alias_process_stopped = check_process "process=$ARG1$" "crit=state != 'stopped'"

; alias_process_hung - Alias for alias_process_hung. To configure this item add a section called: /settings/external 

scripts/alias/alias_process_hung
alias_process_hung = check_process "filter=is_hung" "crit=count>0"

; alias_process_count - Alias for alias_process_count. To configure this item add a section called: /settings/external 

scripts/alias/alias_process_count
alias_process_count = check_process "process=$ARG1$" "warn=count > $ARG2$" "crit=count > $ARG3$"

; alias_process - Alias for alias_process. To configure this item add a section called: /settings/external scripts/alias/alias_process
alias_process = check_process "process=$ARG1$" "crit=state != 'started'"

; alias_mem - Alias for alias_mem. To configure this item add a section called: /settings/external scripts/alias/alias_mem
alias_mem = check_memory
alias_memory_physical = check_memory "warn=used > 85%" "crit=used > 95%" type=physical "perf-config=physical(unit:G) physical 

%(ignored:true)"

; alias_file_size - Alias for alias_file_size. To configure this item add a section called: /settings/external 

scripts/alias/alias_file_size
alias_file_size = check_files "path=$ARG1$" "crit=size > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${size}" max-dir-

depth=10

; alias_service_ex - Alias for alias_service_ex. To configure this item add a section called: /settings/external 

scripts/alias/alias_service_ex
alias_service_ex = check_service "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" "exclude=Microsoft .NET Framework NGEN 

v4.0.30319_X86" "exclude=Google uppfærsla Þjónusta (gupdate)" "exclude=TPM Base Services" "exclude=Microsoft .NET Framework NGEN 

v4.0.30319_X64" "exclude=Software Protection" "exclude=Shell Hardware Detection"

; alias_event_log - Alias for alias_event_log. To configure this item add a section called: /settings/external 

scripts/alias/alias_event_log
alias_event_log = check_eventlog
alias_event_log_system = CheckEventLog file=system MaxWarn=100 MaxCrit=200 "filter=generated gt -24h AND severity NOT IN ('success', 

'informational','warning')" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"
alias_event_log_application = CheckEventLog file=application MaxWarn=100 MaxCrit=200 "filter=generated gt -24h AND severity NOT IN 

('success', 'informational','warning')" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"

; alias_disk - Alias for alias_disk. To configure this item add a section called: /settings/external scripts/alias/alias_disk
alias_disk = check_drivesize
alias_disk_all = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=* "perf-config=*(unit:G) used %(ignored:true)" 

"filter=type='fixed' AND drive NOT LIKE '\\?\\'"
alias_disk_c = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=c "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_d = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=d "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_e = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=e "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_f = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=f "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_g = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=g "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_h = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=h "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_i = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=i "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_j = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=j "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_k = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=k "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_l = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=l "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_m = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=m "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_n = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=n "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_o = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=o "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_p = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=p "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_q = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=q "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_r = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=r "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_s = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=s "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_t = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=t "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_u = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=u "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_v = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=v "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_x = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=x "perf-config=*(unit:G) used %(ignored:true)"
alias_disk_z = Check_DriveSize "crit=used>95%" "warn=used>90%" drive=z "perf-config=*(unit:G) used %(ignored:true)"


; alias_os - Check OS Version
alias_os = check_os_Version

; alias_cpu_ex - Alias for alias_cpu_ex. To configure this item add a section called: /settings/external scripts/alias/alias_cpu_ex
alias_cpu_ex = check_cpu "warn=load > $ARG1$" "crit=load > $ARG2$" time=5m time=1m time=30s

; alias_file_age - Alias for alias_file_age. To configure this item add a section called: /settings/external scripts/alias/alias_file_age
alias_file_age = check_files "path=$ARG1$" "crit=written > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${written}" max-dir-

depth=10

; alias_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = check_cpu

; alias_up - Alias for alias_up. To configure this item add a section called: /settings/external scripts/alias/alias_up
alias_up = check_uptime

; alias_sched_task - Alias for alias_sched_task. To configure this item add a section called: /settings/external 

scripts/alias/alias_sched_task
alias_sched_task = check_tasksched show-all "filter=title eq '$ARG1$'" "detail-syntax=${title} (${exit_code})" "crit=exit_code ne 0"

; alias_sched_long - Alias for alias_sched_long. To configure this item add a section called: /settings/external 

scripts/alias/alias_sched_long
alias_sched_long = check_tasksched "filter=status = 'running'" "detail-syntax=${title} (${most_recent_run_time})" 

"crit=most_recent_run_time < -$ARG1$"

; alias_disk_loose - Alias for alias_disk_loose. To configure this item add a section called: /settings/external 

scripts/alias/alias_disk_loose
alias_disk_loose = check_drivesize

; Old commands
nt_cpuload=checkCPU warn=80 crit=90 time=5m time=1m time=30s
nt_memload=checkMem MaxWarn=90% MaxCrit=95% ShowAll=long type=physical type=virtual type=paged type=page
nt_check_disk_c=check_drivesize "crit=used>90%" "warn=used>80%" drive=c
nt_check_disk_d=check_drivesize "crit=used>90%" "warn=used>80%" drive=d
nt_check_disk_e=check_drivesize "crit=used>90%" "warn=used>80%" drive=e
nt_check_disk_f=check_drivesize "crit=used>90%" "warn=used>80%" drive=f
nt_check_disk_g=check_drivesize "crit=used>90%" "warn=used>80%" drive=g
nt_check_disk_h=check_drivesize "crit=used>90%" "warn=used>80%" drive=h
nt_check_disk_i=check_drivesize "crit=used>90%" "warn=used>80%" drive=i
nt_check_disk_j=check_drivesize "crit=used>90%" "warn=used>80%" drive=j
nt_check_disk_k=check_drivesize "crit=used>90%" "warn=used>80%" drive=k
nt_check_disk_l=check_drivesize "crit=used>90%" "warn=used>80%" drive=l
nt_check_disk_m=check_drivesize "crit=used>90%" "warn=used>80%" drive=m
nt_check_disk_n=check_drivesize "crit=used>90%" "warn=used>80%" drive=n
nt_check_disk_o=check_drivesize "crit=used>90%" "warn=used>80%" drive=o
nt_check_disk_p=check_drivesize "crit=used>90%" "warn=used>80%" drive=p
nt_check_disk_q=check_drivesize "crit=used>90%" "warn=used>80%" drive=q
nt_check_disk_r=check_drivesize "crit=used>90%" "warn=used>80%" drive=r
nt_check_disk_s=check_drivesize "crit=used>90%" "warn=used>80%" drive=s
nt_check_disk_t=check_drivesize "crit=used>90%" "warn=used>80%" drive=t
nt_check_disk_u=check_drivesize "crit=used>90%" "warn=used>80%" drive=u
nt_check_disk_v=check_drivesize "crit=used>90%" "warn=used>80%" drive=v
nt_check_disk_x=check_drivesize "crit=used>90%" "warn=used>80%" drive=x
nt_check_disk_y=check_drivesize "crit=used>90%" "warn=used>80%" drive=y
nt_check_disk_z=check_drivesize "crit=used>90%" "warn=used>80%" drive=z
nt_check_disk_w=check_drivesize "crit=used>90%" "warn=used>80%" drive=w
;nt_check_disk_l=CheckDriveSize MinWarn=10% MinCrit=5% Drive=L:\ FilterType=FIXED

[/settings/external scripts/scripts]
check_updates = cmd /c echo scripts\check_windows_updates.ps1; exit($LastExitCode) | powershell.exe -command -
check_updates_wu = cmd /c echo scripts\WU_check.ps1; exit($LastExitCode) | powershell.exe -ExecutionPolicy Bypass -command -
check_ExchangeQueue = cmd /c echo scripts\Check_ExchangeQueueHealth.ps1; exit($LastExitCode) | powershell.exe -command -
check_ex2013dag = cmd /c echo scripts\check_ex2013dag.ps1; exit($lastexitcode) | powershell.exe -noprofile -nologo -command -
check_ex2013_server_component_state = cmd /c echo scripts\check_ex2013_server_component_state.ps1; exit($lastexitcode) | powershell.exe 

-noprofile -nologo -command -
check_ex2013_Check_Exchange_Content_Index_State_Health = cmd /c echo scripts\Check_ExchangeContentIndexStateHealth.ps1; exit

($lastexitcode) | powershell.exe -noprofile -nologo -command -
check_printqueue_2008 = cmd /c echo scripts\check_printqueue_2008.ps1; exit($LastExitCode) | powershell.exe -ExecutionPolicy Bypass -

command -
check_skype_entvoice_users = cmd /c echo scripts\check_skype_count_entvoice_users.ps1; exit($LastExitCode) | powershell.exe -command -
check_skype_IM_users = cmd /c echo scripts\check_skype_count_IM_users.ps1; exit($LastExitCode) | powershell.exe -command -
check_skype_MeetingEntCal_users = cmd /c echo scripts\check_skype_count_MeetingEntCal_users.ps1; exit($LastExitCode) | powershell.exe -

command -
check_skype_windows_service_state = cmd /c echo scripts\check_skype_windows_service_state.ps1; exit($LastExitCode) | powershell.exe -

command -
get_disks=scripts/df.exe -b -r
get_time=scripts/date.exe +%s

; check_windows_time
check_ntp_time = cscript.exe //T:30 //NoLogo scripts\check_time.vbs 10.1.8.200 30 180

; check_dhcp_windows
check_dhcp_windows = cscript.exe //T:30 //NoLogo scripts\check_dhcp_windows.vbs

; Section for NRPE (NRPEServer.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
allow arguments = true
allow nasty characters = true
port = 5666
use ssl = true
insecure = true
extended response = true
timeout = 75

Re: NSclient password

Posted: Fri Jan 22, 2016 6:01 am
by spiderpig
[root@server plugins]# check_nt -H 192.168.1.1 -p 12489 -v USEDDISKSPACE -l c -s inputthewrongpassword
NSClient - ERROR: Invalid password.
[root@server plugins]# check_nt -H 192.168.1.1 -p 12489 -v USEDDISKSPACE -l c -s rightpassword
c:\ - total: 930.90 Gb - used: 535.04 Gb (57%) - free 395.87 Gb (43%) | 'c:\ Used Space'=535.04Gb;0.00;0.00;0.00;930.90

this works, so now I am confused :)

Re: NSclient password

Posted: Fri Jan 22, 2016 10:57 am
by rkennedy
Is it working on the web interface as well, or are you still seeing an error?