LinuxForum.Fans
Тема

Средство мониторинга Nagios (настройка)

Автор: Bokas 78 сообщений 35153 просмотров
#67619

Bokas
А что именно не так с NAT?? Поясните, я ведь не в курсе как у Вас всё устроено.

#67691

2 сервера закинуты на другого провайдера (у одного сервера ип доступный (белый), у второго серый , подключены последовательно). У меня другой провайдер и мой хост стоит за NAT. В случаи с первым сервером (с белым ип ) , как мне настраивать nrpe / nsclien++ (имеюю ввиду allowed hosts, какой ип писать , я пробовал ставить белый , т .е уже после преобразования , но не получилось по причине Connection timeout). И соответственно интересно как быть если сервер за NAT И хост тоже там же

#67693

Bokas
Писать IP сервера который у Вас доступен по пингу. Ну и следовательно у Вас должны присутсвовать маршруты внутри NAT. Именно что при запросе на белый IP маршрутизация идёт внутри NAT.

А вообще Nagios`у пофигу где сервера стоят, лишь бы сервер Нагиоса имел возможность пинговать удалённые машины, а клиенты имели возможность пинговать сервер. При таком взаимодействии, сервер отслеживает доступность хостов, а хосты сами через установленных клиентов сливают статистику на сервер.

#68451

:( . Переставил nagios , карта видна smile ,делал так http://www.novell.com/coolsolutions/feature/16723.html(только путь ставил стандартный), но при попытке мониторинга Win сервера на веб интерфейсе теперь CRITICAL - Socket timeout after 10 seconds . На сервере(имеюю ввиду сервер виндоус, т.е он же клиент нагиоса) стоит NSclient++, но вместо порта 12489 , почему то открыт 5666. Весь конфиг сверял , все ок. Какой-то полтергейст :D

#68463

немного погуглил, я так понимаю проблема именно в win 2003 server c nsclient++

#68502

Bokas
Нет там никаких проблем, я так думаю у Вас фаервол стоит на Win сервере, который как раз и пытается заблокировать порт nsclient++. Там же всё просто, один порт на приём, второй на отправку, вот и получается, что запрос уходит, а ответа не получает.

#68549
step_slim написал:
Bokas
Нет там никаких проблем, я так думаю у Вас фаервол стоит на Win сервере, который как раз и пытается заблокировать порт nsclient++. Там же всё просто, один порт на приём, второй на отправку, вот и получается, что запрос уходит, а ответа не получает.

Вот сейчас перепроверил, фаервол не запущен, касперский я выключал и пробовал без него. Есть еще такая штука tcp/ip filtering в настройках сетевой карты, там поставил Permit ALL. Что еще может блочить этот порт?

#68555

Кстати, попробовал на другю машину (OS windows XP), все работает. И сканирование утилитой nmap показывает такой же результат как и на 2003 -м сервере , т .е что 12489 - filtered 5666-open.

#68560

Bokas
Не забывайте про встроенный БРАУДМЕР Винды, зайдите в "свойство сетевого подключения- дополнительно- Браудмер Виндовс параметры (тут точно подтвердите отключения браудмера)- исключения (можете тут посмотреть какие исключения)- дополнительно (в списке выбераете Ваше действующее подключение)- параметры (снимаете все галочки и сохраняете) грузитесь и проверяете.

#68571
step_slim написал:
Bokas
Не забывайте про встроенный БРАУДМЕР Винды, зайдите в "свойство сетевого подключения- дополнительно- Браудмер Виндовс параметры (тут точно подтвердите отключения браудмера)- исключения (можете тут посмотреть какие исключения)- дополнительно (в списке выбераете Ваше действующее подключение)- параметры (снимаете все галочки и сохраняете) грузитесь и проверяете.

Все выключено smile.
у Вас мониторинг серверов win 2003 ? на обычном ХP у меня нет таких проблем... все работает

#68587

Bokas
Да у меня сервера 2003. Покажите свой конфиг файл nsclient++ клиента с Win 2003 машины. Конфигурационный файл лежит в папке этой машины и имеет расширение .ini
Я кажется понял что у Вас. Выкладывайте файл будем смотреть.

#69069

Вот конфиг

text
[modules]
NRPEListener.dll
NSClientListener.dll
CheckWMI.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
;CheckWMI.dll
;
; Script to check external scripts and/or internal aliases.
CheckExternalScripts.dll
;
; NSCA Agent if you enable this NSClient++ will talk to NSCA hosts repeatedly (so dont enable unless you want to use NSCA)
NSCAAgent.dll
;
; LUA script module used to write your own "check deamon".
LUAScript.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll
; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
NRPEClient.dll
; Extreamly early beta of a task-schedule checker
CheckTaskSched.dll

[Settings] ;# OBFUSCATED PASSWORD ; This is the same as the password option but here you can store the password in an obfuscated manner. ; *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the ; password. Its just a bit harder to do it at first glance. ;obfuscated_password=Jw0KAUUdXlAAUwASDAAB ; ;# PASSWORD ; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly. password=1q2w3e ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons. ; If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password). ; The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access allowed_hosts=109.87.xx.xx/24,178.94.2x.xx/24 ; ;# USE THIS FILE ; Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1 ; the registry will be used instead. use_file=1 allowed_hosts=109.87.138.192,178.94.22.30 password=1q2w3e ; ; # USE SHARED MEMORY CHANNELS ; This is the "new" way for using the system tray based on an IPC framework on top shared memmory channels and events. ; It is brand new and (probably has bugs) so dont enable this unless for testing! ; If set to 1 shared channels will be created and system tray icons created and such and such... ;shared_session=1

[log] ;# LOG DEBUG ; Set to 1 if you want debug message printed in the log file (debug messages are always printed to stdout when run with -test) ;debug=1 ; ;# LOG FILE ; The file to print log statements to ;file=nsclient.log ; ;# LOG DATE MASK ; The format to for the date/time part of the log entry written to file. ;date_mask=%Y-%m-%d %H:%M:%S ; ;# LOG ROOT FOLDER ; The root folder to use for logging. ; exe = the folder where the executable is located ; local-app-data = local application data (probably a better choice then the old default) ;root_folder=exe

[NSClient] ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. ; If you leave this blank the global version will be used instead. allowed_hosts=109.87.xx.xx,178.94.xx.xx ; ;# NSCLIENT PORT NUMBER ; This is the port the NSClientListener.dll will listen to. port=12489 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ;bind_to_address= ; ;# SOCKET TIMEOUT ; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out. socket_timeout=30

[NRPE] ;# NRPE PORT NUMBER ; This is the port the NRPEListener.dll will listen to. port=5666 ; ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. ;command_timeout=60 ; ;# COMMAND ARGUMENT PROCESSING ; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. ;allow_arguments=0 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;allow_nasty_meta_chars=0 ; ;# USE SSL SOCKET ; This option controls if SSL should be used on the socket. ;use_ssl=1 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ; bind_to_address= ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NRPE deamon. ; If you leave this blank the global version will be used instead. allowed_hosts=109.87.xx.xx,178.94.xx.xx ; ;# SCRIPT DIRECTORY ; All files in this directory will become check commands. ; *WARNING* This is undoubtedly dangerous so use with care! ;script_dir=scripts\ ; ;# SOCKET TIMEOUT ; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out. ;socket_timeout=30

[Check System] ;# CPU BUFFER SIZE ; Can be anything ranging from 1s (for 1 second) to 10w for 10 weeks. Notice that a larger buffer will waste memory ; so don't use a larger buffer then you need (ie. the longest check you do +1). ;CPUBufferSize=1h ; ;# CHECK RESOLUTION ; The resolution to check values (currently only CPU). ; The value is entered in 1/10:th of a second and the default is 10 (which means ones every second) ;CheckResolution=10 ; ;# CHECK ALL SERVICES ; Configure how to check services when a CheckAll is performed. ; ...=started means services in that class *has* to be running. ; ...=stopped means services in that class has to be stopped. ; ...=ignored means services in this class will be ignored. ;check_all_services[SERVICE_BOOT_START]=ignored ;check_all_services[SERVICE_SYSTEM_START]=ignored ;check_all_services[SERVICE_AUTO_START]=started ;check_all_services[SERVICE_DEMAND_START]=ignored ;check_all_services[SERVICE_DISABLED]=stopped

[External Script] ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. ;command_timeout=60 ; ;# COMMAND ARGUMENT PROCESSING ; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. ;allow_arguments=0 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;allow_nasty_meta_chars=0 ; ;# SCRIPT DIRECTORY ; All files in this directory will become check commands. ; *WARNING* This is undoubtedly dangerous so use with care! ;script_dir=c:\my\script\dir

[Script Wrappings] vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS% ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command - bat=scripts\%SCRIPT% %ARGS%

[External Scripts] ;check_es_long=scripts\long.bat ;check_es_ok=scripts\ok.bat ;check_es_nok=scripts\nok.bat ;check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs ;check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -

[External Alias] alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED alias_service=checkServiceState CheckAll alias_process=checkProcState $ARG1$=started alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical alias_up=checkUpTime MinWarn=1d MinWarn=1h alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%" alias_file_size=checkFile2 filter=out "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_file_size_in_dir=checkFile2 filter=out pattern=*.txt "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_event_log_old=CheckEventLog file=application file=system filter=new filter=out MaxWarn=1 MaxCrit=1 filter-generated=>2d filter-severity==success filter-severity==informational truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" alias_event_log_new=CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational')" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" alias_event_log=alias_event_log_new

check_ok=CheckOK Everything is fine!

[Wrapped Scripts] ;check_test_vbs=check_test.vbs /arg1:1 /arg2:1 /variable:1 ;check_test_ps1=check_test.ps1 arg1 arg2 ;check_test_bat=check_test.bat arg1 arg2 ;check_battery=check_battery.vbs ;check_printer=check_printer.vbs

; [includes] ;# The order when used is "reversed" thus the last included file will be "first" ;# Included files can include other files (be carefull only do basic recursive checking) ; ; myotherfile.ini ; real.ini

[NSCA Agent] ;# CHECK INTERVALL (in seconds) ; How often we should run the checks and submit the results. ;interval=5 ; ;# ENCRYPTION METHOD ; This option determines the method by which the send_nsca client will encrypt the packets it sends ; to the nsca daemon. The encryption method you choose will be a balance between security and ; performance, as strong encryption methods consume more processor resources. ; You should evaluate your security needs when choosing an encryption method. ; ; Note: The encryption method you specify here must match the decryption method the nsca daemon uses ; (as specified in the nsca.cfg file)!! ; Values: ; 0 = None (Do NOT use this option) ; 1 = Simple XOR (No security, just obfuscation, but very fast) ; 2 = DES ; 3 = 3DES (Triple DES) ; 4 = CAST-128 ; 6 = xTEA ; 8 = BLOWFISH ; 9 = TWOFISH ; 11 = RC2 ; 14 = RIJNDAEL-128 (AES) ; 20 = SERPENT ;encryption_method=14 ; ;# ENCRYPTION PASSWORD ; This is the password/passphrase that should be used to encrypt the sent packets. ;password= ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to "one" local interface. ; -- not supported as of now -- ;bind_to_address= ; ;# LOCAL HOST NAME ; The name of this host (if empty "computername" will be used. ;hostname= ; ;# NAGIOS SERVER ADDRESS ; The address to the nagios server to submit results to. ;nsca_host=192.168.0.1 ; ;# NAGIOS SERVER PORT ; The port to the nagios server to submit results to. ;nsca_port=5667 ;

;# CHECK COMMAND LIST ; The checks to run everytime we submit results back to nagios ; Any command(alias/key) starting with a host_ is sent as HOST_COMMAND others are sent as SERVICE_COMMANDS ; where the alias/key is used as service name. ; [NSCA Commands] ;my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4 ;my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page ;my_svc_check=checkServiceState CheckAll exclude=wampmysqld exclude=MpfService ;host_check=check_ok

;# REMOTE NRPE PROXY COMMANDS ; A list of commands that check other hosts. ; Used by the NRPECLient module [NRPE Client Handlers] check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments

;# LUA SCRIPT SECTION ; A list of all Lua scripts to load. ;[LUA Scripts] ;scripts\test.lua

#69097

Bokas
Теперь смотрите вот Ваша ошибка:

text
[NSClient]
;# ALLOWED HOST ADDRESSES
;  This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon.
;  If you leave this blank the global version will be used instead.
allowed_hosts=109.87.xx.xx,178.94.xx.xx
;
;# NSCLIENT PORT NUMBER
;  This is the port the NSClientListener.dll will listen to.
port=12489
;
;# BIND TO ADDRESS
;  Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname.
;  Leaving this blank will bind to all avalible IP adresses.
;bind_to_address=
;
;# SOCKET TIMEOUT
;  Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
socket_timeout=30

[NRPE] ;# NRPE PORT NUMBER ; This is the port the NRPEListener.dll will listen to. port=5666 ; ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. ;command_timeout=60

Вот в этой части конфига, смотрим по строчкам не совпадения:
1.

text
 ;# NSCLIENT PORT NUMBER
;  This is the port the NSClientListener.dll will listen to. (порт для НСКлиента-так?)
port=12489

И тут же у Вас

text
[NRPE]
;# NRPE PORT NUMBER
;  This is the port the NRPEListener.dll will listen to. (открытый и назанченный порт для НРП)
port=5666

Не логично, Nagios использует проверку либо по клиенту, дибо по НРП, у Вас открыты обе возможности и по обоим портам идут пакеты, из-за этого у Вас в логах ошибки по портам.
Выберите для себя одну из нужных вам проверок и используйте её, на сервере Nagios я так понимаю, у Вас все пакеты установлены, так что просто на клиентах закоментируйте строку либо клиента либо нрп.
2.

text
;# SOCKET TIMEOUT
;  Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
socket_timeout=30

Закоментируйте этот параметр вообще.

Для начала пока это сделайте, не забывайте, что после каждого изменения необходимо сервис как Nagios, так и клиентов перезапускать.

#69590

Спасибо сегодня обязательно попробую и отпишу.

#69658

ничего не изменилось...

#69666

Это логи NSclient++ (запустил в тестовом режиме)

text
Launching test mode - client mode
Service seems to be started, this is probably not a good idea...
d NSClient++.cpp(1178) Enabling debug mode...
d NSClient++.cpp(551) Attempting to start NSCLient++ - 0.3.8.75 2010-05-27
d NSClient++.cpp(969) Loading plugin: CheckDisk...
d NSClient++.cpp(969) Loading plugin: Event log Checker....
d NSClient++.cpp(969) Loading plugin: Check External Scripts...
d NSClient++.cpp(969) Loading plugin: Helper function...
d NSClient++.cpp(969) Loading plugin: CheckSystem...
d NSClient++.cpp(969) Loading plugin: CheckTaskSched...
d \PDHCollector.cpp(73) Autodetected w2k or later, using w2k PDH counters.
d NSClient++.cpp(969) Loading plugin: CheckWMI...
d \PDHCollector.cpp(110) Using index to retrive counternames
d NSClient++.cpp(969) Loading plugin: File logger...
l \FileLogger.cpp(93) Log path is: C:\Program Files\NSClient++\\nsclient.log
d NSClient++.cpp(969) Loading plugin: LUAScript...
d NSClient++.cpp(969) Loading plugin: NRPE client (w/ SSL)...
d \NRPEClient.cpp(51) humm...
d \NRPEClient.cpp(53) check_other
d \PDHCollector.cpp(130) Found countername: CPU:    \??Y?(_total)\Y?Y?
d \PDHCollector.cpp(131) Found countername: UPTIME: \??Y?\??Y?
d \NRPEClient.cpp(86) Added NRPE Client: check_other = host: 192.168.0.1, port:
5666, timeout: 10, ssl: 1, buffer_length: 1024
d \PDHCollector.cpp(132) Found countername: MCL:    \??Y?\??Y?
d NSClient++.cpp(969) Loading plugin: NRPE server (w/ SSL)...
d \PDHCollector.cpp(133) Found countername: MCB:    \??Y?\??Y?
d \NRPEListener.cpp(91) Loading all commands (from NRPE)
[b]e \PDHCollector.cpp(140) Failed to open performance counters: \??Y?(_total)\Y?Y?
: PdhAddCounter failed: The specified object is not found on the system.   (C000
0BB8)[/b]
d \NRPEListener.cpp(121) Starting NRPE socket...
[b]d \PDHCollector.cpp(176) We aparently failed to load counters trying to use defa
ult (English) counters or those configured in nsc.ini[/b]
e \PDHCollector.cpp(185) Failed to open performance counters: \Memory\Commit Lim
it: PdhAddCounter failed: The specified object is not found on the system.   (C0
000BB8)
e \PDHCollector.cpp(219) No performance counters were found we will not wait for
 the end instead...
d NSClient++.cpp(969) Loading plugin: NSClient server...
d NSClient++.cpp(969) Loading plugin: SystemTray...
[b]e \Socket.h(677) bind failed: 10048: Only one usage of each socket address (prot
ocol/network address/port) is normally permitted.
e \Socket.h(677) bind failed: 10048: Only one usage of each socket address (prot
ocol/network address/port) is normally permitted.[/b]
e \SysTray.cpp(51) SysTray is not installed (or it cannot interact with the desk
top) SysTray won't be loaded. Run NSClient++ SysTray install to change this.
[b]e \Socket.h(708) Socket did not start properly, we will now do nothing...
e \Socket.h(708) Socket did not start properly, we will now do nothing..[/b].
d NSClient++.cpp(671) NSCLient++ - 0.3.8.75 2010-05-27 Started!
l NSClient++.cpp(455) Using settings from: INI-file
l NSClient++.cpp(456) Enter command to inject or exit to terminate...

#69710

Bokas
И так вот мой конфиг файла клиента на win2003 хосте:

text
[modules]
NSClientListener.dll
CheckWMI.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
;FileLogger.dll
;CheckSystem.dll
;CheckDisk.dll
;NSClientListener.dll
;NRPEListener.dll
;SysTray.dll
;CheckEventLog.dll
;CheckHelpers.dll
;CheckWMI.dll
;
; Script to check external scripts and/or internal aliases.
;CheckExternalScripts.dll
;
; NSCA Agent if you enable this NSClient++ will talk to NSCA hosts repeatedly (so dont enable unless you want to use NSCA)
;NSCAAgent.dll
;
; LUA script module used to write your own "check deamon".
;LUAScript.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll
; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
;NRPEClient.dll
; Extreamly early beta of a task-schedule checker
;CheckTaskSched.dll

[Settings] ;# OBFUSCATED PASSWORD ; This is the same as the password option but here you can store the password in an obfuscated manner. ; *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the ; password. Its just a bit harder to do it at first glance. ;obfuscated_password=Jw0KAUUdXlAAUwASDAAB ; ;# PASSWORD ; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly. ;password=secret-password ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons. ; If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password). ; The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access ;allowed_hosts=127.0.0.1/32 ; ;# USE THIS FILE ; Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1 ; the registry will be used instead. use_file=1 allowed_hosts=IP server Nagios password=password1 ; ; # USE SHARED MEMORY CHANNELS ; This is the "new" way for using the system tray based on an IPC framework on top shared memmory channels and events. ; It is brand new and (probably has bugs) so dont enable this unless for testing! ; If set to 1 shared channels will be created and system tray icons created and such and such... ;shared_session=0

[log] ;# LOG DEBUG ; Set to 1 if you want debug message printed in the log file (debug messages are always printed to stdout when run with -test) ;debug=1 ; ;# LOG FILE ; The file to print log statements to ;file=nsclient.log ; ;# LOG DATE MASK ; The format to for the date/time part of the log entry written to file. ;date_mask=%Y-%m-%d %H:%M:%S ; ;# LOG ROOT FOLDER ; The root folder to use for logging. ; exe = the folder where the executable is located ; local-app-data = local application data (probably a better choice then the old default) ;root_folder=exe

[NSClient] ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. ; If you leave this blank the global version will be used instead. ;allowed_hosts= ; ;# NSCLIENT PORT NUMBER ; This is the port the NSClientListener.dll will listen to. ;port=12489 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ;bind_to_address= ; ;# SOCKET TIMEOUT ; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out. ;socket_timeout=30

[NRPE] ;# NRPE PORT NUMBER ; This is the port the NRPEListener.dll will listen to. ;port=5666 ; ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. ;command_timeout=60 ; ;# COMMAND ARGUMENT PROCESSING ; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. ;allow_arguments=0 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;allow_nasty_meta_chars=0 ; ;# USE SSL SOCKET ; This option controls if SSL should be used on the socket. ;use_ssl=1 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ; bind_to_address= ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NRPE deamon. ; If you leave this blank the global version will be used instead. ;allowed_hosts= ; ;# SCRIPT DIRECTORY ; All files in this directory will become check commands. ; *WARNING* This is undoubtedly dangerous so use with care! ;script_dir=scripts\ ; ;# SOCKET TIMEOUT ; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out. ;socket_timeout=30

[Check System] ;# CPU BUFFER SIZE ; Can be anything ranging from 1s (for 1 second) to 10w for 10 weeks. Notice that a larger buffer will waste memory ; so don't use a larger buffer then you need (ie. the longest check you do +1). ;CPUBufferSize=1h ; ;# CHECK RESOLUTION ; The resolution to check values (currently only CPU). ; The value is entered in 1/10:th of a second and the default is 10 (which means ones every second) ;CheckResolution=10 ; ;# CHECK ALL SERVICES ; Configure how to check services when a CheckAll is performed. ; ...=started means services in that class *has* to be running. ; ...=stopped means services in that class has to be stopped. ; ...=ignored means services in this class will be ignored. ;check_all_services[SERVICE_BOOT_START]=ignored ;check_all_services[SERVICE_SYSTEM_START]=ignored ;check_all_services[SERVICE_AUTO_START]=started ;check_all_services[SERVICE_DEMAND_START]=ignored ;check_all_services[SERVICE_DISABLED]=stopped

[External Script] ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. ;command_timeout=60 ; ;# COMMAND ARGUMENT PROCESSING ; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. ;allow_arguments=0 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;allow_nasty_meta_chars=0 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. ;script_dir=c:\my\script\dir

[External Scripts] ;check_es_long=scripts\long.bat ;check_es_ok=scripts\ok.bat ;check_es_nok=scripts\nok.bat ;check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs ;check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -

[External Alias] alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED alias_service=checkServiceState CheckAll alias_process=checkProcState $ARG1$=started alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical alias_up=checkUpTime MinWarn=1d MinWarn=1h alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%" alias_file_size=checkFile2 filter=out "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_file_size_in_dir=checkFile2 filter=out pattern=*.txt "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_event_log=CheckEventLog file=application file=system filter=new filter=out MaxWarn=1 MaxCrit=1 filter-generated=>2d filter-severity==success filter-severity==informational truncate=1023 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" alias_event_log2=CheckEventLog file=application file=system filter=new filter=in MaxWarn=1 MaxCrit=1 filter+generated=<2d "filter+eventSource==Service Control Manager" filter+severity==error truncate=1023 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" check_ok=CheckOK Everything is fine!

; [includes] ;# The order when used is "reversed" thus the last included file will be "first" ;# Included files can include other files (be carefull only do basic recursive checking) ; ; myotherfile.ini ; real.ini

[NSCA Agent] ;# CHECK INTERVALL (in seconds) ; How often we should run the checks and submit the results. ;interval=5 ; ;# ENCRYPTION METHOD ; This option determines the method by which the send_nsca client will encrypt the packets it sends ; to the nsca daemon. The encryption method you choose will be a balance between security and ; performance, as strong encryption methods consume more processor resources. ; You should evaluate your security needs when choosing an encryption method. ; ; Note: The encryption method you specify here must match the decryption method the nsca daemon uses ; (as specified in the nsca.cfg file)!! ; Values: ; 0 = None (Do NOT use this option) ; 1 = Simple XOR (No security, just obfuscation, but very fast) ; 2 = DES ; 3 = 3DES (Triple DES) ; 4 = CAST-128 ; 6 = xTEA ; 8 = BLOWFISH ; 9 = TWOFISH ; 11 = RC2 ; 14 = RIJNDAEL-128 (AES) ; 20 = SERPENT ;encryption_method=14 ; ;# ENCRYPTION PASSWORD ; This is the password/passphrase that should be used to encrypt the sent packets. ;password= ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to "one" local interface. ; -- not supported as of now -- ;bind_to_address= ; ;# LOCAL HOST NAME ; The name of this host (if empty "computername" will be used. ;hostname= ; ;# NAGIOS SERVER ADDRESS ; The address to the nagios server to submit results to. ;nsca_host=192.168.0.1 ; ;# NAGIOS SERVER PORT ; The port to the nagios server to submit results to. ;nsca_port=5667 ;

;# CHECK COMMAND LIST ; The checks to run everytime we submit results back to nagios ; Any command(alias/key) starting with a host_ is sent as HOST_COMMAND others are sent as SERVICE_COMMANDS ; where the alias/key is used as service name. ; [NSCA Commands] ;my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4 ;my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page ;my_svc_check=checkServiceState CheckAll exclude=wampmysqld exclude=MpfService ;host_check=check_ok

;# REMOTE NRPE PROXY COMMANDS ; A list of commands that check other hosts. ; Used by the NRPECLient module [NRPE Client Handlers] check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments

;# LUA SCRIPT SECTION ; A list of all Lua scripts to load. ;[LUA Scripts] ;scripts\test.lua

Так же ставлю акцент на вот этот блок:

text
;# PASSWORD
;  This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.
;password=secret-********

Тут вместо звёздочек должен быть Ваш пароль, для аунтификации клиента на сервере. Проверте, завели ли Вы вообще пароль и совпадают ли они?

з.ы. Сравните файлы, при беглом просмотре я обнаружил кучу раскоментированных строк в Вашем конфиги, самом первом блоке, проверьте всё доскональна.

#69973

Чет я не пойму oO , а это не надо раскоментировать ?

text

;FileLogger.dll
;CheckSystem.dll
;CheckDisk.dll
;NSClientListener.dll
;NRPEListener.dll
;SysTray.dll
;CheckEventLog.dll
;CheckHelpers.dll
;CheckWMI.dll

у Вас тут все закоментировано... Это конфиг сразу же после установки NSclient ++. Объясните пожалуйста.

#69977

Bokas

у Вас тут все закоментировано... Это конфиг сразу же после установки NSclient ++. Объясните пожалуйста.

Да сразу после установки, я его не изменял. Про то что всё закоментировано, это действительно так, по идеи там много то и не нужно, у Вас должны быть открыты строки: порта проверки, IP сервера, пароля и коды проверки. Ну может ещё пару строчек, а у Вас идёт ещё подгрузка каких до .dll. Не вижу смсла в них, так как их можно будет подключить посже, после того как наладится связь между сервером и клиентом.

Меня больше пугает вот это:

text
;# ALLOWED HOST ADDRESSES
;  This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons.
;  If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password).
;  The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access
allowed_hosts=109.87.xx.xx/24,178.94.2x.xx/24

Что Вы тут понаписали? Открыли 2м сетям доступ к клиенту? Полностью сетям oO Зачем??? Проще было вообще ничего тут не указывать и Вы бы были доступны всем. По хорошему тут нужно указать ваш localhost - 127.0.... и так далее, смотрите мой конфиг.
А уже в следующем блоке:

text
;# USE THIS FILE
;  Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1 
;  the registry will be used instead.
use_file=1
allowed_hosts=109.87.138.192,178.94.22.30
password=1q2w3e

Вот у меня как:

text
allowed_hosts=IP server Nagios
password=password1

У Вас что 2 сервера?? oO тут вот allowed_hosts=IP server Nagios вместо надписи IP server Nagios укажите сам IP сервера и всё.

#70000

Использую вот эту NSclient++ 0.3.8-win32.msi Какая у Вас ?

Войдите или зарегистрируйтесь, чтобы ответить.