Para que nao esta afim de instalar aplicações de monitoramento, mas precisa de uma solução para monitorar links, foi o meu caso quando escrevi o script abaixo:
#!/bin/sh
# links a serem monitorados
link="10.0.0.1 172.16.0.1 192.168.0.1"
# diretorio do log
logPath="/var/log"
# prefixo do nome do arquivo
logFileName="linkState.log"
# O apontamento final do arquivo. Ex.: /var/log/linkState.log.Monday
logFile="${logPath}/${logFileName}.`date '+%A'`"
# apaga o arquivo se a ultima alteração for anterior a 6 dias - ROTATE -
find ${logPath} -name "${logFileName}.*" -mtime +6d -delete
# Marka que foi feita a checagem neste horario
echo "--== MARK ==-- $link - `date`" >> $logFile
# percore a lista de links
for l in $link ; do
# testa link
ping -c 1 -q -o $l >> /dev/null || {
# Reporta problema caso exista
echo "LINK DOWN $l : `date`" >> $logFile
}
done;
# evita injection
exit 0;
Mostrando postagens com marcador firewall. Mostrar todas as postagens
Mostrando postagens com marcador firewall. Mostrar todas as postagens
segunda-feira, 23 de março de 2009
quinta-feira, 29 de janeiro de 2009
IMCP Tipos e codigos
| ICMP Types and Codes | ||||
| TYPE | CODE | Description | Query | Error |
| 0 | 0 | Echo Reply | x | |
| 3 | 0 | Network Unreachable | x | |
| 3 | 1 | Host Unreachable | x | |
| 3 | 2 | Protocol Unreachable | x | |
| 3 | 3 | Port Unreachable | x | |
| 3 | 4 | Fragmentation needed but no frag. bit set | x | |
| 3 | 5 | Source routing failed | x | |
| 3 | 6 | Destination network unknown | x | |
| 3 | 7 | Destination host unknown | x | |
| 3 | 8 | Source host isolated (obsolete) | x | |
| 3 | 9 | Destination network administratively prohibited | x | |
| 3 | 10 | Destination host administratively prohibited | x | |
| 3 | 11 | Network unreachable for TOS | x | |
| 3 | 12 | Host unreachable for TOS | x | |
| 3 | 13 | Communication administratively prohibited by filtering | x | |
| 3 | 14 | Host precedence violation | x | |
| 3 | 15 | Precedence cutoff in effect | x | |
| 4 | 0 | Source quench | ||
| 5 | 0 | Redirect for network | ||
| 5 | 1 | Redirect for host | ||
| 5 | 2 | Redirect for TOS and network | ||
| 5 | 3 | Redirect for TOS and host | ||
| 8 | 0 | Echo request | x | |
| 9 | 0 | Router advertisement | ||
| 10 | 0 | Route solicitation | ||
| 11 | 0 | TTL equals 0 during transit | x | |
| 11 | 1 | TTL equals 0 during reassembly | x | |
| 12 | 0 | IP header bad (catchall error) | x | |
| 12 | 1 | Required options missing | x | |
| 13 | 0 | Timestamp request (obsolete) | x | |
| 14 | Timestamp reply (obsolete) | x | ||
| 15 | 0 | Information request (obsolete) | x | |
| 16 | 0 | Information reply (obsolete) | x | |
| 17 | 0 | Address mask request | x | |
| 18 | 0 | Address mask reply | x | |
Assinar:
Postagens (Atom)