As per the zpool(8) man page:
> zpool list [-HgLpPv] [-o property[,property]...] [-T u|d] [pool]... [interval [count]]
> Lists the given pools along with a health status and space usage. If no pools are specified, all pools in the system are listed. When given an interval, the information is printed every
> interval seconds until ^C is pressed. If count is specified, the command exits after count reports are printed.
> [...]
> -p Display numbers in parsable (exact) values.
> 2020/08/16 04:45:24 [ERROR] In RRD: Error updating /var/lib/munin/localdomain/localhost.localdomain-zfs_list_rpool__name-quota-g.rrd: /var/lib/munin/localdomain/localhost.localdomain-zfs_list_rpool__name-quota-g.rrd: Function update_pdp_prep, case DST_GAUGE - Cannot convert '-' to float
Used the correct munin way by soursing "$MUNIN_LIBDIR/plugins/plugin.sh" and use clean_fieldname.
For the title I removed the replacement of / by __ and on the multigraph value I added the usage of clean_fieldname to make it backwards compatible.
The following issues were fixed:
* comparison too broad (e.g. "0" misinterpreted as "true")
* python: comparing string with number (is never equal in python)
* unwanted non-zero exitcode (compound command "&&" as last command in
shell code block (e.g. "case" or "if" branch))
* access to unset variable (shell style issue)
The current code escapes / (which is legal as part of a dataset name for ZFS, but illegal as part of a munin graph name) into _ (which is legal for both). The result is that any _ characters in the original filename get changed into / in the legend, which is confusing.
Fix by escaping any existing _ characters into __ first, and then later replacing // into _ again. // is a sequence that will not occur in a ZFS dataset name, so any double-/ sequence must therefore have been a _ originally.
Providing a --upper-limit parameter is only useful if the size of the
filesystem never changes. On ZFS, this assumption is only true for the
zpool; for all other filesystems, the available space is shared, and the
totalled values will vary. When this is the case, the --upper-limit
parameter will obscure peaks in the graph.