bb-Ricardo / fritzinfluxdb

Writes data from fritzbox to influxdb
MIT License
145 stars 37 forks source link

Site to Site VPNs in VPN overview #108

Open ckoeber83 opened 1 year ago

ckoeber83 commented 1 year ago

Hi bb-Ricardo,

it would be great if to have the stats for site to site VPNs in VPN overview too aka "VPN-Verbindungen zwischen der FRITZ!Box und anderen Netzwerken / LAN-LAN-Kopplungen"

grafik grafik

bb-Ricardo commented 1 year ago

Hi,

sorry I missed your issue.

I think this should be possible. Could you get me the output of the json data for this page?

bb-Ricardo commented 10 months ago

Hi @ckoeber83, not an issue.

unfortunately pdf is not the ideal format for extracting data. A better approach would be a copy&paste from a browser.

here an example for Chrome:

Example: Payload

image

Example: Response

image

Then the result can be added directly in your comment:

PAYLOAD:
xhr: 1
sid: 826bab056813b1e3
lang: de
page: shareVpn
xhrId: all

RESPONSE:
{
    "pid": "shareVpn",
    "hide": {
        "shareUsb": true,
        "liveTv": true,
        "dectRdio": true,
        "rrd": true,
        "rss": true,
        "mobile": true,
        "dectMail": true,
        "provServ": true,
        "ssoSet": true,
        "liveImg": true
    },
    "timeTillLogout": "1200",
    "time": [],
    "data": {
        "init": {
            "userConnections": {
                "connection1": {
                    "connected": false,
                    "active": true,
                    "userId": "boxuser11",
...

Once I have this data and examples it is easy to integrate it.

Maybe Christmas family dinner get's boring and you need an excuse to do something very important 😄

Thank you very much and Merry Christmas to you too.

ckoeber83 commented 10 months ago

Hi @bb-Ricardo,

Sorry for any inconvenience. Here is the output from my browser:


grafik

Payload

"xhr": "1",
"sid": "15018212484c54b6",
"lang": "de",
"page": "shareVpn",
"xhrId": "all"

Response

{
    "pid": "shareVpn",
    "hide": {
        "shareUsb": true,
        "liveTv": true,
        "dectRdio": true,
        "dectMoniEx": true,
        "rss": true,
        "ssoSet": true,
        "dectMail": true,
        "provServ": true,
        "rrd": true,
        "liveImg": true
    },
    "timeTillLogout": "1200",
    "time": [],
    "data": {
        "init": {
            "userConnections": {
                "connection4": {
                    "connected": false,
                    "active": true,
                    "userId": "",
                    "deletable": true,
                    "address": "",
                    "type": "homeNetworkVpn",
                    "psk": "",
                    "virtualAddress": "192.168.178.202",
                    "name": ""
                },
                "connection3": {
                    "connected": false,
                    "active": true,
                    "userId": "boxuser10",
                    "deletable": true,
                    "address": "",
                    "type": "homeNetworkVpn",
                    "psk": "",
                    "virtualAddress": "192.168.178.201",
                    "name": ""
                },
                "connection0": {
                    "connected": false,
                    "active": true,
                    "userId": "",
                    "deletable": true,
                    "address": "",
                    "type": "homeNetworkVpn",
                    "psk": "",
                    "virtualAddress": "192.168.178.203",
                    "name": ""
                },
                "connection1": {
                    "connected": false,
                    "active": true,
                    "userId": "",
                    "deletable": true,
                    "address": "",
                    "type": "homeNetworkVpn",
                    "psk": "",
                    "virtualAddress": "192.168.178.204",
                    "name": ""
                },
                "connection2": {
                    "connected": false,
                    "active": true,
                    "userId": "",
                    "deletable": true,
                    "address": "",
                    "type": "homeNetworkVpn",
                    "psk": "",
                    "virtualAddress": "192.168.178.205",
                    "name": ""
                }
            },
            "type": "IPSec Xauth PSK",
            "help": {
                "url": "/secure_link.lua?sid=15018212484c54b6&lnk=https%3A%2F%2Fassets.avm.de%2Ffbvpnportal%2F%3Fhardware%3D234%26oem%3Davm%26language%3Dde%26country%3D049%26version%3D162.07.57%26subversion%3D",
                "text": ""
            },
            "boxConnections": {
                "connection8": {
                    "type": "homeNetworkVpn",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "connected": true,
                    "remoteNet": "192.168.181.0 /24",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "myfritz.net",
                    "editable": true,
                    "remoteIP": "",
                    "name": ""
                },
                "connection12": {
                    "type": "homeNetworkVpn",
                    "active": false,
                    "localNet": "192.168.178.0 /24",
                    "connected": false,
                    "remoteNet": "192.168.180.0 /24",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "myfritz.net",
                    "editable": true,
                    "remoteIP": "",
                    "name": ""
                }
            },
            "server": "myfritz.net"
        }
    },
    "sid": "15018212484c54b6"
}

grafik

Payload

{
    "xhr": "1",
    "sid": "15018212484c54b6",
    "lang": "de",
    "page": "shareWireguard",
    "xhrId": "all"
}

Response

{
    "pid": "shareWireguard",
    "hide": {
        "shareUsb": true,
        "liveTv": true,
        "dectRdio": true,
        "dectMoniEx": true,
        "rss": true,
        "ssoSet": true,
        "dectMail": true,
        "provServ": true,
        "rrd": true,
        "liveImg": true
    },
    "timeTillLogout": "1200",
    "time": [],
    "data": {
        "init": {
            "wg_public_key": "",
            "type": "IPSec Xauth PSK",
            "wg_device_config": "UIM_FAIL_TWOFACTOR_AUTH_NEEDED",
            "ddnsActivated": true,
            "userConnections": [],
            "help": {
                "url": "/secure_link.lua?sid=15018212484c54b6&lnk=https%3A%2F%2Fassets.avm.de%2Ffbvpnportal%2F%3Fhardware%3D234%26oem%3Davm%26language%3Dde%26country%3D049%26version%3D162.07.57%26subversion%3D",
                "text": ""
            },
            "wg_list_port": "51016",
            "wg_global_error": {
                "eventId": "3400",
                "eventMsg": "Konfiguration der WireGuard-Gegenstelle ist korrekt."
            },
            "wg_default_id": ".myfritz.net",
            "boxConnections": {
                "connection13": {
                    "type": "wireguard_lan_lan",
                    "active": true,
                    "localNet": "192.168.178.0",
                    "wgEndpoint": "",
                    "connectedSince": "1703287966",
                    "connected": true,
                    "remoteNet": "192.168.180.0/24",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection14": {
                    "type": "wireguard_lan_lan",
                    "active": true,
                    "localNet": "192.168.178.0",
                    "wgEndpoint": "",
                    "connectedSince": "1703287942",
                    "connected": true,
                    "remoteNet": "192.168.183.0/24",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection9": {
                    "type": "wireguard_simple",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "0",
                    "connected": false,
                    "remoteNet": "192.168.178.209/32",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection6": {
                    "type": "wireguard_simple",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "0",
                    "connected": false,
                    "remoteNet": "192.168.178.208/32",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection7": {
                    "type": "wireguard_simple",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "0",
                    "connected": false,
                    "remoteNet": "192.168.178.207/32",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection10": {
                    "type": "wireguard_simple",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "0",
                    "connected": false,
                    "remoteNet": "192.168.178.210/32",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection11": {
                    "type": "wireguard_lan_lan",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "1703288058",
                    "connected": true,
                    "remoteNet": "192.168.182.0/24",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                },
                "connection5": {
                    "type": "wireguard_simple",
                    "active": true,
                    "localNet": "192.168.178.0 /24",
                    "wgEndpoint": "",
                    "connectedSince": "1702827449",
                    "connected": false,
                    "remoteNet": "192.168.178.206/32",
                    "deletable": true,
                    "accessDefaultRoute": "0",
                    "accessHostname": "::",
                    "editable": true,
                    "remoteIp": "",
                    "name": ""
                }
            },
            "server": "myfritz.net"
        }
    },
    "sid": "15018212484c54b6"
}
bb-Ricardo commented 10 months ago

Nonneed to be sorry, this is exactly what I needed. Thank you. 🙏🏼

bb-Ricardo commented 3 months ago

Sorry for not working on this. It is currently blocked by this issue #114. I need to find a good way forward with influxDB as I don't like to repeat everything once again.

Any ideas from your side?