Re: Ndoutils e problemas de performance

Leonardo Neves <[email protected]>
Newsgroups gmane.network.nagios.user.brazil
Message-ID <[email protected]>
Eu acho que algum dos patches do nagios, disponibilizados pelo pessoal do
opsview, deve resolver o problema:
http://trac.opsview.org/browser/tags/release-3.0.0/opsview-base/Makefile#L238
http://opsview-blog.opsera.com/dotorg/nagios/

Ainda nao tive tempo para testar.

Atenciosamente,
Leonardo Neves Bernardo
Linux/Unix Specialist
LPIC3 (core+mixed environment+security) + RHCT



2009/5/15 Marcel <[email protected]>

> amigos, o ndo2db + ndomod são blocantes ao nagios (o nagios espera o
> retorno
> do mod, e se o banco demora, o mod demora e o nagios demora), tentem
> desacoplar o input ao banco de dados. sei que pode ser feito, mas ninguém
> diz como. ;)
>
> 2009/5/12 Leonardo Neves <[email protected]>
>
> > Cristiano,
> >
> > Tenho um ambiente bem parecido, atualmente sao 4300 services e os mesmos
> > problemas de performance acontecem com o ndoutil. Pelo que li, ele
> > realmente
> > eh sequencial. Quando eh necessario um reload o nagios ainda tem que
> > atualizar todos os dados no mysql antes do nagvis ficar disponivel.
> > Pelo jeito a solucao eh esperar uma alternativa ao ndoutil ou uma
> correçao
> > do mesmo.
> >
> > A unica coisa que fiz e que voce nao fez ainda eh agendar manutencao
> diaria
> > no bd:
> > db=nagios
> > echo "USE $db; DELETE FROM nagios_servicechecks WHERE start_time <=
> (NOW()
> > -
> > INTERVAL 1 DAY)" | mysql $MYSQL_LOGIN >/dev/null
> > echo "USE $db; DELETE FROM nagios_hostchecks WHERE start_time <= (NOW() -
> > INTERVAL 1 DAY)" | mysql $MYSQL_LOGIN >/dev/null
> >
> > for db in $(echo "SHOW DATABASES;" | mysql $MYSQL_LOGIN | grep -v -e
> > "Database" -e "information_schema" -e "test")
> > do
> >        TABLES=$(echo "USE $db; SHOW TABLES;" | mysql $MYSQL_LOGIN |  grep
> > -v Tables_in_)
> >        echo "Switching to database $db"
> >        for table in $TABLES
> >        do
> >                echo -n " * Optimizing table $table ... "
> >                echo "USE $db; OPTIMIZE TABLE $table" | mysql $MYSQL_LOGIN
> > >/dev/null
> >                echo "done."
> >        done
> > done
> >
> > As tabelas nagios_servicechecks e nagios_hostchecks sao apenas de
> historico
> > e os dados antigos podem ser deletados ja que os logs ja tem a
> informacao.
> >
> > Se voce teve algum progresso, favor nos reportar.
> >
> > Atenciosamente,
> > Leonardo Neves Bernardo
> > Linux/Unix Specialist
> > LPIC3 (core+mixed environment+security) + RHCT
> >
> >
> >
> > 2009/5/7 Cristiano Casado <[email protected]>
> >
> > > Olá a todos.
> > >
> > > Estou utilizando em ambiente de laboratório o Nagios 3.0.6 com ndoutils
> > > 1.4b7 e MySQL 5.0 em uma máquina Linux CentOS 5.2 (2.6.18) x64 com 2GB
> > ram
> > > e
> > > processador Intel Xeon 2.50GHz.
> > > Optei em utilizar o ndoutils para manter informacoes históricas de
> checks
> > > no
> > > banco de dados (tables nagios_servicechecks e nagios_hostcheks), assim
> > como
> > > utilizar o NagVis para representacao gráfica das minhas redes.
> > >
> > > Os testes funcionais foram bons, porém cheguei ao ponto do projeto em
> que
> > > tive que fazer um benchmark com um número de 7.000 services, simulando
> o
> > > que
> > > vou encontrar em ambiente de producao.
> > >
> > > Carregando o broker ndomod porém sem executar o daemon ndo2db consigo
> uma
> > > performance boa de service checks com quase 95% dos services sendo
> > > processados na janela de 5 min e com uma latência de check baixa.
> > > Importante
> > > ressaltar que todos os services são ativos (não passivos) com
> > > check_interval
> > > de 5 minutos.
> > >
> > > Ao executar o daemon ndo2db, onde o mesmo inicializa o socket unix e
> > comeca
> > > as operacoes em banco de dados, percebo uma perda considerável de
> > > performance do service check com apenas 9% dos services sendo
> processados
> > > na
> > > janela de 5 min, latência alta de checks e o contador de iowait da CPU
> > > entre
> > > 90% e 100%.  Services que deveriam ser processados pelo daemon do
> Nagios
> > em
> > > 5 min são processados com delay de até 1 hora, o que inviabiliza a
> > solucao
> > > como ferramenta de monitoracao.
> > >
> > > Como o MySQL está na mesma máquina, fiz o tunning nele (buffer,
> threads,
> > > etc), apliquei índices adicionais as tabelas e testei passando as
> tabelas
> > > do
> > > database nagios para o esquema "blackhole".  Desta forma o banco aceita
> > > conexões e operacoes (select, insert, delete, ...) porém não grava os
> > dados
> > > em disco.  O iowait continuou alto e a performance ruim.  Não desconfio
> > > mais
> > > do banco de dados.
> > >
> > > Percebi que o daemon do ndo2db utiliza apenas 1 conexão com o banco de
> > > dados
> > > para fazer diversas operacoes por segundo, sendo que cada operacao
> > aguarda
> > > o
> > > final da execucao anterior. O que particularmente acho ruim.
> > >
> > > Pergunta:  alguém utiliza as facilidades do ndoutils com banco de dados
> > em
> > > grande instalacoes do Nagios ( >1500 hosts  >7000 services) e que não
> > tenha
> > > estes problemas de performance para me dar uma luz ?
> > >
> > > As configuracoes do Nagios estão abaixo.
> > > Segui algumas recomendacoes de tunning para o Nagios do documento
> > > http://nagios.sourceforge.net/docs/3_0/tuning.html
> > >
> > >
> > > Obrigado.
> > > Cristiano Casado.
> > >
> > >
> > > ### Nagios Config ###
> > > log_file=/var/log/nagios/nagios.log
> > > object_cache_file=/var/nagios/objects.cache
> > > precached_object_file=/var/nagios/objects.precache
> > > resource_file=/etc/nagios/resource.cfg
> > > status_file=/var/nagios/status/status.dat
> > > status_update_interval=10
> > > nagios_user=nagios
> > > nagios_group=nagios
> > > check_external_commands=1
> > > command_check_interval=15s
> > > command_file=/var/nagios/rw/nagios.cmd
> > > external_command_buffer_slots=4096
> > > lock_file=/var/run/nagios.pid
> > > temp_file=/var/nagios/nagios.tmp
> > > temp_path=/tmp
> > > event_broker_options=-1
> > > broker_module=/usr/libexec/ndomod-3x.o
> config_file=/etc/nagios/ndomod.cfg
> > > log_rotation_method=d
> > > log_archive_path=/var/log/nagios/archives
> > > use_syslog=1
> > > log_notifications=1
> > > log_service_retries=1
> > > log_host_retries=1
> > > log_event_handlers=1
> > > log_initial_states=0
> > > log_external_commands=1
> > > log_passive_checks=1
> > > service_inter_check_delay_method=s
> > > max_service_check_spread=30
> > > service_interleave_factor=s
> > > host_inter_check_delay_method=s
> > > max_host_check_spread=30
> > > max_concurrent_checks=0
> > > check_result_reaper_frequency=5
> > > max_check_result_reaper_time=5
> > > check_result_path=/var/nagios/spool/checkresults
> > > max_check_result_file_age=3600
> > > cached_host_check_horizon=30
> > > cached_service_check_horizon=60
> > > enable_predictive_host_dependency_checks=1
> > > enable_predictive_service_dependency_checks=1
> > > soft_state_dependencies=0
> > > auto_reschedule_checks=0
> > > auto_rescheduling_interval=30
> > > auto_rescheduling_window=180
> > > sleep_time=0.25
> > > service_check_timeout=60
> > > host_check_timeout=30
> > > event_handler_timeout=30
> > > notification_timeout=30
> > > ocsp_timeout=5
> > > perfdata_timeout=5
> > > retain_state_information=1
> > > state_retention_file=/var/nagios/retention.dat
> > > retention_update_interval=60
> > > use_retained_program_state=1
> > > use_retained_scheduling_info=1
> > > retained_host_attribute_mask=0
> > > retained_service_attribute_mask=0
> > > retained_process_host_attribute_mask=0
> > > retained_process_service_attribute_mask=0
> > > retained_contact_host_attribute_mask=0
> > > retained_contact_service_attribute_mask=0
> > > interval_length=60
> > > use_aggressive_host_checking=0
> > > execute_service_checks=1
> > > accept_passive_service_checks=1
> > > execute_host_checks=1
> > > accept_passive_host_checks=1
> > > enable_notifications=1
> > > enable_event_handlers=1
> > > process_performance_data=0
> > > obsess_over_services=0
> > > obsess_over_hosts=0
> > > translate_passive_host_checks=0
> > > passive_host_checks_are_soft=0
> > > check_for_orphaned_services=1
> > > check_for_orphaned_hosts=1
> > > check_service_freshness=1
> > > service_freshness_check_interval=60
> > > check_host_freshness=0
> > > host_freshness_check_interval=60
> > > additional_freshness_latency=15
> > > enable_flap_detection=1
> > > low_service_flap_threshold=5.0
> > > high_service_flap_threshold=20.0
> > > low_host_flap_threshold=5.0
> > > high_host_flap_threshold=20.0
> > > date_format=us
> > > p1_file=/usr/bin/p1.pl
> > > enable_embedded_perl=1
> > > use_embedded_perl_implicitly=1
> > > illegal_object_name_chars=`~!$%^&*|'"<>?,()=
> > > illegal_macro_output_chars=`~$&|'"<>
> > > use_regexp_matching=0
> > > use_true_regexp_matching=0
> > > admin_email=nagios@localhost
> > > admin_pager=pagenagios@localhost
> > > daemon_dumps_core=0
> > > use_large_installation_tweaks=1
> > > enable_environment_macros=0
> > > debug_level=0
> > > debug_verbosity=1
> > > debug_file=/var/log/nagios/nagios.debug
> > > max_debug_file_size=1000000
> > > cfg_file=/etc/nagiosql/commands.cfg
> > > cfg_file=/etc/nagiosql/contactgroups.cfg
> > > cfg_file=/etc/nagiosql/contacts.cfg
> > > cfg_file=/etc/nagiosql/contacttemplates.cfg
> > > cfg_file=/etc/nagiosql/hostdependencies.cfg
> > > cfg_file=/etc/nagiosql/hostescalations.cfg
> > > cfg_file=/etc/nagiosql/hostextinfo.cfg
> > > cfg_file=/etc/nagiosql/hostgroups.cfg
> > > cfg_dir=/etc/nagiosql/hosts
> > > cfg_file=/etc/nagiosql/hosttemplates.cfg
> > > cfg_file=/etc/nagiosql/servicedependencies.cfg
> > > cfg_file=/etc/nagiosql/serviceescalations.cfg
> > > cfg_file=/etc/nagiosql/serviceextinfo.cfg
> > > cfg_file=/etc/nagiosql/servicegroups.cfg
> > > cfg_dir=/etc/nagiosql/services
> > > cfg_file=/etc/nagiosql/servicetemplates.cfg
> > > cfg_file=/etc/nagiosql/timeperiods.cfg
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > The NEW KODAK i700 Series Scanners deliver under ANY circumstances!
> Your
> > > production scanning environment may not be a perfect world - but thanks
> > to
> > > Kodak, there's a perfect scanner to get the job done! With the NEW
> KODAK
> > > i700
> > > Series Scanner you'll get full speed at 300 dpi even with all image
> > > processing features enabled. http://p.sf.net/sfu/kodak-com
> > > --
> > > [email protected] mailing list
> > > https://lists.sourceforge.net/lists/listinfo/nagios-users-br
> > > Wiki: http://nagios-br.sf.net/wiki
> > >
> >
> >
> ------------------------------------------------------------------------------
> > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> > production scanning environment may not be a perfect world - but thanks
> to
> > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> > i700
> > Series Scanner you'll get full speed at 300 dpi even with all image
> > processing features enabled. http://p.sf.net/sfu/kodak-com
> > --
> > [email protected] mailing list
> > https://lists.sourceforge.net/lists/listinfo/nagios-users-br
> > Wiki: http://nagios-br.sf.net/wiki
> >
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> --
> [email protected] mailing list
> https://lists.sourceforge.net/lists/listinfo/nagios-users-br
> Wiki: http://nagios-br.sf.net/wiki
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
-- 
[email protected] mailing list
https://lists.sourceforge.net/lists/listinfo/nagios-users-br
Wiki: http://nagios-br.sf.net/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.