How to use it

1)
Create a symlink from /etc/munin/plugins/nameyouwant to the script
the "nameyouwant" is used to create cache directory is ~/.config/weboob/munin and is usefull to configure the plugin.

2)
Configure the plugin in /etc/munin/plugin-conf.d/ (you can go at the end of this files for some examples).
=== Mandatory options are: ===
==== env.capa ====
Example: env.capa ICapBank

The Weboob capability to load.

==== env.do ====
Example: env.do get_balance

The Weboob command to call the capability. It can take more than one argument. With two argument, the second is used as parameter for the command. The third is used to restrict backends.

==== env.import ====
Example: from weboob.capabilities.bank import ICapBank

The import line to import the capability

==== env.attribvalue ====
Example: env.attribvalue balance

The attribut name of objects that we get with the "do" command. In the example, we get some Account objects and the relevant value is "balance".
If the attribut is itself one object, it is possible the use a hierarchical call (with / as separator). To get the temperature of a Current object use "temp/value".



=== Optionnals options are ===

==== env.id_monitored ====
Example: env.id_monitored account1@backend1 account2@backend2
A list of object (space as separator). Only there objects are diplayed.

==== env.exclude ====
Example: env.exclude 550810@sachsen
Same as env.id_monitored, but to exclude an object of results

==== env.cache_expire ====
Example: env.cache_expire 7200 (default 3600)

To avoid site flooding, we use a cache in ~/.config/weboob/munin/ The default value is to get new value every 3600 seconds, you can change this delay with this option.

==== env.cumulate ====
Example: env.cumulate 0 (default 1)

Display data in Area mode (default) or in line mode.

==== env.attribid ====
Example env.attribid id

Munin need an id for each value. The default is to use the id of results objects, but you can configure an other attribut. Like for env.attribvalue, you can configure a hierarchical attribut with / as separator, for example "temp/id".

==== env.title ====
Example env.title a wonderful graph

A title for the graph (default: nothing)

==== env.vlabel ====
Example: env.vlabel Balance

A vlabel for the graph (default: env.attribvalue)

==== env.label ====
Example: env.label id

Each data in munin as a label. Per default, we take the "label" attribute of object, but it is not always possible (label attribute does not exist, etc). Configure the attribut to use as label here.



3) restart munin-node




Examples:


# Like boobank-munin does
# Only for the example, you should use boobank-munin instead
[bank]
user florent
group florent
env.cache_expire 7200
env.HOME /home/flo
env.capa ICapBank
env.do iter_accounts
env.import from weboob.capabilities.bank import ICapBank
env.attribvalue balance
env.title Solde des comptes


# Balance of your leclercmobile subscription
[leclercmobile]
user florent
group florent
env.cache_expire 16800
env.HOME /home/flo
env.capa ICapBill
env.do get_balance,06XXXXXXXX,leclercmobile
env.import from weboob.capabilities.bill import ICapBill
env.attribvalue price
env.title Forfait leclercmobile
env.vlabel Solde

Result: http://fourcot.fr/weboob/leclercmobile-day.png

# Monitor water level in Dresden
[leveldresden]
user florent
group florent
env.cache_expire 7200
env.HOME /home/flo
env.capa ICapGauge
env.do get_last_measure,501060-level
env.import from weboob.capabilities.gauge import ICapGauge
env.attribvalue level
env.title Niveau de l'elbe
env.label id


# The level of the elbe in all Sachsen's cities
[levelelbesachsen]
user florent
env.cache_expire 800
env.HOME /home/flo
env.cumulate 0
env.capa ICapGauge
env.do iter_gauges,Elbe,sachsen
env.import from weboob.capabilities.gauge import ICapGauge
env.attribvalue sensors/lastvalue/level
env.title Niveau de l'elbe en Saxe
env.label name
env.vlabel Hauteur du fleuve (cm)
env.exclude 550810@sachsen

Result: http://fourcot.fr/weboob/elbesachsen-day.png

# Temperature in Rennes
[temprennes]
user florent
env.HOME /home/flo
env.cumulate 0
env.capa ICapWeather
env.do get_current,619163,yahoo
env.import from weboob.capabilities.weather import ICapWeather
env.attribvalue temp/value
env.attribid temp/id
env.title Température à Rennes
env.vlabel Température
env.label id

Result: http://fourcot.fr/weboob/temprennes-day.png
