naf: Retry to find volume with(out) ending slash
Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
parent
cf0603afc5
commit
fe13698167
12
check_naf.py
12
check_naf.py
|
@ -619,10 +619,18 @@ class CheckNAF(SNMPMonitoringPlugin):
|
||||||
|
|
||||||
|
|
||||||
def common_vol_idx(self, volume):
|
def common_vol_idx(self, volume):
|
||||||
if volume.endswith('.snapshot'):
|
if volume.endswith('.snapshot') or volume.endswith('.snapshot/'):
|
||||||
return None
|
return (None, None)
|
||||||
|
|
||||||
idx = self.find_in_table(self.OID['df_FS_Index'], self.OID['df_FS_Name'] , volume)
|
idx = self.find_in_table(self.OID['df_FS_Index'], self.OID['df_FS_Name'] , volume)
|
||||||
|
|
||||||
|
if idx == None:
|
||||||
|
# Retry without/with Slash
|
||||||
|
if volume[-1] == '/':
|
||||||
|
idx = self.find_in_table(self.OID['df_FS_Index'], self.OID['df_FS_Name'] , volume[:-1])
|
||||||
|
else:
|
||||||
|
idx = self.find_in_table(self.OID['df_FS_Index'], self.OID['df_FS_Name'] , volume + '/')
|
||||||
|
|
||||||
if idx != None:
|
if idx != None:
|
||||||
sn_idx = int(idx) + 1
|
sn_idx = int(idx) + 1
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue