Open thebang2 opened 10 months ago
the reason for the top of the page not updating is, that the corresponding fields in the mrtg.cfg are not updated:
bash-5.2# cat mrtg.cfg
######################################################################
# System: FRITZ!Box 7490
# Description: AVM FRITZ!Box 7490
######################################################################
WorkDir: /srv/www/htdocs
Target[fritzbox]: `/fritzbox-bandwidth-monitor/upnp2mrtg.sh`
Title[fritzbox]: Traffic Analysis for FRITZ!Box 7490
# DSL light (384 kbit / 64 kbit)
#MaxBytes1[fritzbox]: 48000
#MaxBytes2[fritzbox]: 8000
# DSL 1024 (1024 kbit / 128 kbit)
#MaxBytes1[fritzbox]: 128000
#MaxBytes2[fritzbox]: 16000
# DSL 2048 (2048 kbit / 192 kbit)
#MaxBytes1[fritzbox]: 256000
#MaxBytes2[fritzbox]: 24000
# DSL 6016 (6016 kbit / 576 kbit)
#MaxBytes1[fritzbox]: 752000
#MaxBytes2[fritzbox]: 72000
# DSL 16000 (16000 kbit / 1024 kbit)
#MaxBytes1[fritzbox]: 2000000
#MaxBytes2[fritzbox]: 128000
MaxBytes1[fritzbox]: 512000
MaxBytes2[fritzbox]: 384000
PageTop[fritzbox]: <h1>Traffic Analysis for FRITZ!Box 7490</h1>
<div id="sysdetails">
<table>
<tr>
<td>System:</td>
<td>FRITZ!Box 7490</td>
</tr>
<tr>
<td>IP Address:</td>
<td>192.168.178.1 (fritzbox.home.lan)</td>
</tr>
<tr>
<td>Description:</td>
<td>DSL</td>
</tr>
<tr>
<td>Max Download Speed:</td>
<td>16000 kbit/s</td>
</tr>
<tr>
<td>Max Upload Speed:</td>
<td>1024 kbit/s</td>
</tr>
</table>
</div>
bash-5.2#
the entrypoint.sh script updates the values in the config generally, but not the "top of the page" part:
bash-5.2# cat entrypoint.sh
#!/bin/sh
[...]
POLL_INTERVAL=${POLL_INTERVAL:-300}
MAX_DOWNLOAD_BYTES=${MAX_DOWNLOAD_BYTES:-16000000000}
MAX_UPLOAD_BYTES=${MAX_UPLOAD_BYTES:-5300000000}
FRITZBOX_NR=${FRITZBOX_NR:-7530}
FRITZBOX=${FRITZBOX:-192.168.178.1}
RUN_WEBSERVER=${RUN_WEBSERVER:-1}
[...]
if [ ! -f /etc/mrtg.cfg ]; then
sed -e "s|7490|${FRITZBOX_NR}|g" \
-e "s|^MaxBytes1\[fritzbox\]:.*|MaxBytes1\[fritzbox\]: ${MAX_DOWNLOAD_BYTES}|g" \
-e "s|^MaxBytes2\[fritzbox\]:.*|MaxBytes2\[fritzbox\]: ${MAX_UPLOAD_BYTES}|g" \
-e "s|192.168.178.1 (fritzbox.home.lan)|${FRITZBOX}|g" \
/fritzbox-bandwidth-monitor/mrtg.cfg > /etc/mrtg.cfg
fi
[...]
bash-5.2#
so it's probably neccessary to add 2 more lines to the sed part in the entrypoint.sh that replaces those values (and calculates them first obv).
EDIT: in entrypoint.sh replace
MAX_DOWNLOAD_BYTES=${MAX_DOWNLOAD_BYTES:-16000000000}
MAX_UPLOAD_BYTES=${MAX_UPLOAD_BYTES:-5300000000}
with
MAX_DOWNLOAD_BYTES=${MAX_DOWNLOAD_BYTES:-16000000000}
MAX_UPLOAD_BYTES=${MAX_UPLOAD_BYTES:-5300000000}
MAX_DOWNLOAD_BIT=$((MAX_DOWNLOAD_BYTES / 125))
MAX_UPLOAD_BIT=$((MAX_UPLOAD_BYTES / 125))
and
if [ ! -f /etc/mrtg.cfg ]; then
sed -e "s|7490|${FRITZBOX_NR}|g" \
-e "s|^MaxBytes1\[fritzbox\]:.*|MaxBytes1\[fritzbox\]: ${MAX_DOWNLOAD_BYTES}|g" \
-e "s|^MaxBytes2\[fritzbox\]:.*|MaxBytes2\[fritzbox\]: ${MAX_UPLOAD_BYTES}|g" \
-e "s|192.168.178.1 (fritzbox.home.lan)|${FRITZBOX}|g" \
/fritzbox-bandwidth-monitor/mrtg.cfg > /etc/mrtg.cfg
fi
with
if [ ! -f /etc/mrtg.cfg ]; then
sed -e "s|7490|${FRITZBOX_NR}|g" \
-e "s|^MaxBytes1\[fritzbox\]:.*|MaxBytes1\[fritzbox\]: ${MAX_DOWNLOAD_BYTES}|g" \
-e "s|^MaxBytes2\[fritzbox\]:.*|MaxBytes2\[fritzbox\]: ${MAX_UPLOAD_BYTES}|g" \
-e "s|<td>16000 kbit/s</td>|<td>${MAX_DOWNLOAD_BIT} kbit/s</td>|g" \
-e "s|<td>1024 kbit/s</td>|<td>${MAX_UPLOAD_BIT} kbit/s</td>|g" \
-e "s|192.168.178.1 (fritzbox.home.lan)|${FRITZBOX}|g" \
/fritzbox-bandwidth-monitor/mrtg.cfg > /etc/mrtg.cfg
fi
this will at least fix the top of the page numbers.
Hey, I have set up a Docker container with the following parameters:
After starting, graphs are not updating, max upload and download are not recognized.
The log says following:
Used hardware: FRITZ!Box 6490 Cable FRITZ!OS: 7.57
Any idea what `I´m doing wrong?