zfs list might list a bunch of transient snapshots if `zpool
listsnapshots=on` and something like zfs-auto-snapshot is used. It's
also not useful to graph them since they're unchanging in time, and
the parent volume is graphed anyway. Limit zfs list to
"filesystem,volume" instead of "all" including snapshots
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.