Page 2 of 4

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 8:55 am
by deathscythe272
Was anyone able to add insight as to where in the .ini file I should add the NSclient server string to ?

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 12:58 pm
by rkennedy
I would add it under the [modules] section.

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 1:40 pm
by deathscythe272
I've added the section to the .ini file and restarted the NSclient service. I am still seeing the following in the errors on the monitoring page any ideas would be helpful I've also attached attached the .ini file. Any ideas on what I should try

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 2:28 pm
by rkennedy
Let's take a step back from the GUI part, and attempt these through the command line. If they work on the command line, then we can proceed to fix the configurations there. Does your password contain a special character by chance?

Please run these commands from the CLI, and post the full output back here -

Code: Select all

[root@localhost libexec]# ./check_nt -H 192.168.47.8 -p 12489 -v USEDDISKSPACE -l C
C:\ - total: 24.90 Gb - used: 19.27 Gb (77%) - free 5.63 Gb (23%) | 'C:\ Used Space'=19.27Gb;0.00;0.00;0.00;24.90
[root@localhost libexec]# ./check_nrpe -H 192.168.47.8
I (0.4.3.143 2015-04-29) seem to be doing fine...

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 2:40 pm
by deathscythe272
The password I used is


; PASSWORD - The password to use. Again has to be the same as the server or it wont work at all.
password =secret_password

I had also used the


; PASSWORD - The password to use. Again has to be the same as the server or it wont work at all.
password = secret_password

those are the password settings I've copied the commands with the output below and I am slightly confused where is the port 5666 coming from my .ini file says to use port 12489 any ideas?

[jagnitsch@wva-nagxi00 libexec]$ ./check_nt -H 192.168.113.179 -p 12489 -v USEDDISKSPACE -l C
No data was received from host!
could not fetch information from server
[jagnitsch@wva-nagxi00 libexec]$ ./check_nrpe -H 192.168.113.179
connect to address 192.168.113.179 port 5666: Connection refused
connect to host 192.168.113.179 port 5666: Connection refused[jagnitsch@wva-nagxi00 libexec]$

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 2:59 pm
by rkennedy
Got it - take a look at your nsclient.log file - do you see anything populated here? Please post it for us to look at.

Also, from the Windows machine, what is the output of netstat -an | findstr 12489?

Lastly, from the Nagios machine - please run nmap 192.168.113.179 - and post the result back here.

Port 5666 is used for NRPE (check_nrpe), and 12489 is used for check_nt - they are both different protocols that can be used to check data.


---

All of the above is relevent, but I copied over your configuration file and was able to get the same error returned as I continued my post -

Code: Select all

[root@localhost libexec]# ./check_nt -H 192.168.5.47 -p 12489 -v USEDDISKSPACE -l C
No data was received from host!
could not fetch information from server
With this as the error in nsclient.log -

Code: Select all

2016-12-27 13:52:43: error:c:\source\nscp\include\socket/connection.hpp:243: Failed to establish secure connection: short read: 219
2016-12-27 13:52:56: error:c:\source\nscp\include\socket/connection.hpp:243: Failed to establish secure connection: short read: 219
I'm not sure where in your settings it's coming from, but here's the config file I use on my testing machine which you should be able to replace yours with -

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]

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


; Undocumented section
[/settings/NRPE/server]

; 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 = 

; 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

; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = true

allow arguments = true

; Undocumented section
[/modules]

; 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

; 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

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

; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 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_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_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_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_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_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_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_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_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_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_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_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_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$"

[/settings/NRPE/server]
allow nasty characters=true

[/settings/external scripts]
allow nasty characters=true
Copied over to my working machine -

Code: Select all

[root@localhost libexec]# ./check_nt -H 192.168.5.47 -p 12489 -v USEDDISKSPACE -l C
C:\ - total: 468.62 Gb - used: 84.11 Gb (18%) - free 384.51 Gb (82%) | 'C:\ Used Space'=84.11Gb;0.00;0.00;0.00;468.62

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 3:20 pm
by deathscythe272
This is the output I have gotten from my windows machine running netstat -an | findstr 12489



TCP 0.0.0.0:12489 0.0.0.0:0 LISTENING
TCP 0.0.0.0:12489 0.0.0.0:0 LISTENING
TCP 192.168.113.179:12489 192.168.113.200:46888 ESTABLISHED
TCP [::]:12489 [::]:0 LISTENING


[jagnitsch@wva-nagxi00 libexec]$ nmap 192.168.113.179

Starting Nmap 6.47 ( http://nmap.org ) at 2016-12-27 20:09 UTC
Nmap scan report for FQDN (192.168.113.179)
Host is up (0.00049s latency).
Not shown: 983 closed ports
PORT STATE SERVICE
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1433/tcp open ms-sql-s
2701/tcp open sms-rcinfo
3389/tcp open ms-wbt-server
7937/tcp open nsrexecd
7938/tcp open lgtomapper
8081/tcp open blackice-icecap
9001/tcp open tor-orport
9002/tcp open dynamid
49152/tcp open unknown
49153/tcp open unknown
49154/tcp open unknown
49155/tcp open unknown
49156/tcp open unknown

this was the output from the error log

2016-12-27 15:10:25: e:c:\build\nscp\include\socket/connection.hpp:134: Failed to read data: End of file
2016-12-27 15:10:34: e:c:\build\nscp\include\socket/connection.hpp:134: Failed to read data: End of file

after copying and pasting the .ini file you had pasted and changing the apporaite IP address everything appears to be working other than some services with an
NSClient - ERROR: Invalid password. message being displayed

[jagnitsch@wva-nagxi00 libexec]$ ./check_nrpe -H 192.168.113.179
I (0,4,1,105 2014-04-28) seem to be doing fine...
[jagnitsch@wva-nagxi00 libexec]$ ./check_nt -H 192.168.113.179 -p 12489 -v USEDDISKSPACE -l C
C:\ - total: 99.66 Gb - used: 35.74 Gb (36%) - free 63.91 Gb (64%) | 'C:\ Used Space'=35.74Gb;0.00;0.00;0.00;99.66

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 3:27 pm
by rkennedy
after copying and pasting the .ini file you had pasted and changing the apporaite IP address everything appears to be working other than some services with an
NSClient - ERROR: Invalid password. message being displayed
You'll want to look at those services in the Configure -> Core Config Manager, and adjust the password here as needed. (or remove it) If you're having a hard time figuring it out, feel free to post a screenshot of what's not working now, and then PM over a copy of your /usr/local/nagios/var/objects.cache for us to look at to look at, so we can how it's all correlated together.

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 3:42 pm
by deathscythe272
Everything appears to be working other than my eth0 adapter i've copied the screen shot below I am currently using the below command without any password. Unless I am confused as to where the password is set. I have configured a password in my window's client .ini to use a password. where do I add the password in the below string to make it work. Also why are the other services working when they dont have a password configured but this one doesn't and its the only one working?

check_nt!COUNTER!'-l "\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Total/sec" -w 7000 -c 9000'!!!!!!

Just as an example this command is checking the C disk and it doesn't have a password but it is working currently

check_xi_service_nsclient!!USEDDISKSPACE!-l C -w 80 -c 95!!!!!!

Re: Nagios XI Windows Server issues

Posted: Tue Dec 27, 2016 4:12 pm
by rkennedy
Add an explanation point after check_nt so it looks like check_nt!!COUNTER - my guess is that $ARG1$ is supposed to be populated as the password, but since you only have one explanation it assumes COUNTER is your password.