Page 3 of 4
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Thu Oct 08, 2015 4:00 am
by mangirdas
Now I used
and I get
Code: Select all
root@expserver:~# /usr/lib/nagios/plugins/check_nrpe -t 60 -H 192.168.3.252 checkMem -a MaxWarn=95% MaxCrit=99% type=physical
I (0,4,1,105 2014-04-28) seem to be doing fine...
Seems everything fine, but logs still have problems:
Code: Select all
2015-10-08 11:58:31: e:c:\build\nscp\include\socket/connection.hpp:236: Failed to establish secure connection: unknown protocol
2015-10-08 11:58:33: e:..\..\..\..\nscp\modules\NSClientServer\NSClientServer.cpp:254: Invalid password (123456).
2015-10-08 11:58:34: e:..\..\..\..\nscp\modules\NSClientServer\NSClientServer.cpp:254: Invalid password (123456).
2015-10-08 11:58:34: e:..\..\..\..\nscp\modules\NSClientServer\NSClientServer.cpp:254: Invalid password (123456).
2015-10-08 11:58:34: e:..\..\..\..\nscp\modules\NSClientServer\NSClientServer.cpp:254: Invalid password (123456).
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Thu Oct 08, 2015 10:30 am
by hsmith
Was the password that you included in the file in your first post the actual password? We're not looking at anything with special characters here, are we?
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Thu Oct 08, 2015 11:33 pm
by mangirdas
Yes, that password is real and password doesnt have any special simbols
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Fri Oct 09, 2015 10:50 am
by hsmith
Can you back up your nsclient.ini/nsc.ini and upgrade to the
latest stable version of NSClient?
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Mon Oct 12, 2015 5:02 am
by mangirdas
Its hard to understand new NSClient++. So I upgraded to the newest version.
My nsclient looks like:
Code: Select all
# If you want to fill this file with all avalible options run the following 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]
; Undocumented key
password = D28ak37AS
; Undocumented key
allowed hosts = 192.168.3.6
; Undocumented section
[/modules]
; Undocumented key
CheckExternalScripts = 0
; Undocumented key
CheckHelpers = 0
; Undocumented key
CheckNSCP = 0
; Undocumented key
CheckEventLog = 0
; Undocumented key
CheckSystem = 0
; Undocumented key
NSClientServer = 0
; Undocumented key
CheckDisk = 0
; Undocumented key
Scheduler = 0
; Undocumented key
NSCAClient = 0
; Undocumented key
NRPEServer = 0
Its very small. Ofcourse I get
Code: Select all
Uptime
CRITICAL 2015-10-12 13:00:57 0d 0h 7m 7s 4/4 Connection refused
I can see in NSclient++ directory is nsclient-sample. Should I use sample for me?
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Mon Oct 12, 2015 9:39 am
by hsmith
I would copy that configuration over, and edit it to your needs.
Also, your NSClientServer = 0 could be the problem.. edit it to NSClientServer = 1 and restart the service.
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Mon Oct 19, 2015 2:18 am
by mangirdas
I am sorry for long time answer.
So, I updated nagiosclient++ to 0.43 version and I get same errors. My New nsclient looks:
Code: Select all
# If you want to fill this file with all avalible options run the following 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 = D28Ak37AS
; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 127.0.0.1,192.168.3.6
; Undocumented section
[/settings/NRPE/server]
; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = true
; VERIFY MODE - Comma separated list of verification flags to set on the SSL socket. none The server will not send a client certificate request to the client, so the client will not send a certificate. peer The server sends a client certificate request to the client and the certificate returned (if any) is checked. fail-if-no-cert if the client did not return a certificate, the TLS/SSL handshake is immediately terminated. This flag must be used together with peer. peer-cert Alias for peer and fail-if-no-cert. workarounds Various bug workarounds. single Always create a new key when using tmp_dh parameters. client-once Only request a client certificate on the initial TLS/SSL handshake. This flag must be used together with verify-peer
verify mode = none
; VERIFY MODE - Comma separated list of verification flags to set on the SSL socket. default-workarounds Various workarounds for what I understand to be broken ssl implementations no-sslv2 Do not use the SSLv2 protocol. no-sslv3 Do not use the SSLv3 protocol. no-tlsv1 Do not use the TLSv1 protocol. single-dh-use Always create a new key when using temporary/ephemeral DH parameters. This option must be used to prevent small subgroup attacks, when the DH parameters were not generated using "strong" primes (e.g. when using DSA-parameters).
ssl options =
; Undocumented section
[/modules]
; Undocumented key
Scheduler = 0
; Undocumented key
NSCAClient = 1
; CheckExternalScripts - Execute external scripts
CheckExternalScripts = 1
; CheckHelpers - Various helper function to extend other checks.
CheckHelpers = 1
; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 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
; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1
; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 1
; CheckEventLog - Check for errors and warnings in the event log.
CheckEventLog = 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 -
; VISUAL BASIC WRAPPING -
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
; BATCH FILE WRAPPING -
bat = scripts\\%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_up - Alias for alias_up. To configure this item add a section called: /settings/external scripts/alias/alias_up
alias_up = check_uptime
; 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=stisvc
; 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_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 - 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_disk - Alias for alias_disk. To configure this item add a section called: /settings/external scripts/alias/alias_disk
alias_disk = check_drivesize
; 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_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_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = check_cpu
; 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
; 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_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_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_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_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_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_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"
but in server now I dont get any erros
Code: Select all
root@expserver:~# /usr/lib/nagios/plugins/check_nrpe -t 60 -H 192.168.3.252 checkMem -a MaxWarn=95% MaxCrit=99% type=physical
I (0.4.3.143 2015-04-29) seem to be doing fine...
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Mon Oct 19, 2015 10:12 am
by hsmith
In nsclient/nsc.ini change
Code: Select all
[/settings/NRPE/server]
; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = true
to
Code: Select all
[/settings/NRPE/server]
allow arguments = true
; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = true
Now restart the NSClient service!
Now in your check command change
Code: Select all
/usr/lib/nagios/plugins/check_nrpe -t 60 -H 192.168.3.252 checkMem -a MaxWarn=95% MaxCrit=99% type=physical
to
Code: Select all
/usr/lib/nagios/plugins/check_nrpe -t 60 -H 192.168.3.252 -c checkMem -a MaxWarn=95% MaxCrit=99% type=physical
Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Tue Oct 20, 2015 4:21 am
by mangirdas
I got this
Code: Select all
root@expserver:~# /usr/lib/nagios/plugins/check_nrpe -t 60 -H 192.168.3.252 -c checkMem -a MaxWarn=95% MaxCrit=99% type=physical
OK: physical: Total: 0.991GB - Used: 401.379MB (39%) - Free: 613.852MB (60%)|'physical'=0.39197GB;0.94186;0.98152;0;0.99143 'physical %'=39%;94;98;0;100
root@expserver:~#
I thinks this nagios problems is about computers location. Server and this machine are in differents city places.

Re: NSClient - ERROR: Invalid password. [Nagios 3.23]
Posted: Tue Oct 20, 2015 9:41 am
by hsmith
That is the plugin working. I'm a little confused as to where the problem is in that output.