From 6b7615a9eae752f0d375d078565d77a8f7068ac8 Mon Sep 17 00:00:00 2001 From: Triatmoko Date: Fri, 18 Nov 2011 03:16:42 +0100 Subject: nagios function fully working --- Under-Testing/Server-Code-New/truthtableClass.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Under-Testing/Server-Code-New/truthtableClass.py') diff --git a/Under-Testing/Server-Code-New/truthtableClass.py b/Under-Testing/Server-Code-New/truthtableClass.py index 3195dee..c45ab4d 100644 --- a/Under-Testing/Server-Code-New/truthtableClass.py +++ b/Under-Testing/Server-Code-New/truthtableClass.py @@ -48,7 +48,8 @@ class trueTable: deviceLists = self.db.deviceList() self.db.closeDBConn() - for device in deviceLists: + for items in deviceLists: + device = items[0] for result in self.resultsList: if device == result[0] or device == result[1]: if int(result[2]) == 200: @@ -63,7 +64,6 @@ class trueTable: self.deviceStatus.append([device,'OK']) else: self.deviceStatus.append([device,'OK']) - break elif int(result[2]) == 486: found = False @@ -83,9 +83,9 @@ class trueTable: self.deviceStatus.append([device,'UNKNOWN']) for status in self.deviceStatus: - if status[2] == 'OK': + if status[1] == 'OK': self.OK = self.OK+1 - elif status[2] == 'NOT OK': + elif status[1] == 'NOT OK': self.FAILED = self.FAILED+1 else: self.handlerError = self.handlerError+1 -- cgit v1.2.3-55-g7522