@@ -1,5 +1,5 @@
--- check_rhev.orig 2012-02-21 11:35:30.661735279 +0100
-+++ check_rhev 2012-02-21 12:51:11.157307027 +0100
++++ check_rhev 2012-02-21 17:52:31.101692703 +0100
@@ -24,12 +24,6 @@
WARNING = 1
CRITICAL = 2
@@ -13,7 +13,7 @@
# General macros
VDSM_PORT = 54321
TIMEOUT_SOCKET_SEC = 5
-@@ -98,11 +92,52 @@
+@@ -98,11 +92,53 @@
ssh.close()
i += 1
@@ -36,13 +36,14 @@
+ down = 0
+ for line in data:
+ vm,status = line.split(",")
++ status = status.strip('\n\r')
+ if status != 'Up':
+ down += 1
-+ output += "OK: %s %s " % (vm, status.strip('\n\r'))
++ output += "OK: %s %s " % (vm, status)
+
+ output += "@ %s" % (hosts[i])
+ print output
-+ if down == '0':
++ if down == 0:
+ sys.exit(OK)
+ else:
+ sys.exit(WARNING)
@@ -66,7 +67,7 @@
parser.add_option("-v", "--verbose", action="store_true", dest="verbose")
parser.add_option("-q", "--quiet", action="store_false", dest="verbose")
parser.add_option("-t", "--type-service", action="store", dest="type_service")
-@@ -111,7 +146,7 @@
+@@ -111,7 +147,7 @@
parser.add_option("-p", "--password", action="store", dest="passw")
(options, args) = parser.parse_args()
@@ -75,7 +76,7 @@
print "UNKNOWN: please add your RHEV-H hosts into check_rhev!"
sys.exit(UNKNOWN)
-@@ -121,7 +156,7 @@
+@@ -121,7 +157,7 @@
# Generic calls - every option will use them
rhev = checkRHEV()
@@ -84,7 +85,7 @@
user = options.user
passw = options.passw
-@@ -141,6 +176,9 @@
+@@ -141,6 +177,9 @@
if options.type_service == 'checkVMS':
rhev.checkVMS(hosts, user, passw, guest)
sys.exit(CRITICAL)
|