centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

[storage::qnap::snmp::plugin] --mode=hardware: need to exclude external USB disks #5152

Open joschi99 opened 2 months ago

joschi99 commented 2 months ago

We have on several QNAP's external USB disks and they create an alarm like CRITICAL: Disk '4' status is Abnormal

But this seems not a correct information returned by the QNAP and every attached USB disk will have this error:

Checking disks

.1.3.6.1.4.1.55062.1.10.2.1.2.1 = 1
.1.3.6.1.4.1.55062.1.10.2.1.2.2 = 2
.1.3.6.1.4.1.55062.1.10.2.1.2.3 = 3
.1.3.6.1.4.1.55062.1.10.2.1.2.4 = 4
.1.3.6.1.4.1.55062.1.10.2.1.2.5 = 5
.1.3.6.1.4.1.55062.1.10.2.1.2.6 = 6
.1.3.6.1.4.1.55062.1.10.2.1.2.7 = 7
.1.3.6.1.4.1.55062.1.10.2.1.2.8 = 8
.1.3.6.1.4.1.55062.1.10.2.1.2.9 = 4
.1.3.6.1.4.1.55062.1.10.2.1.3.1 = KINGSTON
.1.3.6.1.4.1.55062.1.10.2.1.3.2 = KINGSTON
.1.3.6.1.4.1.55062.1.10.2.1.3.3 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.4 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.5 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.6 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.7 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.8 = HGST
.1.3.6.1.4.1.55062.1.10.2.1.3.9 = --
.1.3.6.1.4.1.55062.1.10.2.1.4.1 = KINGSTON SNV2S500G (SAS)
.1.3.6.1.4.1.55062.1.10.2.1.4.2 = KINGSTON SNV2S500G (SAS)
.1.3.6.1.4.1.55062.1.10.2.1.4.3 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.4 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.5 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.6 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.7 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.8 = HGST HUH721212ALE604 (SATA)
.1.3.6.1.4.1.55062.1.10.2.1.4.9 =  UnionSine USB3.2 (NL-SAS)
.1.3.6.1.4.1.55062.1.10.2.1.5.1 = 50026B778535A20D
.1.3.6.1.4.1.55062.1.10.2.1.5.2 = 50026B778535A220
.1.3.6.1.4.1.55062.1.10.2.1.5.3 = D5H72HBF
.1.3.6.1.4.1.55062.1.10.2.1.5.4 = D5H75D0F
.1.3.6.1.4.1.55062.1.10.2.1.5.5 = D5H71UNF
.1.3.6.1.4.1.55062.1.10.2.1.5.6 = D5H78Y2F
.1.3.6.1.4.1.55062.1.10.2.1.5.7 = D5H71WAF
.1.3.6.1.4.1.55062.1.10.2.1.5.8 = D5H756HF
.1.3.6.1.4.1.55062.1.10.2.1.5.9 = 0001000313D1
.1.3.6.1.4.1.55062.1.10.2.1.6.1 = SAS
.1.3.6.1.4.1.55062.1.10.2.1.6.2 = SAS
.1.3.6.1.4.1.55062.1.10.2.1.6.3 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.4 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.5 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.6 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.7 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.8 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.9 = NL-SAS
.1.3.6.1.4.1.55062.1.10.2.1.7.1 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.2 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.3 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.4 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.5 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.6 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.7 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.8 = Good
.1.3.6.1.4.1.55062.1.10.2.1.7.9 = Abnormal
.1.3.6.1.4.1.55062.1.10.2.1.8.1 = 26
.1.3.6.1.4.1.55062.1.10.2.1.8.2 = 25
.1.3.6.1.4.1.55062.1.10.2.1.8.3 = 32
.1.3.6.1.4.1.55062.1.10.2.1.8.4 = 34
.1.3.6.1.4.1.55062.1.10.2.1.8.5 = 34
.1.3.6.1.4.1.55062.1.10.2.1.8.6 = 34
.1.3.6.1.4.1.55062.1.10.2.1.8.7 = 35
.1.3.6.1.4.1.55062.1.10.2.1.8.8 = 33
.1.3.6.1.4.1.55062.1.10.2.1.8.9 = -1
disk '1' status is Good [instance: 1, temperature: 26]
disk '2' status is Good [instance: 2, temperature: 25]
disk '3' status is Good [instance: 3, temperature: 32]
disk '4' status is Good [instance: 4, temperature: 34]
disk '5' status is Good [instance: 5, temperature: 34]
disk '6' status is Good [instance: 6, temperature: 34]
disk '7' status is Good [instance: 7, temperature: 35]
disk '8' status is Good [instance: 8, temperature: 33]
disk '4' status is Abnormal [instance: 9, temperature: -1]

We should have a filter to exclude not only single disks but disk type. As you can see above there are different disk types like

.1.3.6.1.4.1.55062.1.10.2.1.6.1 = SAS
.1.3.6.1.4.1.55062.1.10.2.1.6.2 = SAS
.1.3.6.1.4.1.55062.1.10.2.1.6.3 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.4 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.5 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.6 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.7 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.8 = SATA
.1.3.6.1.4.1.55062.1.10.2.1.6.9 = NL-SAS

and we should need to exclude the NL-SAS.

lucie-dubrunfaut commented 2 months ago

Hello :)

So ideally you're proposing to add an option like --exclude-disk-type and let the user list the types they don't want to monitor?

joschi99 commented 2 months ago

Yes, this could be a possible solution. We need to find a way to exclude this disk types, because will cause false positives