Ativando o MRTG para Roteadores via SNMP
Publicado por Marcos Pitanga 17/05/2005
[ Hits: 8.709 ]
Homepage: hpc.edools.com
Este script, tem por finalidade gerar relatorios de 15 em 15 minutos de um determinado roteador via interface IP.
Projetado para atuar com RH e Fedora.
#!/bin/bash ############################################################################### # # Copyright (C) 2005 Pitanga, Marcos # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Script inicial para instalacao rapida do MRTG em ambiente Red Hat / Fedora # By Marcos Pitanga - 2005 - mpitanga@gplus.com.br #Definindo as variaveis WWWHOME="/var/www/html/mrtg" CONFIG="/etc/mrtg" printf "****************************************************************************\n" printf "** Este script facilita a instalacao do Multi Router Traffic Grapher **\n" printf "** By Marcos Pitanga **\n" printf "****************************************************************************\n" # Somente o root pode executar o script CMD_RESPONSE=$(whoami) case $CMD_RESPONSE in root) ;; *) printf "Voce de ser root para rodar este script\n"; exit ;; esac # Criando o diretorio de configuracao # Senao existir crio os diretorios printf " \n" printf " Verificando a existencia dos diretorios\n" if [ ! -d $WWWHOME ] then mkdir $WWWHOME fi if [ ! -d $CONFIG ] then mkdir /etc/mrtg fi sleep 3 printf " \n" printf "Qual o endereco IP da interface do roteador que desejas monitorar?\n" read IP #Criando o arquivo de configuracao cfgmaker --global 'WorkDir: $WWWHOME' --global 'Options[_]: bits,growright' --output $CONFIG/router.cfg $IP >$CONFIG/router.cfg #Criando a pagina inicial index.html indexmaker $CONFIG/router.cfg >$WWWHOME/index.html #Gerando as paginas para o MRTG mrtg $CONFIG/router.cfg clear # Ativando o MRTG para capturar de 15 em 15 minutos crontab -l > /tmp/crontab.mrtg echo "*/15 * * * * mrtg /etc/mrtg/router.cfg --logging /var/log/mrtg.log" >> /tmp/crontab.mrtg crontab /tmp/crontab.mrtg -u root rm /tmp/crontab.mrtg printf " MRTG configurado \n" service httpd restart clear printf " Ativando o Mozilla \n " mozilla http://localhost/mrtg&
Script para checagem de Ponto de Acesso.
speedy.sh - Wget no popup do speedy home :-)
Adicionar/Deletar Usuarios Samba/Sistema
O que fazer após instalar o Debian 8 - versão em Shell Script
Nenhum comentário foi encontrado.
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Novos apps de produtividade, avanços em IA e distros em ebulição agitam o universo Linux
Digitando underscore com "shift" + "barra de espaços"
Como ativar a lixeira e recuperar aquivos deletados em um servidor Linux
Como mudar o nome de dispositivos Bluetooth via linha de comando
Problema em SSD ao dar boot LinuxMint LMDE FAYE 64 (0)
Baixar jogos Independentes para Ubuntu [RESOLVIDO] (4)
PIP3 - erro ao instalar módulo do mariadb para o Python (1)
Linux x Plataformas de Trading - um problema (in-)solúvel? (4)