Man kann so z.B. leicht einen automatisierten Snapshot aller wichtigen Daten per cron erstellen. Und ist so immer auf dem laufenden...
Leider habe ich im Moment Urlaub und deswegen nicht soviel Zeit

Code: Alles auswählen
firmware file: epc3212-E10-12-v302r12901-100609c-KDG.bin
firmware date: 2010-06-09 19:53:25
last reset at: 2011-01-19 13:34:50
C: 1 F: 562.0 M: 256 G: 66.8 B: - D: 38.6 <=
C: 2 F: 570.0 M: 256 G: 66.9 B: - D: 39.0
C: 3 F: 546.0 M: 256 G: 66.7 B: - D: 39.0
C: 4 F: 554.0 M: 256 G: 60.9 B: - D: 39.0
C: 1 F: 45.8 M: 16 G: 104.7 B: 25600 D: -
SFID: Direction: Primary: Packets:
16115 Downstream Yes N/A
16417 Upstream Yes 3120277
25914 Upstream No 1436
25918 Downstream No N/A
ErrType: C 129: C 130: C 133: C 134:
Unerrored 482570604 100277348 100129448 99981435
Correctable 1017 722 398 104
Uncorrectable 0 0 0 0
Code: Alles auswählen
awk '
func setup_cmd(what \
)
{
if ("'`hostname`'" == "bajada") {
return "cat /root/" what
} else {
return "lynx -dump http://192.168.100.1/" what ".htm"
}
}
BEGIN {
MONTHS = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
split(MONTHS, a)
for (i in a) MONTHSi[a[i]] = sprintf("%02d", i)
# ---
CMD = setup_cmd("ChannelsSelection")
while (CMD | getline > 0) {
if (match($0, "([0-9]+)$", a)) pres_down_freq = a[1] / 1000000
}
close(CMD)
# ---
CMD = setup_cmd("Docsis_system")
while (CMD | getline > 0) {
if (match($0, ": (.*\\.bin)$", a)) print "firmware file: " a[1]
if (match($0, ": ([^ ]+) ([^ ]+) ([^ ]+) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])$", a))
print "firmware date: " a[3] "-" MONTHSi[a[1]] "-" a[2] " " a[4]
}
close(CMD)
# ---
CMD = setup_cmd("Docsis_signal")
while (CMD | getline > 0) {
if (match($0, "Channel ([0-9]):$", a)) {
if (F) CH[cnt++] = sprintf("C: %s F: %5.1f M: %3s G: %5.1f B: %5s D: %4s", C, F, M, G, B, D)
C = a[1]
F = 0
M = 0
G = 0
B = "-"
D = "-"
}
if (match($0, "([0-9.]+) Hz$", a)) F = a[1] / 1000000
if (match($0, "([0-9.]+) QAM$", a)) M = a[1]
if (match($0, "([0-9.]+) dBuV$", a)) G = a[1]
if (match($0, "([0-9.]+) kBits/sec$", a)) B = a[1]
if (match($0, "([0-9.]+) dB$", a)) D = a[1]
}
close(CMD)
# ---
CMD = setup_cmd("Docsis_status")
while (CMD | getline > 0) {
if (match($0, ": ([0-9]+) days ([0-9]+)h:([0-9]+)m:([0-9]+)s$", a)) {
rst_secs_back = ((a[1] * 24 + a[2]) * 60 + a[3]) * 60 + a[4]
print strftime("last reset at: %Y-%m-%d %H:%M:%S", strftime("%s") - rst_secs_back)
print ""
for (i = 0; i < cnt; ++i) {
printf CH[i]
if (match(CH[i], pres_down_freq)) {
print " <="
++found
} else {
print ""
}
}
if (!found) print "ERROR: SELECTED FREQU [ " pres_down_freq " ] NOT FOUND"
print ""
}
if (match($0, "SFID")) printf "%-6s %-12s %-8s %10s\n", $1 ":", $2 ":", $3 ":", $4 ":"
if (match($0, "Downstream|Upstream")) printf "%-6s %-12s %-8s %10s\n", $1, $2, $3, $4
if (match($1, "Channel")) printf "\n%-13s %10s %10s %10s %10s\n", "ErrType:", "C " $3 ":", "C " $4 ":", "C " $5 ":", "C " $6 ":"
if (match($1, "Total")) printf "%-13s %10s %10s %10s %10s\n", $2, $4, $5, $6, $7
}
close(CMD)
}'