source: misc/fritzbox-stats.sh@ 272

Last change on this file since 272 was 220, checked in by Rick van der Zwet, 14 years ago

Statistics for the BOX the hard way.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh
2#
3# The FRITZ!Box Fon WLAN 7170 does not have any kind of SNMP to do monitoring
4# on It DOES have some json/xml like response URI which can be used to gather
5# traffic statistics of the box. If somebody knows how to use SNMP with the box
6# please let me know, cause this is a very nasty hack.
7#
8# WARNING: This currently does not work when password is enabled, as the
9# javascript password hashing has not be implemented
10#
11# TODO Convert me to pyhon one day and provide usable output for nagios.
12#
13# Rick van der Zwet <info@rickvanderzwet.nl>
14
15HOST=${1:-192.168.178.1}
16SID=`fetch -q -o - "http://${HOST}/cgi-bin/webcm?getpage=../html/" | awk -F\" '/sid/ {print $6}'`
17
18while true; do
19 fetch -q -o - "http://${HOST}/cgi-bin/webcm?getpage=../html/de/internet/overviewdaten.xml&sid=${SID}"
20 fetch -q -o - "http://${HOST}/cgi-bin/webcm?getpage=../html/de/home/../home/home_dsl.txt&sid=${SID}"
21 fetch -q -o - "http://${HOST}/cgi-bin/webcm?getpage=../html/de/home/../home/home_coninf.txt&sid=${SID}"
22 fetch -q -o - "http://${HOST}/cgi-bin/webcm?getpage=../html/de/internet/qos.txt&sid=${SID}"
23 sleep 1
24done
Note: See TracBrowser for help on using the repository browser.