Giter Club home page Giter Club logo

Comments (10)

Pivert avatar Pivert commented on September 13, 2024 1

Thanks Patrick,
Fritz!Box upgrade seems not available. Maybe only in Germany ?
fritzconnection python module downgrade did not help.

But shortening the password to 12 characters did it !
The script starts without error, and is working:

root@prometheus:/opt/fritzbox_exporter# lsof -Pni | grep python.*LISTEN
python    31763            root    4u  IPv4 29204367      0t0  TCP *:9787 (LISTEN)
root@prometheus:/opt/fritzbox_exporter# curl http://localhost:9787/metrics
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 98.0
python_gc_objects_collected_total{generation="1"} 291.0
python_gc_objects_collected_total{generation="2"} 0.0

Thanks for you help !

P.S.: I updated to the current version (fritzconnection==1.4.0) and it works as well. So, definitely a password problem.

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

Normally that's what happens, if the login did not succeed, as you already hinted at.

I'm speculating here, but any "funny" characters in the password? If so, could you try "pure" alphanumerical, just to see, if that's it?

Also the example from the REPL does not explicitly use authentication (unless, you have the appropriate environment vars set, which are different from the the exporter.

Could you try logging in directly from the python shell:

fc = FritzConnection(address='192.168.178.1', user='monitoring', password='YOUR_PASSWORD')

Also: i've been "shoving" the code around a bit today, depending on when you downloaded it, I might have broken something. I'll check that on my end, but the actual exporter should not have taken a hit...

from fritz_exporter.

Pivert avatar Pivert commented on September 13, 2024

Thanks Patrick,

The password is exclusively alphanumeric. To compensate it's longer...

In [4]: len(password)                                                                                                                                                                                             
Out[4]: 32

In [5]: from fritzconnection import FritzConnection                                                                                                                                                               

In [6]: fc = FritzConnection(address='192.168.178.1', user='monitoring', password=password)                                                                                                                       

In [7]: fc.modelname                                                                                                                                                                                              
Out[7]: 'FRITZ!Box 7530'

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

Could you try downgrading fritzconnection to 1.2.1 (before 1.3.0, to be precise)?

I have a hunch, that this might be connected to kbr/fritzconnection#82 (Older FritzOS Version... you are running 7.13, while 7.21 is current).

Checking on my end the current master branch works for me in docker as well as native on my Macbook against my 7590 with 7.21.

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

I have a hunch, that this might be connected to kbr/fritzconnection#82 (Older FritzOS Version... you are running 7.13, while 7.21 is current).

I'll state the obvious, just for completeness: upgrading Fritz!OS may also be an option... But I won't be the guy saying "Upgrade, closed" ;-)

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

I found another vector: Could you please check that under "network settings" (My Fritz!Box runs german locale... There it is under "Heimnetz" (Home Network?) -> Netzwerk (Network) -> Netzwerkeinstellung (Tab at the top - network settings)) you have enabled "access for applications" and "statusinformation using UPnP"? To my understanding "access for applications" should be enough, but both are mentioned in the context of fritzconnection.

from fritz_exporter.

Pivert avatar Pivert commented on September 13, 2024

Thanks Patrick,

Those are default options (that I did not changed):
image

I'll check for upgrading the Fritz!Box first. But when I checked this afternoon it just shows it's up to date and there's no higher version... I'll check again.

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

Check https://avm.de/nc/service/downloads/productsupport//fritzbox-7530/, that where I have the information, that 7.21 is available for the 7530.

No guarantees though.

Please report back.

from fritz_exporter.

pdreker avatar pdreker commented on September 13, 2024

Here's another one to test:
Go into python shell und try the following sequence using fritzconnection:

from fritzconnection import FritzConnection
fc = FritzConnection(address='192.168.178.1', user='monitoring', password=password)
fc.call_action('DeviceInfo:1', 'GetInfo')

This should return a dictionary containing basic information about the FritzBox (model name, serial, software version, uptime). The reasoning behind this is that this is the exact call in the exporter, which triggers the error and is actually the first communication the exporters makes with the box.

I still find it interesting, that the fritzconnection module seems to work but then the first basic call to the box fails with "401 Unauthorized". I have also checked the AVM documentation, and the error can mean several things, only one of which actually is "Unauthorized". In the "call_action context it can also mean that the action called is unknown or obsolete.

TR064 normally requires some kind of "discovery" and the exporter (currently) just blindly uses whatever my 7490/7590 returned to test calls.

Could you maybe simply do a curl 192.168.178.1:49000/tr64desc.xml and put the resulting XML up somewhere and link it here? This basically contains a description of protocol information and what services are actually available on your box.

from fritz_exporter.

Pivert avatar Pivert commented on September 13, 2024

Closed

from fritz_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.