Nagios (ocomon.cfg)
Integração do Nagios com Ocomon
Categoria: Networking
Software: Nagios
[ Hits: 10.688 ]
Por: Carlos Eduardo Fraga Ribeiro
Este arquivo mostra como criar dois comandos no Nagios para que ele possa registrar um incidente crítico diretamente na base de dados do Ocomon.
A versão do Nagios é a 3 e a versão do ocomon a 2.0RC6.
Talvez seja necessário alterar as configurações do arquivo para sua necessidade, pois utilizo no NAGIOsQL como frontend e o mesmo cria alguns arquivos *.cfg que não estão na instalação padrão do Nagios.
##ARQUIVO COMMANDS.CFG define command { command_name notify-service-by-ocomon command_line /usr/bin/printf "%b" "INSERT INTO ocomon_rc6.ocorrencias (problema ,descricao ,equipamento ,sistema ,contato ,telefone ,local ,operador ,data_abertura ,data_fechamento ,status ,data_atendimento ,instituicao ,aberto_por ,oco_scheduled ,oco_real_open_date , oco_script_sol ,date_first_queued ,oco_prior ) VALUES ( '1', '***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$', '1', '1', '$HOSTADDRESS$', '12345678', '1', '2', NOW(), NULL , '1', NULL , '1', '2', '0', NOW(), NULL , NOW() , '-1')" | mysql -u root -p123456 } define command { command_name notify-host-by-ocomon command_line /usr/bin/printf "%b" "INSERT INTO ocomon_rc6.ocorrencias (problema ,descricao ,equipamento ,sistema ,contato ,telefone ,local ,operador ,data_abertura ,data_fechamento ,status ,data_atendimento ,instituicao ,aberto_por ,oco_scheduled ,oco_real_open_date , oco_script_sol ,date_first_queued ,oco_prior ) VALUES ( '1', '***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n', '1', '1', '$HOSTADDRESS$', '12345678', '1', '2', NOW(), NULL , '1', NULL , '1', '2', '0', NOW(), NULL , NOW() , '-1')" | mysql -u root -p123456 } ##ARQUIVO CONTACTGROUPS.CFG define contactgroup { contactgroup_name Ocomon alias Ocomon Group members ocomon } ##ARQUIVO CONTACTS.CFG define contact { contact_name ocomon alias Ocomon User use ocomon-contact } ##ARQUIVO COTACTTEMPLATES.CFG define contact { name ocomon-contact host_notification_period 24x7 service_notification_period 24x7 host_notification_options d,u service_notification_options w,u,c host_notification_commands notify-host-by-ocomon service_notification_commands notify-service-by-ocomon register 0 } ##ARQUIVO HOSTTEMPLATES.CFG define host { name linux-server check_command check-host-alive use generic-host max_check_attempts 10 check_interval 5 retry_interval 1 check_period 24x7 contact_groups admins,Ocomon notification_interval 120 notification_period workhours notification_options d,u,r ; register 0 } define host { name windows-server hostgroups windows-servers check_command check-host-alive use generic-host max_check_attempts 10 check_interval 5 retry_interval 1 check_period 24x7 contact_groups admins,Ocomon notification_interval 30 notification_period 24x7 notification_options d,r register 0 } ##ARQUIVO SERVICETEMPLATES.CFG define service { name generic-service is_volatile 0 max_check_attempts 3 check_interval 10 retry_interval 2 active_checks_enabled 1 passive_checks_enabled 1 check_period 24x7 obsess_over_service 1 check_freshness 0 event_handler_enabled 1 flap_detection_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 notification_interval 60 notification_period 24x7 notification_options w,u,r,c notifications_enabled 1 contact_groups admins,Ocomon failure_prediction_enabled 1 register 0 }
Melhorando o tempo de boot do Fedora e outras distribuições
Como instalar as extensões Dash To Dock e Hide Top Bar no Gnome 45/46
E a guerra contra bots continua
Tradução do artigo do filósofo Gottfried Wilhelm Leibniz sobre o sistema binário
Conheça o firewall OpenGFW, uma implementação do (Great Firewall of China).
Instalando o FreeOffice no LMDE 6
Anki: Remover Tags de Estilo HTML de Todas as Cartas
Colocando uma opção de redimensionamento de imagem no menu de contexto do KDE
Não consigo acessar os modos de desempenho (2)
Ubuntu — tentando iniciar o windows? (0)
[Shell Script] Script para desinstalar pacotes desnecessários no OpenSuse
[Shell Script] Script para criar certificados de forma automatizada no OpenVpn
[Shell Script] Conversor de vídeo com opção de legenda
[C/C++] BRT - Bulk Renaming Tool
[Shell Script] Criação de Usuarios , Grupo e instalação do servidor de arquivos samba