Re: Nagios
Добавлено: 2008-09-06 21:37:55
Почему то всё так же, оображается Service Status Types: Warning ( А UP горит зелёным...Немогу исправить почему - то может кто подскажет..Какие конфиги скинуть?
Иногда, правильный удар в бубен, приводит в чувство целое племя...
https://forum.lissyara.su/
Код: Выделить всё
# 'check_rrcp' command definition
define command{
command_name check_rrcp
command_line sudo $USER1$/check_rrcp -H $_HOSTMAC_ADDRESS$ -I eth0.1 --authkey=2379
}
Код: Выделить всё
define host{
use generic-compax
display_name 43Армии5
host_name armii
alias armii Switch
_mac_address 00:80:48:57:51:C3
hostgroups armii
with
}
Код: Выделить всё
define service{
use generic-service
host_name armii
display_name lalala
service_description compax_ping
check_command check_rrcp
normal_check_interval 5
retry_check_interval 1
}
http://nagios.sourceforge.net/docs/3_0/beginners.htmlCongratulations on choosing Nagios! Nagios is quite powerful and flexible, but it can take a lot of work to get it configured just the way you'd like. Once you become familiar with how it works and what it can do for you, you'll never want to be without it. :-)
Угу, тоже гемор с настройкой не понравилсяRusBiT писал(а):Имхо nagios показался очень трудной системой. Люблю когда все из веб морды делается
А с мылом то какие проблемы, просто в шаблон пропиши свое мыло да и все, а вот аську пока не пробовал, может ближе к выходным помучаю, а так вот накатал тут немного по начальному конфигурированию.Lycane писал(а):А кто нитЬ знает как заставитЬ эту штуку дудетЬ в асЬку и на инетовское мыло?
А не могли бы вы показатЬ как у вас выглядит конфиг команды оповещения на мыло?f_andrey писал(а):просто в шаблон пропиши свое мыло да и все
Да по дефолту шас для эксперемента поправил, /usr/local/etc/nagios/objects/contacts.cfg строчку сLycane писал(а):А не могли бы вы показатЬ как у вас выглядит конфиг команды оповещения на мыло?
и все заработало, ну почти вот кусок лога.email *****@gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
Но реально на гугл письмо не дошло видно из за похожести на спам шас попробую как нибудь или туда или на яндекс протолкнуть, а вообше там по сути исполняется команда типа/var/log/maillog писал(а):Sep 17 22:22:27 andrey sm-mta[58245]: m8HIMMhW058243: to=<******@gmail.com>, ctladdr=<nagios@andrey.local> (181/181), delay=00:00:05, xdelay=00:00:05, mailer=esmtp, pri=30633, relay=gmail-smtp-in.l.google.com. [209.85.135.27], dsn=5.0.0, stat=Service unavailable
Код: Выделить всё
echo "body" | /usr/bin/mail -s "test" ****@gmail.com
Так что если хочется кудато отправлять алармы, то или заводим свой открытый релей или ишем чужой, или настраиваем локальный почтовик который будет релеить, ну или обучаем нагиос работать с авторизацией, в файле /usr/local/etc/nagios/objects/commands.cfg как пока не скажу или ждем или сами спрашиваем гугла.From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <200809171822.m8HIMRhW058245@andrey.local>
To: <nagios@andrey.local>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="m8HIMRhW058245.1221675747/andrey.local"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message
--m8HIMRhW058245.1221675747/andrey.local
The original message was received at Wed, 17 Sep 2008 22:22:22 +0400 (MSD)
from localhost [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<****@gmail.com>
(reason: 550-5.7.1 [89.110.30.223] The IP you're using to send mail is not authorized)
Ну так вот просто не опишешь...GLOG писал(а):Люди мот кто поможет по Nagios 3.0.3?!Именно по 3 в интернете очень мало информации. Поставил fedory, apache, все дела, установил Nagios по мануалу с оффициального сайта, веб интерфейс грузиться но ссылки не работают, а когда запускаю проверку конфигурационных файлов (/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg) выдает кучу ошибок, мучаюсь не могу понять как описать(localhost.cfg, contacts.cfg) опишите кто поподробнее и выложите если свои конфиг файлы. Заранее премного БЛАГОДАРЕН!
Код: Выделить всё
# You can specify individual object config files as shown below:
cfg_file=/usr/local/etc/nagios/objects/commands.cfg
cfg_file=/usr/local/etc/nagios/objects/contacts.cfg
cfg_file=/usr/local/etc/nagios/objects/timeperiods.cfg
cfg_file=/usr/local/etc/nagios/objects/templates.cfg
# Definitions for monitoring hosts
#cfg_file=/usr/local/etc/nagios/objects/hosts.cfg
# Definitions for monitoring a router/switch
#cfg_file=/usr/local/etc/nagios/objects/switch.cfg
# Definitions for monitoring a network printer
#cfg_file=/usr/local/etc/nagios/objects/printer.cfg
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
cfg_dir=/usr/local/etc/nagios/servers
#cfg_dir=/usr/local/etc/nagios/printers
#cfg_dir=/usr/local/etc/nagios/switches
cfg_dir=/usr/local/etc/nagios/routers
Код: Выделить всё
define host{
use generic-switch
host_name 01-XXXX
parents 00-YYYY
2d_coords 30_coord,20_coord
alias Cisco 1760V
address 10.71.255.1
hostgroups switches
}
define service{
use generic-service
host_name 01-XXXX
service_description PING
check_command check_ping!200.0,20%!600.0,60%
normal_check_interval 5
retry_check_interval 1
}
define service{
use generic-service
host_name 01-XXXX
service_description Uptime
check_command check_snmp!public!sysUpTime.0
}
Код: Выделить всё
define hostgroup{
hostgroup_name routers ; The name of the hostgroup
alias My Routers ; Long name of the group
members 01-XXXX
}
Код: Выделить всё
root@IPPROTECT:xxxx/xxxx/xx# ./check_rrcp -I eth0 -H 00:80:48:5x:xb:x5
RRCP OK: Reply from 00:80:48:5x:xB:x5, time 0.96 ms
Код: Выделить всё
Error: Invalid host object directive '_mac_address2'.
Error: Could not add object property in file '/usr/local/nagios/etc/localhost.cfg' on line 186.
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
Код: Выделить всё
# 'check_rrcp' command definition
define command{
command_name check_rrcp
command_line check_rrcp -I eth0 -H $_HOSTMAC_ADDRESS2$
}
Код: Выделить всё
###############################################################################################
# #
# compex_ps2216 #
# #
###############################################################################################
define service{
use generic-service
host_name kgb33
service_description arping
check_command check_rrcp
normal_check_interval 5
retry_check_interval 1
}
###############################################################################################
Код: Выделить всё
define hostgroup{
hostgroup_name kgb
alias kgb
members kgb33
}
Код: Выделить всё
##############################################################################
#
# Compex_ps2216
#
##############################################################################
define host{
use linux-server
#display_name КГБ33
host_name kgb33
alias kgb switch
_mac_address2 00:80:48:5a:3b:45
}
Код: Выделить всё
Error: Invalid host object directive '_mac_address2'.
Error: Could not add object property in file '/usr/local/nagios/etc/localhost.cfg' on line 186.