FritzBox uPNP template for cacti monitoring

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
Andy16
Posts: 10
Joined: Wed Sep 16, 2015 4:51 am

FritzBox uPNP template for cacti monitoring

#1 Post by Andy16 » Wed Sep 16, 2015 5:05 am

Hi,
anybody out there already did a template for querying a FritzBox with uPNP?

Found a lot of HowTo fragments but no version for the lazy or newbees ... :-?

thanks for any help or any link

Andy16
Posts: 10
Joined: Wed Sep 16, 2015 4:51 am

Re: FritzBox uPNP template for cacti monitoring

#2 Post by Andy16 » Fri Oct 09, 2015 12:37 pm

digging and copying other stuff this is my result:
(feedback and corrections welcome!)

Code: Select all

#! /usr/bin/php -q
<?php
$myfb=$argv[1];
$client = new SoapClient(
    null,
    array(
        'location'   => "http://".$myfb.":49000/igdupnp/control/WANCommonIFC1",
        'uri'        => "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1",
        'noroot'     => True
    )
);

$out="";
$result = $client->GetCommonLinkProperties();
$out=$out." NewLayer1UpstreamMaxBitRate:".$result["NewLayer1UpstreamMaxBitRate"];
$out=$out." NewLayer1DownstreamMaxBitRate:".$result["NewLayer1DownstreamMaxBitRate"];

$result = $client->GetAddonInfos();
$out=$out." NewByteSendRate:".$result["NewByteSendRate"];
$out=$out." NewByteReceiveRate:".$result["NewByteReceiveRate"];
$out=$out." NewTotalBytesSent:".$result["NewTotalBytesSent"];
$out=$out." NewTotalBytesReceived:".$result["NewTotalBytesReceived"];

print $out;
?>

Post Reply