@@ -0,0 +1,100 @@
+--- check_rhev.orig 2012-02-21 11:35:30.661735279 +0100
++++ check_rhev 2012-02-21 12:34:46.132775917 +0100
+@@ -24,12 +24,6 @@
+ WARNING = 1
+ CRITICAL = 2
+
+-###############
+-# ATTENTION: #
+-###############
+-# Add your rhev-h host below, like "192.168.1.101,192.168.1.102, ..."
+-HOSTS = ""
+-
+ # General macros
+ VDSM_PORT = 54321
+ TIMEOUT_SOCKET_SEC = 5
+@@ -98,11 +92,45 @@
+ ssh.close()
+ i += 1
+
++ ##########################################################################
++ # checkALL() #
++ # Description: Check All Guests #
++ ##########################################################################
++
++
++ def checkALL(self, hosts, user, passw):
++ i = 0
++ while(i < len(hosts)):
++ ssh = paramiko.SSHClient()
++ ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
++ try:
++ ssh.connect(hosts[i],username=user,password=passw)
++ stdin, stdout, stderr = ssh.exec_command(VDSM_COMMAND + ' -s 0 list table|awk \'{print $(NF-1)}\'')
++ data = stdout.readlines()
++ output= ""
++ for line in data:
++ status = "Up"
++ output += "OK: %s UP " % (line.strip('\n\r'))
++ output += "@ %s" % (hosts[i])
++ print output
++ sys.exit(OK)
++ error = stderr.readlines()
++ for line in error:
++ status = "command not found"
++ if line.find(status) != -1:
++ print "error: please install vdsClient, host: %s" % hosts[i]
++ except Exception, e:
++ ssh.close()
++
++ ssh.close()
++ i += 1
++
+ # MAIN
+ if __name__ == "__main__":
+
+ usage = "usage: %prog [options] arg"
+ parser = OptionParser(usage)
++ parser.add_option("-H", "--host", action="store", dest="HOSTS")
+ 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 +139,7 @@
+ parser.add_option("-p", "--password", action="store", dest="passw")
+ (options, args) = parser.parse_args()
+
+- if HOSTS == "":
++ if options.HOSTS == "":
+ print "UNKNOWN: please add your RHEV-H hosts into check_rhev!"
+ sys.exit(UNKNOWN)
+
+@@ -121,7 +149,7 @@
+
+ # Generic calls - every option will use them
+ rhev = checkRHEV()
+- hosts = HOSTS.split(",")
++ hosts = options.HOSTS.split(",")
+
+ user = options.user
+ passw = options.passw
+@@ -141,6 +169,9 @@
+ if options.type_service == 'checkVMS':
+ rhev.checkVMS(hosts, user, passw, guest)
+ sys.exit(CRITICAL)
++ if options.type_service == 'checkALL':
++ rhev.checkALL(hosts, user, passw)
++ sys.exit(CRITICAL)
+ else:
+ print "UNKNOWN: invalid option, please verify check_rhev -h"
+ sys.exit(UNKNOWN)
+--- README.orig 2012-02-21 12:36:02.956972975 +0100
++++ README 2012-02-21 12:37:38.500123516 +0100
+@@ -1,2 +1,8 @@
+ All info available at:
+ http://github.com/dougsland/nagios-plugins-rhev/wiki
++
++Service Types:
++ - checkHOST
++ - checkVMS (needs options -u, -p, -g)
++ - checkALL (needs optiosn -u, -p)
++
|