naf: Retry to find volume with(out) ending slash

Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
Sven Velt 2012-01-10 10:46:55 +01:00
parent cf0603afc5
commit fe13698167

View file

@ -619,10 +619,18 @@ class CheckNAF(SNMPMonitoringPlugin):
def common_vol_idx(self, volume):
if volume.endswith('.snapshot'):
return None
if volume.endswith('.snapshot') or volume.endswith('.snapshot/'):
return (None, None)
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:
sn_idx = int(idx) + 1
else: