From 03cf24f0721fb9e93a0c25f6be113c3819c4b054 Mon Sep 17 00:00:00 2001
From: anima
Date: Fri, 21 Mar 2025 19:40:43 +0100
Subject: [PATCH] add error if no response
---
checks/check_snmp_linux.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/checks/check_snmp_linux.py b/checks/check_snmp_linux.py
index bebb5fe..a6349d8 100755
--- a/checks/check_snmp_linux.py
+++ b/checks/check_snmp_linux.py
@@ -136,6 +136,8 @@ class SNMPDiskResource(nagiosplugin.Resource):
disks = dict()
for key,value in oids.items():
results[key] = self.session.walk(baseoid + value)
+ if len(results[key]) <= 0:
+ raise ValueError('no values from snmp')
for key, value in results.items():
for item in value:
if key == 'dskIndex':