ctucx.git: fritzbox-exporter

[nimlang] prometheus exporter for lte fritzboxes

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 #!/bin/sh
export BB=/wrapper/ctucx/busybox

while true; do
        /usr/bin/ctlmgr_ctl u inetstat > /tmp/inetstat
        /usr/bin/ctlmgr_ctl u mobiled > /tmp/mobiled
        echo -ne "POST /update/inetstat?penis123 HTTP/1.1\r\nConnection: Close\r\nContent-Length: $($BB wc -c /tmp/inetstat | $BB cut -d' ' -f1)\r\n\r\n$(cat /tmp/inetstat)\r\n" | $BB nc taurus.ctu.cx 1234
        echo -ne "POST /update/mobiled?penis123 HTTP/1.1\r\nConnection: Close\r\nContent-Length: $($BB wc -c /tmp/mobiled | $BB cut -d' ' -f1)\r\n\r\n$(cat /tmp/mobiled)\r\n" | $BB nc taurus.ctu.cx 1234
        sleep 20
done