Projet

Général

Profil

Révision 842acaef

ID842acaef1ac63a496c5e8efd1c19a12ac0b5d037
Parent 3c481585
Enfant 6ee90f2e

Ajouté par Florian Sager il y a plus de 4 ans

Prevent escaping of internal names with leading numbers to fix graph processing

With serials like

Node SN Model Namespace Usage Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 285S100HTYST KXG50ZNV512G TOSHIBA 1 512,11 GB / 512,11 GB 512 B + 0 B AAGA4106
/dev/nvme1n1 S4GENX0N713949 SAMSUNG MZVLB512HBJQ-00000 1 474,89 GB / 512,11 GB 512 B + 0 B EXF7201Q

the internal names (by serial number) were rewritten to

Field Internal name Type Warn Crit Info
/dev/nvme0n1 _85S100HTYST_w derive
/dev/nvme1n1 S4GENX0N713949_w derive

--> the trailing underscore in case of nvme0n1 created problems in graph processing:

[RRD ERROR] Unable to graph /var/cache/munin/www/lxdserver/....agitos.de/nvme_bytes-month.png : undefined vname c285S100HTYST_r

Therefore I added a prefix 'SN_' for internal names.

Voir les différences:

plugins/disk/nvme
152 152
        if (m:^Node\s+SN\s+Model\s+Namespace Usage:) {
153 153
            ++$recognised_output;
154 154
        } elsif (m:^(/\S+)\s+(\S+)\s+(\S.*\S)\s{3,}(\d+)\s+(\S+\s+.B)\s+/\s+(\S+\s+.B):) {
155
            $devices{$2} = {
155
            $devices{'SN_'.$2} = {
156 156
                device    => $1,
157 157
                sn        => $2,
158 158
                model     => $3,

Formats disponibles : Unified diff