From 887eaaeb9fc774c4ec26cf70214c57cda44118b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= Date: Thu, 10 Oct 2024 14:09:33 +0200 Subject: [PATCH] Add hotspare mode --- hp/drive/drive.go | 2 +- hp/mib/cpq_da_phy_drv.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hp/drive/drive.go b/hp/drive/drive.go index 865ad29..9894cb9 100644 --- a/hp/drive/drive.go +++ b/hp/drive/drive.go @@ -82,7 +82,7 @@ func (d *PhysicalDrive) GetNagiosStatus() (int, string) { description := fmt.Sprintf("physical drive (%-4s) model=%s serial=%s firmware=%s hours=%d", d.ID, d.Model, d.Serial, d.FwRev, d.Hours) - if d.Status != "ok" { + if d.Status != "ok" && d.Status != "hotspare" { return check.Critical, description + " - status: " + d.Status } diff --git a/hp/mib/cpq_da_phy_drv.go b/hp/mib/cpq_da_phy_drv.go index 25a2199..3a2a72c 100644 --- a/hp/mib/cpq_da_phy_drv.go +++ b/hp/mib/cpq_da_phy_drv.go @@ -73,8 +73,9 @@ const ( ) var CpqDaPhyDrvStatusMap = StringMap{ - 1: "other", - 2: "ok", - 3: "failed", - 4: "predictiveFailure", + 1: "other", + 2: "ok", + 3: "failed", + 4: "predictiveFailure", + 10: "hotspare", }