RenWal / fritzbox-munin-fast

A faster & cleaner collection of munin plugins to monitor your AVM FRITZ!Box router
GNU General Public License v2.0
7 stars 1 forks source link

Error output from FritzboxConfig.py: 1 - 13: not found #5

Closed Ldwg2002 closed 1 year ago

Ldwg2002 commented 1 year ago

Zwei Router (im VPN) und zwei kleinere WiFi-Netze möchte ich gerne mit fritzbox-munin/fast überwachen. Die fritzbox-munin plugins laufen, nicht ganz problemlos mit 06.8x. Details hier https://github.com/Tafkas/fritzbox-munin/issues/62#issue-1530814006 Möglichkeiten und Ergebnisse stellen mich prinzipiell zufrieden. Aber die Stichworte "fast, multigraph" haben mich zu diesem fork gebracht, für

Diese drei plugins sollten genau das leisten:
_link_saturation.py Multigraph plugin, showing saturation of WAN uplink and downlink by QoS priority
_traffic.py Similar to fritzbox_link_saturation, but single-graph and without QoS monitoring.
_wifi_load.py Multigraph plugin, showing for 2.4GHz and 5GHz
/ WiFi uplink and downlink bandwidth usage / neighbor APs on same and on different channels

config # Was mache ich falsch?

See the plugin files for plugin-specific configuration options.
Völlig übersehen hatte ich diesen Hinweis in der Anleitung !!!! Den Issue https://github.com/RenWal/fritzbox-munin-fast/blob/master/src/fritzbox_dsl.py#L10 habe ich gelesen, aber eine funktionsfähige Config bekomme ich nicht hin.

vi /etc/munin/munin.conf
[munin.plugin;test00fritzfast]
     address 127.0.0.1      # address  localhost # take from plugin.conf
     use_node_name      no  # access by node-name=yes ip-address=no
vi /etc/munin/plugin-conf.d/munin-node
[test00fritzfast_*]  # env.host_name connects to entry in /etc/munin/munin.conf
env.host_name      test00fritzfast
env.fritzbox_ip    192.168.xyz.1   ### 3490os07.30 ### router
env.fritzbox_user       trusted
env.fritzbox_password   passwd
env.fritzbox_use_tls    false
env.dsl_modes      capacity   snr   damping   errors   crc 
env.ecostat_modes  cpu   temp   ram 
env.energy_modes   power   devices   uptime 
env.energy_product DSL
env.traffic_remove_max   1 
env.wifi_freqs     24 
env.wifi_modes   freqs    neighbors 

Anmerkungen und Tests

wifi_modes.py kopiert wird neighbors, ist das ein Schreibfehler? neighbours
fritzfast_traffic.py kann es sein, dass down und up vertauscht sind? https://github.com/Tafkas/fritzbox-munin/commit/d7929f15fc15d7e132288b262fc025d12a5f498a

ls /usr/share/munin/plugins/fritzfast* 
/usr/share/munin/plugins/fritzfast_connection_uptime.py
/usr/share/munin/plugins/fritzfast_dsl.py
/usr/share/munin/plugins/fritzfast_ecostat.py
/usr/share/munin/plugins/fritzfast_energy.py
/usr/share/munin/plugins/fritzfast_link_saturation.py
/usr/share/munin/plugins/fritzfast_smart_home_temperature.py
/usr/share/munin/plugins/fritzfast_traffic.py
/usr/share/munin/plugins/fritzfast_wifi_load.py
 ls -l /usr/share/munin/plugins/fritzfast* 
-rwxr-xr-x 1 munin munin 2219 26. Jan 19:59 /usr/share/munin/plugins/fritzfast_connection_uptime.py
ls /usr/share/munin/plugins/test00fritzfast*
test00fritzfast_connection_uptime.py  test00fritzfast_link_saturation.py
test00fritzfast_dsl.py                test00fritzfast_smart_home_temperature.py
test00fritzfast_ecostat.py            test00fritzfast_traffic.py
test00fritzfast_energy.py             test00fritzfast_wifi_load.py
netcat 192.168.munin.master  4949
# munin node at nas-525a.local
list
FritzboxConfig FritzboxConfig.py cpu cpuspeed df df_inode entropy forks fw_packets 
http_loadtime if_enp0s25 if_enp4s0 if_err_enp0s25 if_err_enp4s0 interrupts irqstats 
load memory munin_stats nfsd nfsd4 open_files open_inodes postfix_mailqueue 
postfix_mailvolume proc_pri processes smart_sdc smart_sdd swap 
test00fritzfast_connection_uptime.py test00fritzfast_smart_home_temperature.py test00fritzfast_traffic.py 
threads users vmstat
service munin-node restart 
tail -f /var/log/munin/munin-node.log

# fritzbox-plugins # fritzfast-plugins
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36368" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36406" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36356" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36394" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36416" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36408" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36420" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:25:02 CONNECT TCP Peer: "[::ffff:127.0.0.1]:36434" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:26:16 [855778] Service 'test42fritzfast_wifi_load.py' timed out.
2023/01/27-14:26:19 CONNECT TCP Peer: "[::ffff:127.0.0.1]:59700" Local: "[::ffff:127.0.0.1]:4949"
2023/01/27-14:26:36 [855778] Error output from FritzboxConfig:
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 1: import: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 3: class: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 4: the server address of the Fritzbox (ip or name): not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 5: server: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 6: the port the Fritzbox webserver runs on: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 7: port: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 8: the user name to log into the Fritzbox webinterface: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 9: user: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 10: the password to log into the Fritzbox webinterface: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 11: password: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 12: useTls: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 13: Syntax error: "(" unexpected
2023/01/27-14:26:36 [855778] Service 'FritzboxConfig' exited with status 2/0.
2023/01/27-14:26:36 [855778] Error output from FritzboxConfig:
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 1: import: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 3: class: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 4: the server address of the Fritzbox (ip or name): not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 5: server: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 6: the port the Fritzbox webserver runs on: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 7: port: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 8: the user name to log into the Fritzbox webinterface: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 9: user: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 10: the password to log into the Fritzbox webinterface: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 11: password: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 12: useTls: not found
2023/01/27-14:26:36 [855778]    /etc/munin/plugins/FritzboxConfig: 13: Syntax error: "(" unexpected
2023/01/27-14:26:36 [855778] Service 'FritzboxConfig' exited with status 2/0.
2023/01/27-14:26:52 [855778] Error output from test00fritzfast_energy.py:
2023/01/27-14:26:52 [855778]    Couldn't retrieve fritzbox energy stats: 'actPerc'
2023/01/27-14:26:52 [855778] Service 'test00fritzfast_energy.py' exited with status 1/0.
munin-run  test00fritzfast_ecostat.py
multigraph cpuload
load.value 3
multigraph cputemp
temp.value 51
multigraph ramusage
strict.value 28.1
cache.value 46.2
free.value 25.7

munin-run  test00fritzfast_energy.py
multigraph power
system.value 40
cpu.value 84
wifi.value 38
dsl.value 100
ab.value 0
Couldn't retrieve fritzbox energy stats: 'actPerc'
Warning: the execution of 'munin-run' via 'systemd-run' returned an error. 
This may either be caused by a problem with the plugin to be executed or a failure 
of the 'systemd-run' wrapper. Details of the latter can be found via 'journalctl'.

munin-run  test00fritzfast_dsl.py
multigraph dsl_capacity
recv.value 72908
send.value 34743
multigraph dsl_snr
recv.value 11
send.value 21
multigraph dsl_damping
recv.value 13
send.value 13
multigraph dsl_errors
es_recv.value 8
es_send.value 0
ses_recv.value 0
ses_send.value 0
multigraph dsl_crc
recv.value 0
send.value 0

munin-run  test00fritzfast_link_saturation.py 
multigraph saturation_up
up_realtime.value 332
up_high.value 989
up_default.value 54357
up_low.value 0
maxup.value 12347000
multigraph saturation_down
dn_internet.value 161201
dn_iptv.value 0
maxdown.value 61738000

munin-run  test00fritzfast_wifi_load.py
multigraph bandwidth_24ghz
24ghz_recv.value 12
24ghz_send.value 7
multigraph neighbors_24ghz
24ghz_samechan.value 9
24ghz_otherchans.value 7

munin-run  test00fritzfast_traffic.py
down.value 6814
up.value 5482
RenWal commented 1 year ago

Woah, that's a lot of things for a single issue. I'll try to go through what I understood:

Die fritzbox-munin plugins laufen, nicht ganz problemlos mit 06.8x

Connecting to FRITZ!OS < 07.20 is unsupported, as stated in the requirements. I do not have plans to add support for this myself, since I don't have a test device with that firmware. Pull requests are always welcome though!

wifi_modes.py kopiert wird neighbors, ist das ein Schreibfehler? neighbours

Not sure if I understand this sentence. There is no file wifi_modes.py in this repository. Do you mean fritzbox_wifi_load.py? Then again, no, "neighbors" is not an error.

fritzfast_traffic.py kann es sein, dass down und up vertauscht sind? https://github.com/Tafkas/fritzbox-munin/commit/d7929f15fc15d7e132288b262fc025d12a5f498a

This commit is entirely unrelated to fritzbox-munin-fast. It fixes a bug introduced in https://github.com/Tafkas/fritzbox-munin/commit/2dabb02c2c1b8c7c97c71b80c58a7f527b88a116, which was never introduced into this fork. That bug was also not causing up and downlink traffic to be swapped.

To clarify (following the FritzBox manufacturer's specification): Uplink and downlink traffic is viewed from the router to the WAN port. Unless something has changed on AVM's firmware very recently, this should be working. If you're sure it's swapped for you, please provide the exact model name, firmware version (you're mentioning several firmwares in your issue, so I'm not sure which one is affected), and preferably a screenshot of the graph.

# munin node at nas-525a.local
list
FritzboxConfig FritzboxConfig.py

It looks like you're attempting to execute all of the helper files as Munin plugins. Please do not do so. I'm not sure if I understand how you installed the plugins, since you seem to have renamed all of the plugin files. In case you symlinked the files as described in step 6 of the installation instructions, remove the symlink for FritzboxConfig.py, then restart munin-node. I'll update the documentation to make this more clear.

Couldn't retrieve fritzbox energy stats: 'actPerc'

This looks like it might be caused by a recent change in the firmware. Do I read your issue correctly in that this occurs on a FritzBox 3490 running firmware 07.30? If so, please do the following:

Ldwg2002 commented 1 year ago

Dear RenWal,

thanks for digging through my German post and sorry confusing you with unordered details, background info now as table. I am dealing with this github project since three weeks and I am confused by my own. Facing an initial repository (fritzbox-munin/Tafkas) having 5 contributors and 34 forks. Shouldn't it be the other way round? (rhetorical question) Surprisingly I found a more prospective solution for my deployment in your fork (one of the 34, with little less contributors) using multigraph, TR-064, JSON. And the most important thing - I got an answer very soon :-) thanks a lot, so could step forward over the weekend.

I am interested to build a monitoring solution of two (unusual) FritzBox-deployments (router and access points with manual channel selection and low transmission power of 12 % per antenna), thats it - SOHO scale. A bit IT-skilled, but if I look into your scripts here, I am not a programmer nowadays.

the zoo of boxes in my two nets (VPN connected)

network size middle small munin monitoring with
router 7490os07.29 3490os07.30 fritzbox-fast/RenWal
WiFi 11n 3x3 SU-MIMO off / in the cellar ON / in use fritzbox-fast/RenWal
WiFi-net 8 AccessPoints 2 AccessPoints my plan to use for
transmission power 12 % each 12 % each these 6.8x type
AP 11n 3x3 SU-MIMO 7272os06.88 7272os06.88 fritzbox/Tafkas
AP 11n 2x2 SU-MIMO 7390os06.87 7390os06.87 fritzbox/Tafkas
AP 11n 2x2 SU-MIMO 3270v3os05.54 7270v3os06.06 not having this
AP 11g 1x1 3131os04.57 data at all

Yet I am running (fritzbox-munin/Tafkas) on routers (ok, except energy on 07.30) and not working with AP's 6.8x, issued at https://github.com/Tafkas/fritzbox-munin/issues/61, does not concern here. Now starting parallel with (fritzbox-munin-fast/RenWal) on the routers (both >07.2x). That is the reason for renaming all your plugins to fritzfast to distinguish from fritzbox, because some have the same name (may be they are the same). This way it should be possible to use both repos parallel. Do you have any caveats?

your support

What I addressed in fritzbox_wifi_load.py, thought a misspelling in the option, but it's both neighbor/American and neighbour/UK, I now reflected myself :-) May be you allow both, to avoid any trouble.

uplink and downlink traffic thanks for the clarification.

I'll update the documentation to make this more clear. Thanks a lot for that and sorry for my fault. The documentation was my main obstacle as newbie in the whole projects here. I did the same way as worked in fritzbox-munin/Tafkas (unclear too) and made sym.links to FritzboxConfig.py but two times, one as FritzboxConfig.py and the second one FritzboxConfig only. So I did Remove the symlink for FritzboxConfig.py, then restart munin-node. and still have the same
Error 1 - 13: import: not found now only once.

Couldn't retrieve fritzbox energy stats: 'actPerc'

Puh, your task to dig into the depth of http-analyzing was a challenge for us both, describing for you and doing for me. But I am quite sure, that I found what we are looking for 3490os07.30:

{"pid":"energy","hide":{"mobile":true,"liveTv":true,"provServ":true,"shareUsb":true,"ssoSet":true},"time":[],"data":{"drain":[{"cumPerc":37,"actPerc":36,"name":"FRITZ!Box Gesamtsystem","statuses":"aktiv seit 4 Tagen, 11 Stunden, 10 Minuten"},{"cumPerc":72,"actPerc":67,"name":"FRITZ!Box Hauptprozessor","statuses":""},{"cumPerc":38,"actPerc":38,"name":"WLAN","statuses":["WLAN aktiviert","2 WLAN-Netzwerkgeräte angemeldet"]},{"cumPerc":100,"actPerc":100,"name":"DSL","statuses":["Internetverbindung hergestellt"]},{"cumPerc":0,"actPerc":0,"name":"USB-Geräte","statuses":"kein USB-Gerät angeschlossen"},{"statuses":"4 Geräte angeschlossen","name":"LAN-Anschlüsse","lan":[{"name":"LAN 1","class":"green"},{"name":"LAN 2","class":"green"},{"name":"LAN 3","class":"green"},{"name":"LAN 4","class":"green"}]}],"intro":{"text":["Auf dieser Seite finden Sie Informationen zum Energieverbrauch der FRITZ!Box und zu belegten LAN-Schnittstellen."]}},"sid":"3a07118d0037bd4c"}

my current errors

test00fritzfast ERRORS with both router configs  3490os07.30  and  7490os07.29

2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 1: import: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 3: class: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 4: the server address of the Fritzbox (ip or name): not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 5: server: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 6: the port the Fritzbox webserver runs on: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 7: port: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 8: the user name to log into the Fritzbox webinterface: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 9: user: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 10: the password to log into the Fritzbox webinterface: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 11: password: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 12: useTls: not found
2023/01/29-17:15:24 [787818]    /etc/munin/plugins/FritzboxConfig: 13: Syntax error: "(" unexpected
2023/01/29-17:15:24 [787818] Service 'FritzboxConfig' exited with status 2/0.

test00fritzfast pointing to 3490os07.30 

2023/01/29-17:15:38 [787818] Error output from test00fritzfast_energy.py:
2023/01/29-17:15:38 [787818]    Couldn't retrieve fritzbox energy stats: 'actPerc'
2023/01/29-17:15:38 [787818] Service 'test00fritzfast_energy.py' exited with status 1/0.

test00fritzfast pointing to 7490os07.29
no errors! except my fault # on this router wifi is OFF, see table above

2023/01/29-17:31:28 [803203] Error output from test00fritzfast_wifi_load.py:
2023/01/29-17:31:28 [803203]    Couldn't retrieve fritzbox wifi load: '24ghz'
2023/01/29-17:31:28 [803203] Service 'test00fritzfast_wifi_load.py' exited with status 1/0.

FritzboxConfig any idea what causes these messages? Or some commands for investigation? Your fast-plugins seem to work as expected on both boxes, as shown at the end of my inintial post. Energy has low importance for me.

Thanks a lot for your support. Yours Ludwig

Ldwg2002 commented 1 year ago

2023_fritzbox_EnergMon

RenWal commented 1 year ago

I did the same way as worked in fritzbox-munin/Tafkas (unclear too) and made sym.links to FritzboxConfig.py but two times, one as FritzboxConfig.py and the second one FritzboxConfig only. So I did Remove the symlink for FritzboxConfig.py, then restart munin-node. and still have the same Error 1 - 13: import: not found now only once.

Please also remove the FritzboxConfig symlink.

Couldn't retrieve fritzbox energy stats: 'actPerc'

Huh, this one is interesting. Am I right to assume that you have the answering machine disabled in that FritzBox? I think doing so hides its energy statistics completely on 7.30, which then causes fritzbox_energy.py to run over the end of the energy statistics array.

Before I make a permanent change that fixes this, can you please try the following?

Ldwg2002 commented 1 year ago

I can report full success to you. No errors concerning fritzfast. Now I have to fiddle with the right munin config to show my first multigraphs of test00fritzfast.

FritzboxConfig symlink is deleted - no errors

So it is good to know a bit about the circumstances, to make the right assumptions. You are right. In the menue phone I don't use anything. 10 phone numbers are listed but not active. In mobile phone times nobody is missing. Later we have to consider, if a newer OS>07.20 is used as AccessPoint only the "dsl" part is OFF too. Is it removed?. And "wifi"?

fritzbox_energy.py line 31
DEVICES = ['system', 'cpu', 'wifi', 'dsl', 'usb', 'lan']
munin-run  test00fritzfast_energy.py
multigraph power
system.value 38
cpu.value 76
wifi.value 38
dsl.value 100
usb.value 0
multigraph devices
wifi.value 3
lan.value 4
multigraph uptime
uptime.value 5.03

Thanks a lot. Yesterday I tried my 7490 spare box with LaborOS 07.51 because I intend tu use WireGuard. It worked without problems, ecen AVM altered the design a bit and the webGUI feels a little faster. I will continue and keep the 7490os07.29 as spare part.

RenWal commented 1 year ago

Support questions addressed. Closing in favor of #6 and #7

Ldwg2002 commented 1 year ago

thank's for all.