예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
    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 ))
예제 #6
0
 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())
예제 #7
0
    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))
예제 #8
0
 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
예제 #9
0
 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
예제 #10
0
 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())
예제 #11
0
 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())
예제 #12
0
"""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()
예제 #13
0
 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())