Lucas Peregrino
(usa Debian)
Enviado em 19/12/2017 - 20:32h
echo "Cadastro de estações em linux."
echo
echo -ne "Digite o nome da empresa que ira cadastrar ex.:(RMD) = "
read EMPRESA
echo
echo -ne "Digite o nome da estação ou servidor a cadastrar ex.:(S1SP) = "
read NOME
echo
echo -ne "Digite o nome do nrpe da estação ex.:(E20) = "
read ABR
echo
sed -i "1a\## Ping na estação
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Ping Remoto
check_command $EMPRESA_NRPE_$ABREVE!check_ping!200.0,20%!600.0,60%
normal_check_interval 5
retry_check_interval 1
}
## Usuarios
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Usuarios logados
check_command $EMPRESA_NRPE_$ABREVE!check_user
}
## Processos
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Número de Processos
check_command $EMPRESA_NRPE_$ABREVE!check_nbprocs
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Processos mortos
check_command $EMPRESA_NRPE_$ABREVE!check_zombie_procs
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Total de Processos
check_command $EMPRESA_NRPE_$ABREVE!check_total_procs
}
## Uso de CPU
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Load CPU
check_command $EMPRESA_NRPE_$ABREVE!check_load
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description CPU
check_command $EMPRESA_NRPE_$ABREVE!check_cpu
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Consumo de CPU
check_command $EMPRESA_NRPE_$ABREVE!check_io
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Número de opções de contexto
check_command $EMPRESA_NRPE_$ABREVE!check_cswch
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Número de interrupções
check_command $EMPRESA_NRPE_$ABREVE!check_intr
}
## Memoria
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Uso da Memoria
check_command $EMPRESA_NRPE_$ABREVE!check_memory
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Uso do Swap
check_command $EMPRESA_NRPE_$ABREVE!check_swap
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Uso da Paginação
check_command $EMPRESA_NRPE_$ABREVE!check_paging
}
## Interface de Rede
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Interface de Rede
check_command $EMPRESA_NRPE_$ABREVE!check_network
}
##HD
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sda1 - Boot
check_command $EMPRESA_NRPE_$ABREVE!check_sda1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sda5 - Sistema
check_command $EMPRESA_NRPE_$ABREVE!check_sda5
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sda6 - Swap
check_command $EMPRESA_NRPE_$ABREVE!check_sda6
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sdb1 - Dados
check_command $EMPRESA_NRPE_$ABREVE!check_sdb1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sdc1 - Totys
check_command $EMPRESA_NRPE_$ABREVE!check_sdc1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sdd1 - VMS
check_command $EMPRESA_NRPE_$ABREVE!check_sdd1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Disco sde1 - BKP
check_command $EMPRESA_NRPE_$ABREVE!check_sde1
}
## Samba4
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Samba 4.5.1
check_command $EMPRESA_NRPE_$ABREVE!check_samba
notifications_enabled 1
}
## Firebird
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Firebird 3.0.1.32609-0 - 3050
check_command $EMPRESA_NRPE_$ABREVE!check_firebird
notifications_enabled 1
}
## Squid
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-SERVINET
service_description Squid 4.0.10 - Transparente
check_command $EMPRESA_NRPE_I!check_squid_t
notifications_enabled 1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-SERVINET
service_description Squid 4.0.10 - Autenticado
check_command $EMPRESA_NRPE_I!check_squid_a
notifications_enabled 1
}
#Temperatura
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Temperature Processador 0
check_command $EMPRESA_NRPE_$ABREVE!check_coretemp0
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Temperature Processador 1
check_command $EMPRESA_NRPE_$ABREVE!check_coretemp1
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Temperature Processador 2
check_command $EMPRESA_NRPE_$ABREVE!check_coretemp2
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Temperature Processador 3
check_command $EMPRESA_NRPE_$ABREVE!check_coretemp3
}
## VirtualBox
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description VirtualBox 5.0.22 - Tek
check_command $EMPRESA_NRPE_$ABREVE!vm_2
}
##DNS Rede
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description DNS - Servidor
check_command $EMPRESA_NRPE_$ABREVE!check_dominio
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description DNS - Internet
check_command $EMPRESA_NRPE_$ABREVE!check_internet
}
## URL E CONEXOES TCP/HTTP
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Apache2 - 8073
check_command $EMPRESA_NRPE_$ABREVE!check_url
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description NRPE - 5233
check_command $EMPRESA_NRPE_$ABREVE!check_nrpe
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description SSH - 6554
check_command $EMPRESA_NRPE_$ABREVE!check_ssh
}
define service{
use $EMPRESA-SERVICE
host_name $EMPRESA-$NOME
service_description Protocolo de Controle de Transmissões
check_command $EMPRESA_NRPE_$ABREVE!check_tcpcount
}" /urs/local/nagios/rede/CLIENTE/client.list