Aktionen

FritzBox Status Informationen per Upnp mit Linux Bash-Script auslesen

Aus znilwiki

Die druckbare Version wird nicht mehr unterstützt und kann Darstellungsfehler aufweisen. Bitte aktualisiere deine Browser-Lesezeichen und verwende stattdessen die Standard-Druckfunktion des Browsers.

Erst einmal wilde Textsammlung, muss ich noch ordnen und ein einzelnes Script sowie ein Zabbix Template draus bauen:



Verbindungsstatus

XML erstellen:

nano connection_state.xml

Inhalt:

<?xml version="1.0" encoding="utf-8" ?>
    <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Body>
            <u:GetStatusInfo xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" />
        </s:Body>
    </s:Envelope>

Die eigentliche Abfrage:

curl -s "http://192.168.1.200:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetStatusInfo" -d "@connection_state.xml"

Mögliche Werte sind:

Unconfigured
Connecting
Authenticating
Connected
PendingDisconnect
Disconnecting
Disconnected




Externe IP-Adresse

Gleiche XML-Datei wie bei "Verbindungstatus"

curl -s "http://192.168.1.200:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" -d "@connection_state.xml"




DSL-Verbindungsinformationen

Wieder XML-Datei erstellen:

nano linkspeed.xml

Inhalt:

<?xml version="1.0" encoding="utf-8" ?>
    <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Body>
            <u:GetCommonLinkProperties xmlns:u="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" />
        </s:Body>
    </s:Envelope>

Die eigentliche Abfrage:

curl -s "http://192.168.1.200:49000/igdupnp/control/WANCommonIFC1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#GetCommonLinkProperties" -d "@linkspeed.xml"




Aktueller Traffic beim Senden und Empfangen

Gleiche XML-Datei wie bei "DSL-Verbindungsinformationen:

curl -s "http://192.168.1.200:49000/igdupnp/control/WANCommonIFC1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#GetAddonInfos" -d "@linkspeed.xml"




Links




Loading comments...