Somar e exibir resultados gerados pelo monitoramento do DNS
Publicado por Nandor 19/09/2006
[ Hits: 5.099 ]
Homepage: http://www.solucoesnandor.com.br/
Como havia mensionado no meu artigo sobre monitoria de DNS, aqui está o script que lê o arquivo gerado, soma e exibe separadamente as requisições gravadas. Ex: A: 131075, AAAA: 5092, PTR: 194236, MX: 14518, NS: 10602, CNAME: 32, SOA: 10217, SRV: 56, TOTAL: 234753.
########################################################################### ########################################################################### ########################################################################### ###################### Script gerado por Nandor Fehér ##################### #################### Nandor Feher - Solucoes Inteligentes ################# #################### Fique tranquilo eu tenho a solucao !!################# ########################################################################### ########################################################################### ########################################################################### # #Criticas, duvidas, elogios ou sugestoes favor enviar para o e-mail solucoesnandor@yahoo.com.br # #Por favor comentar qualquer alteracao # #!/bin/bash # Criando as variaveis com os respectivos nomes statname="A" statname2="AAAA" statname3="PTR" statname4="MX" statname5="NS" statname6="CNAME" statname7="SOA" statname8="SRV" statname9="TOTAL" #Fazendo a leitura dos arquivos, separando por categoria e contando os mesmos stat=`grep 'IN A' /var/named/var/named/dump/query-log | wc --line` stat2=`grep 'IN AAAA' /var/named/var/named/dump/query-log | wc --line` stat3=`grep 'IN PTR' /var/named/var/named/dump/query-log | wc --line` stat4=`grep 'IN MX' /var/named/var/named/dump/query-log | wc --line` stat5=`grep 'IN NS' /var/named/var/named/dump/query-log | wc --line` stat6=`grep 'IN CNAME' /var/named/var/named/dump/query-log | wc --line` stat7=`grep 'IN SOA' /var/named/var/named/dump/query-log | wc --line` stat8=`grep 'IN SRV' /var/named/var/named/dump/query-log | wc --line` # Exibindo o resultado na tela com os nomes e somatorias echo $statname: $stat echo $statname2: $stat2 echo $statname3: $stat3 echo $statname4: $stat4 echo $statname5: $stat5 echo $statname6: $stat6 echo $statname7: $stat7 echo $statname8: $stat8 echo $statname9: $(($stat1+$stat2+$stat3+$stat4+$stat5+$stat6+$stat7+$stat8))
ebook-cli - gerencia livros digitais entre PC e leitores ebooks
Script Para Manutenção de usuários do Sistema
Verificar IP Externo no Linux.
KDE 4.1.1 no Slackware Linux 12.1
Nenhum comentário foi encontrado.
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Instalando partes faltantes do Plasma 6
Adicionar botão "mostrar área de trabalho" no Zorin OS
Como montar um servidor de backup no linux
Desenvolvi um programa de hot corner (você colocar o mouse nos cantos)... (3)
Pendrive Bootable [RESOLVIDO] (4)









