Nagios 3 - пара вопросов

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС для молодых и начинающих системных администраторов.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
Katochimoto
Сообщения: 88
ОС: Ubuntu 9.04

Nagios 3 - пара вопросов

Сообщение Katochimoto »

Есть настроенный Nagios 3.0.6 на Ubuntu server 9.04.
Все отлично мониторит - и юниксы, и винду, за исключением Server 2к8 x64. Nsclient установил, подправил все необходимые настройки, но работать не хочет. Nagios отображает только пинги, команды check_nt - Critical.

Кто сталкивался - что может быть?

Второй вопрос: как прикрутить мониторинг демонов в юниксе?

На винде это PROCSTATE или SERVICESTATE по необходимости. А в юниксе как?

Последнее: есть машина под управление Suse. На ней необходимо мониторить раздел. Обычно с этим проблем не возникало, но здесь требуемый раздел является storage. На что выдает "no such file or directiry". Какие варианты?
Спасибо сказали:
dr-evil
Сообщения: 159
ОС: Fedora 18

Re: Nagios 3 - пара вопросов

Сообщение dr-evil »

firewall?
телнетится на нсклиент?
Анализ подозрительных файлов тут
Все что вы скажете может быть использовано как баян.
Jabber-конференция: sysadmins.ru на conference.jabber.ru - всем добро пожаловать!
Спасибо сказали:
Аватара пользователя
Katochimoto
Сообщения: 88
ОС: Ubuntu 9.04

Re: Nagios 3 - пара вопросов

Сообщение Katochimoto »

Да, дело оказалось именно в фверволле. Теперь мониторит исправно. Но оставшиеся 2 вопроса еще актуальны.
Спасибо сказали:
dr-evil
Сообщения: 159
ОС: Fedora 18

Re: Nagios 3 - пара вопросов

Сообщение dr-evil »

смотрите в сторону check_snmp_storage/check_snmp и т.п.
Анализ подозрительных файлов тут
Все что вы скажете может быть использовано как баян.
Jabber-конференция: sysadmins.ru на conference.jabber.ru - всем добро пожаловать!
Спасибо сказали:
Аватара пользователя
Katochimoto
Сообщения: 88
ОС: Ubuntu 9.04

Re: Nagios 3 - пара вопросов

Сообщение Katochimoto »

Я виндовые сервера нсклиентом смотрю, линуксы вообще в клиентской части не нуждаются. Не хотел с снмп возиться, но, видимо, придется...
Небольшое уточнение нужные разделы - это рейдовый массив.
Спасибо сказали:
Аватара пользователя
Katochimoto
Сообщения: 88
ОС: Ubuntu 9.04

Re: Nagios 3 - пара вопросов

Сообщение Katochimoto »

# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
CHECK_NRPE: Error - Could not complete SSL handshake.
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users -n
CHECK_NRPE: Error receiving data from daemon.

Как побороть?
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

Katochimoto писал(а): ↑
05.06.2009 15:33
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
CHECK_NRPE: Error - Could not complete SSL handshake.
# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users -n
CHECK_NRPE: Error receiving data from daemon.

Как побороть?

1 Вопрос:
http://www.nagios.org/faqs/viewfaq.php?faq_id=191
По второму вопросу скорее всего проблема с правами на плагины.
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

У меня возникло также пару вопросов по работе NSClient.Нагиос отображает неверное значение ОЗУ.На самом деле на виртуальную машину выделено 268Мб ОЗУ,но Нагиос дает такие результаты:

Код: Выделить всё

Memory usage: total:713.68 Mb - used: 157.17 Mb (22%) - free: 556.50 Mb (78%)

Также не могу мониторить диск C:\ пишеться ошибка:

Код: Выделить всё

wrong -l argument

В это же время служба определена:

Код: Выделить всё

define service{
        use                     generic-service
        host_name                       work_virtual
        service_description     C:\ Drive Space
        [color="#8B0000"]check_command           check_nt!USEDDISKSPACE!-l с -w 80 -c 90[/color]
        }

Также не мониторится сервис и процессы:

Код: Выделить всё

snmp.exe: not running

Но служба snmp работает...

Код: Выделить всё

define service{
        use                     generic-service
        host_name                       work_virtual
        service_description     SNMP
        check_command           check_nt!PROCSTATE!-l snmp.exe
        }

Кто знает как решить грабли?
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

Ребята,никто не знает как побороть?
Спасибо сказали:
rus06
Сообщения: 4
ОС: W7b

Re: Nagios 3 - пара вопросов

Сообщение rus06 »

Народ такая же беда
Кто может подсказать новичку:
В общем в Ubuntu 9.04 установил нагиос 3 локально веб интерфес показал что все работает (сеть у него 192.168.55.10) в том же VLan настроил на тестовых винсерваках NSClient++ сеть одна (пример 192.168.55.х), тоже все показатели нормально.
Хочу подключить другой сервак, у него IP 192.168.18.2 настроил NSClient аналогично тестовым при просмотре через web-bynthatqc выдает мне статус "WARNING" "could not fetch information from server" порты 5666 и 12489 с этого винсервака открыты, телнетом с Ubuntu на указанные порты захожу.
Кто может подсказать, в линуксе не селен, учусь.
Как можно это исправить?
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

А если в плагине check_nt добавить ключ -s и указать пароль?
Спасибо сказали:
rus06
Сообщения: 4
ОС: W7b

Re: Nagios 3 - пара вопросов

Сообщение rus06 »

Burger писал(а): ↑
22.07.2009 16:15
А если в плагине check_nt добавить ключ -s и указать пароль?



Вот кстати на счет него седня я гдето прочитал терь немогу найти ссылку.
Вопрос, где он находится и обязательно ли указывать -s
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

Пароль,это вроде как пароль админа на удаленном хосте,указать его можно только с помощью опции -s.
Юзай хелп по плагину
check_nt -h
Спасибо сказали:
rus06
Сообщения: 4
ОС: W7b

Re: Nagios 3 - пара вопросов

Сообщение rus06 »

Ну в общем ситуация прежняя
сделал все по инструкции как сказано в статейке http://www.xakep.ru/magazine/xa/118/136/1.asp
$ sudo nano /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 \
-s password -v $ARG1$ $ARG2$
}
указал ключик, ранее я его оказывается обходил, т.е. пароль не указывал, теперь указал.

вот инишка с NSClient-a

Код: Выделить всё

[modules]
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
CheckWMI.dll

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=LJKHnmnkhllKLJLklkj
;
;# 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=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=192.168.77.49/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
;
; # 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=192.168.77.49/255.255.255.0
;
;# 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=192.168.18.9
;
;# 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=192.168.18.9
;
;# 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=192.168.77.49/255.255.255.0
;
;# 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%)"

; [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=192.168.18.9
;
;# LOCAL HOST NAME
;  The name of this host (if empty "computername" will be used.
hostname=winserver
;
;# NAGIOS SERVER ADDRESS
;  The address to the nagios server to submit results to.
nsca_host=192.168.77.49
;
;# 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

[NRPE Handlers]
;# COMMAND DEFINITIONS
;# Command definitions that this daemon will run.
;# Can be either NRPE syntax:
;command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
;# Or simplified syntax:
;test=c:\test.bat foo $ARG1$ bar
;check_disk1=/usr/local/nagios/libexec/check_disk -w 5 -c 10
;# Or even loopback (inject) syntax (to run internal commands)
;# This is a way to run "NSClient" commands and other internal module commands

such as check eventlog etc.
;check_cpu=inject checkCPU warn=80 crit=90 5 10 15
;check_eventlog=inject CheckEventLog Application warn.require.eventType=error

warn.require.eventType=warning critical.require.eventType=error

critical.exclude.eventType=info truncate=1024 descriptions
;check_disk_c=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M

File:WIN=c:\ATI\*.*
;# But be careful:
; dont_check=inject dont_check This will "loop forever" so be careful with the

inject command...
;# Check some escapings...
; check_escape=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M "File:

foo \" WIN=c:\\WINDOWS\\*.*"
;# Some real world samples
;nrpe_cpu=inject checkCPU warn=80 crit=90 5 10 15
;nrpe_ok=scripts\ok.bat
;check_multi_line=scripts\multi_line.bat
;#
;# The sample scripts
;#
;check_long=scripts\long.bat
;check_ok=scripts\ok.bat
;check_nok=scripts\xlong.bat
;check_vbs=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs

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

iУведомление от модератора Ленивая Бестолочь
для оформления листингов используйте тег code
Спасибо сказали:
Аватара пользователя
Burger
Сообщения: 122
Статус: LOL
ОС: RHEL\CentOS

Re: Nagios 3 - пара вопросов

Сообщение Burger »

http://system-administrators.info/?p=3087
Читай,там все описано про пароль.
Спасибо сказали:
dinamo99
Сообщения: 1
ОС: Debian Etch

Re: Nagios 3 - пара вопросов

Сообщение dinamo99 »

Ошибка:
С главного сервера (11.11.11.11)
/usr/lib/nagios/plugins/check_nrpe -H 22.22.22.22
CHECK_NRPE: Error - Could not complete SSL handshake.

Возможная причина:
На машине которую будем мониторить (22.22.22.22) в файле nrpe.cfg проверьте наличие следующей сторики:
allowed_hosts=127.0.0.1,11.11.11.11

P.S. Заметьте что между ip-адресами стоит только запятая без никаких пробелов.
Спасибо сказали: