WebService::FritzBox
Interact with FritzBox devices
Required.
Optional. Default: fritz.box
Optional. Default: 0
Optional. A new LWP::UserAgent will be created for you if you don't already have one you'd like to reuse.
Optional.
Create the user agent log in (get a sid).
Get some path from the FritzBox. e.g.
my $response = $fb->get( path => '/internet/inetstat_monitor.lua?useajax=1&xhr=1&action=get_graphic' );
Returns the HTTP::Response object
POST some path from the FritzBox. e.g.
my $response = $fb->post( path => '/system/syslog.lua?delete=1' );
A wrapper around the /inetstat_monitor endpoint which responds with a normalised hash. The monitor web page on the fritz.box refreshes every 5 seconds, and it seems there is a new value every 5 seconds... 5 seconds is probably a reasonable lowest request interval for this method.
Example response:
--- available: downstream: 11404000 upstream: 2593000 current: downstream: internet: 303752 media: 0 total: 303752 upstream: default: 33832 high: 22640 low: 0 realtime: 1600 total: 58072 max: downstream: 342241935 upstream: 655811
The section current represents the current (last 5 seconds) bandwith consumption. The value current.downstream.total is the sum of the media and internet fields The value current.upstream.total is the sum of the respective default, high, low and realtime fields The section available is the available bandwidth as reported by the DSL modem. The section max represents
current
current.downstream.total
media
internet
current.upstream.total
default
high
low
realtime
available
max
Copyright 2015, Robin Clarke
Robin Clarke <robin@robinclarke.net>
To install WebService::FritzBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::FritzBox
CPAN shell
perl -MCPAN -e shell install WebService::FritzBox
For more information on module installation, please visit the detailed CPAN module installation guide.