def service_status(self): site=(clusterlib().site if hasattr(clusterlib(),'site') else 'prod') status, output = commands.getstatusoutput("sudo /usr/bin/omd status %s" % ( site )) x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def check_ha(self): site=(clusterlib().site if hasattr(clusterlib(),'site') else 'prod') output = clusterlib().other_node_execute("sudo /usr/bin/omd status %s" % ( site )) x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def service_status(self): site = (clusterlib().site if hasattr(clusterlib(), 'site') else 'prod') status, output = commands.getstatusoutput( "sudo /usr/bin/omd status %s" % (site)) x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def check_ha(self): site = (clusterlib().site if hasattr(clusterlib(), 'site') else 'prod') output = clusterlib().other_node_execute( "sudo /usr/bin/omd status %s" % (site)) x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def service_stop(self): site=(clusterlib().site if hasattr(clusterlib(),'site') else 'prod') status, output = commands.getstatusoutput("sudo /usr/bin/omd stop %s" % ( site )) if self.service_status() == False: clusterlib().logprint("I","%s -- OMD stopped successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint("W","%s -- All OMD services did not stop." % clusterlib().get_this_node_address()) clusterlib().umount("/opt/omd/sites/%s/tmp" % ( site ))
def service_start(self): site=(clusterlib().site if hasattr(clusterlib(),'site') else 'prod') status, output = commands.getstatusoutput("sudo /usr/bin/omd start %s" % ( site )) if self.service_status() == True: clusterlib().logprint("I","%s -- OMD started successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint("W","%s -- All OMD services did not start." % clusterlib().get_this_node_address())
def service_stop(self): site = (clusterlib().site if hasattr(clusterlib(), 'site') else 'prod') status, output = commands.getstatusoutput("sudo /usr/bin/omd stop %s" % (site)) if self.service_status() == False: clusterlib().logprint( "I", "%s -- OMD stopped successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint( "W", "%s -- All OMD services did not stop." % clusterlib().get_this_node_address()) clusterlib().umount("/opt/omd/sites/%s/tmp" % (site))
def check_ha(self): output = clusterlib().other_node_execute("sudo /home/go/etc/init.d/go-server status") x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def check_ha(self): output = clusterlib().other_node_execute( "sudo /home/go/etc/init.d/go-server status") x = [row for row in output.split("\n") if "running" in row] if len(x) == 6: return True else: return False
def service_start(self): site = (clusterlib().site if hasattr(clusterlib(), 'site') else 'prod') status, output = commands.getstatusoutput( "sudo /usr/bin/omd start %s" % (site)) if self.service_status() == True: clusterlib().logprint( "I", "%s -- OMD started successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint( "W", "%s -- All OMD services did not start." % clusterlib().get_this_node_address())
def service_stop(self): status, output = commands.getstatusoutput( "sudo /home/go/etc/init.d/go-server stop") if self.service_status() == False: clusterlib().logprint( "I", "%s -- GO stopped successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint( "W", "%s -- GO did not stop." % clusterlib().get_this_node_address())
"""Usage: cluster-test.py [--network-magic=MAGIC] [--state-dir=DIR] Options: -n, --network-magic <magic> network magic [default: 42] -s, --state-dir <dir> state directory [default: "./state-cluster-test"] """ from docopt import docopt from clusterlib import clusterlib arguments = docopt(__doc__) cluster = clusterlib(arguments['--network-magic'], arguments["--state-dir"]) cluster.refreshPParams()
def service_stop(self): status, output = commands.getstatusoutput("sudo /home/go/etc/init.d/go-server stop") if self.service_status() == False: clusterlib().logprint("I","%s -- GO stopped successfully." % clusterlib().get_this_node_address()) else: clusterlib().logprint("W","%s -- GO did not stop." % clusterlib().get_this_node_address())