Fritzbox Monitoring Template

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
blubbersuelze
Posts: 40
Joined: Mon Jun 15, 2009 12:55 pm

Re: Fritzbox Monitoring Template

#31 Post by blubbersuelze » Tue May 30, 2017 2:23 pm

/usr/bin/python <path_cacti>/scripts/fritzbox.py <ip> <password> error

"<ip>" and "<password>" are inputvariables from Cacti

Data Input Method has to be look like this:
Attachments
Unbenannt.png
Screenshot
Unbenannt.png (17.36 KiB) Viewed 1327 times

burnz
Posts: 4
Joined: Wed Nov 09, 2016 5:31 am

Re: Fritzbox Monitoring Template

#32 Post by burnz » Wed May 31, 2017 4:26 am

There is no output for error from fritzbox.py. The other scripts are configured properly and are working, but my fritzbox.py hast no output for error just traffic and dslinfo..

Are you using another fritzbox.py? https://pastebin.com/ncU62Hgn <<< this is my version from the last post..

Code: Select all

...


def run():

    arguments = sys.argv
    arguments.pop(0)
    ip, password, arg = arguments

    fc = Information(ip, password)

    if arg == "api_description":
        ret = fc.services
    elif arg == "dslinfo":
        ret = fc.dsl_information
    elif arg == "traffic":
        ret = fc.wan_information
    elif arg == 'ext_ip_address':
        ret = fc.ext_ip_address
    else:
        ret = "unknown Argument"

    return ret

....

blubbersuelze
Posts: 40
Joined: Mon Jun 15, 2009 12:55 pm

Re: Fritzbox Monitoring Template

#33 Post by blubbersuelze » Wed May 31, 2017 2:42 pm

you are right,

i missed to update the Script in Template Archiv.

Here the fixed one:
Attachments
fritzbox_template.zip
fixed Fritzbox Template
(18.38 KiB) Downloaded 169 times

burnz
Posts: 4
Joined: Wed Nov 09, 2016 5:31 am

Re: Fritzbox Monitoring Template

#34 Post by burnz » Wed May 31, 2017 3:12 pm

Thank you very much :)

rolandbreedveld
Posts: 2
Joined: Fri Sep 08, 2017 12:13 pm

Re: Fritzbox Monitoring Template

#35 Post by rolandbreedveld » Fri Sep 08, 2017 12:22 pm

I have the same issue with NaN values only for TotalBytesReceived
all other graphs are OK, also a graph on packages, which I created.
everything looks good configured.
output of the script is ok:
NewTotalBytesSent:44178324 NewTotalBytesReceived:20996041 NewTotalPacketsSent:240725 NewTotalPacketsReceived:82615

the problem is somewhere in the data-source, when I look in the rrd, I see this (look at the bold lines):
( rrdtool dump 01-fritzbox_totalpacketsreceive_1557.rrd )
<rrd>
<version>0003</version>
<step>300</step> <!-- Seconds -->
<lastupdate>1504890922</lastupdate> <!-- 2017-09-08 19:15:22 CEST -->
<ds>
<name> TotalBytesReceived </name>
<type> COUNTER </type>
<minimal_heartbeat>600</minimal_heartbeat>
<min>0.0000000000e+00</min>
<max>1.0000000000e+08</max>
<!-- PDP Status -->
<last_ds>U</last_ds>
<value>NaN</value>

<unknown_sec> 22 </unknown_sec>
</ds>
<ds>
<name> TotalPacketsSent </name>
<type> COUNTER </type>
<minimal_heartbeat>600</minimal_heartbeat>
<min>0.0000000000e+00</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>240446</last_ds>
<value>3.6016722408e+02</value>
<unknown_sec> 0 </unknown_sec>
</ds>

etc etc

it is strange that there is a "U" in the last_ds
in the cacti logging (debugmode):

09/08/2017 07:25:54 PM - SPINE: Poller[0] DEVDBG: SQL:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (1554,'','2017-09-08 19:25:26','NewUpstreamAttenuation:290 NewUpstreamPower:500 NewDownstreamCurrRate:25024 NewDownstreamMaxRate:34147 NewUpstreamNoiseMargin:130 NewDownstreamPower:500 NewUpstreamMaxRate:6053 NewDownstreamNoiseMargin:80 NewDownstreamAttenuation:250 NewUpstreamCurrRate:2759'),(1557,'','2017-09-08 19:25:26','NewTotalBytesSent:44386076 NewTotalBytesReceived:21099618 NewTotalPacketsSent:242010 NewTotalPacketsReceived:83331') ON DUPLICATE KEY UPDATE output=VALUES(output)'
09/08/2017 07:25:54 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/lib/cacti/rra/01-fritzbox_totalpacketsreceive_1557.rrd --template TotalBytesSent:TotalPacketsReceive:TotalPacketsSent 1504891526:44386076:21099618:242010

as you see, the poller is OK, but at the rrd update, the header, TotalBytesReceived is missing, but the value is there !
anybody any idea?

rolandbreedveld
Posts: 2
Joined: Fri Sep 08, 2017 12:13 pm

Re: Fritzbox Monitoring Template

#36 Post by rolandbreedveld » Sat Sep 09, 2017 4:35 am

I deleted the data-source template and recreated it by hand, after fixing the dependencies, this works fine.
It looks like the import was damaged somewhere internally...

disorganizer
Cacti User
Posts: 68
Joined: Thu Aug 04, 2005 8:34 am

Re: Fritzbox Monitoring Template

#37 Post by disorganizer » Wed Jul 04, 2018 4:22 am

hi, im using your templates but i still have 2 questions:

1) could it be that the crc template was created with a newer cacti version than 0.8.8h?
if so, how can i import that template to 0.8.8h?
the rest of the templates and the newest version of the script work.

2) the traffic template only shows traffic without iptv
is this on purpose? for t-entertain, for example, the streaming traffic is not shown. only traffic i add on top of this.

reibuehl
Posts: 2
Joined: Tue May 17, 2016 10:43 pm

Re: Fritzbox Monitoring Template

#38 Post by reibuehl » Sun Oct 07, 2018 4:37 am

It seems the CRC template has been exported from a version 1.x.x that uses a different syntax for the RRA definitions.
I managed to modify it manually and import the attached template version in my 0.8.8h version.
Attachments
cacti_graph_template_fritzbox_crc_error.zip
(2.33 KiB) Downloaded 41 times

remcoh
Posts: 1
Joined: Fri Nov 02, 2018 3:04 am

Re: Fritzbox Monitoring Template

#39 Post by remcoh » Fri Nov 02, 2018 3:06 am

I have deleted & re-uploaded the graph and data templates several times, but i keep getting the NaN error for inbound trafic.
The python script outputs the correct data.

Has anyone ever got to the root of the issue here?

thanks!

Lafferfr
Posts: 1
Joined: Thu Feb 07, 2019 6:50 am

Re: Fritzbox Monitoring Template

#40 Post by Lafferfr » Thu Feb 07, 2019 6:55 am

Hello,

is the main developper still there? I have found some additional scripts in python for munin. I have checked them and they work flawlessly. But I have troubles to integrate them into Cacti. I think this is a very small job, giving all Fritzbox owners a big step forward. They work with FritzOS 7.x and use the same basis as this script here.

When running on OS Basis, just the following env Variables must be set:

fritzbox_ip
fritzbox_password
locale (value de or en)

https://github.com/Tafkas/fritzbox-munin

I have tested them with a Fritzbox Cable 6590.

BR

Post Reply