Example #1
0
def status_cmd(argv):
    if len(argv) == 0:
        full_status()
        sys.exit(0)

    sub_cmd = argv.pop(0)
    if (sub_cmd == "help"):
        usage.status(argv)
    elif (sub_cmd == "resources"):
        resource.resource_show(argv)
    elif (sub_cmd == "groups"):
        resource.resource_group_list(argv)
    elif (sub_cmd == "cluster"):
        cluster_status(argv)
    elif (sub_cmd == "nodes"):
        nodes_status(argv)
    elif (sub_cmd == "pcsd"):
        cluster.cluster_gui_status(argv)
    elif (sub_cmd == "xml"):
        xml_status()
    elif (sub_cmd == "corosync"):
        corosync_status()
    else:
        usage.status()
        sys.exit(1)
Example #2
0
def status_cmd(argv):
    #print("rrr 02000 status_cmd(argv): ", argv)
    
    #with open("/python.out", "a") as myfile:
    #    myfile.write("rrr 02000 status_cmd(argv): " + '#'.join([argv]))
    
    if len(argv) == 0:
        full_status()
        sys.exit(0)

    #print("rrr 02001 after status_cmd")
    with open("/python.out", "a") as myfile:
        myfile.write("rrr 02001 after status_cmd")
    sub_cmd = argv.pop(0)
    if (sub_cmd == "help"):
        usage.status(argv)
    elif (sub_cmd == "resources"):
        resource.resource_show(argv)
    elif (sub_cmd == "groups"):
        resource.resource_group_list(argv)
    elif (sub_cmd == "cluster"):
        cluster_status(argv)
    elif (sub_cmd == "nodes"):
        nodes_status(argv)
    elif (sub_cmd == "pcsd"):
        cluster.cluster_gui_status(argv)
    elif (sub_cmd == "xml"):
        xml_status()
    elif (sub_cmd == "corosync"):
        corosync_status()
    else:
        usage.status()
        sys.exit(1)
Example #3
0
def status_cmd(argv):
    if len(argv) == 0:
        full_status()
        sys.exit(0)

    sub_cmd = argv.pop(0)
    if (sub_cmd == "help"):
        usage.status(argv)
    elif (sub_cmd == "resources"):
        resource.resource_show(argv)
    elif (sub_cmd == "groups"):
        resource.resource_group_list(argv)
    elif (sub_cmd == "cluster"):
        cluster_status(argv)
    elif (sub_cmd == "nodes"):
        nodes_status(argv)
    elif (sub_cmd == "pcsd"):
        cluster.cluster_gui_status(argv)
    elif (sub_cmd == "xml"):
        xml_status()
    elif (sub_cmd == "corosync"):
        corosync_status()
    else:
        usage.status()
        sys.exit(1)
Example #4
0
def full_status():
    if "--full" in utils.pcs_options:
        (output, retval) = utils.run(["crm_mon", "-1", "-r", "-R", "-A", "-f"])
    else:
        (output, retval) = utils.run(["crm_mon", "-1", "-r"])

    if (retval != 0):
        utils.err("cluster is not currently running on this node")

    if not utils.usefile or "--corosync_conf" in utils.pcs_options:
        cluster_name = utils.getClusterName()
        print "Cluster name: %s" % cluster_name

    if utils.stonithCheck():
        print("WARNING: no stonith devices and stonith-enabled is not false")

    if utils.corosyncPacemakerNodeCheck():
        print("WARNING: corosync and pacemaker node names do not match (IPs used in setup?)")

    print output

    if not utils.usefile:
        if not utils.is_rhel6():
            print "PCSD Status:"
            cluster.cluster_gui_status([],True)
            print ""
        utils.serviceStatus("  ")
Example #5
0
def print_pcsd_daemon_status():
    print("PCSD Status:")
    if os.getuid() == 0:
        cluster.cluster_gui_status([], True)
    else:
        err_msgs, exitcode, std_out, std_err = utils.call_local_pcsd(["status", "pcsd"], True)
        if err_msgs:
            for msg in err_msgs:
                print(msg)
        if 0 == exitcode:
            print(std_out)
        else:
            print("Unable to get PCSD status")
Example #6
0
def print_pcsd_daemon_status():
    print("PCSD Status:")
    if os.getuid() == 0:
        cluster.cluster_gui_status([], True)
    else:
        err_msgs, exitcode, std_out, std_err = utils.call_local_pcsd(
            ['status', 'pcsd'], True)
        if err_msgs:
            for msg in err_msgs:
                print(msg)
        if 0 == exitcode:
            print(std_out)
        else:
            print("Unable to get PCSD status")
Example #7
0
File: status.py Project: WeiRG/pcs
def print_pcsd_daemon_status():
    print "PCSD Status:"
    if os.getuid() == 0:
        cluster.cluster_gui_status([], True)
    else:
        err_msgs, exitcode, std_out, std_err = utils.call_local_pcsd(
            ['status', 'pcsd'], True
        )
        if err_msgs:
            for msg in err_msgs:
                print msg
        if 0 == exitcode:
            print std_out
        else:
            print "Unable to get PCSD status"
Example #8
0
def full_status():
    (output, retval) = utils.run(["crm_mon", "-1", "-r"])

    if (retval != 0):
        utils.err("cluster is not currently running on this node")

    cluster_name = utils.getClusterName()
    print "Cluster name: %s" % cluster_name

    if utils.stonithCheck():
        print("WARNING: no stonith devices and stonith-enabled is not false")

    print output
    print ""
    if not utils.is_rhel6():
        print "PCSD Status:"
        cluster.cluster_gui_status([],True)
        print ""
    utils.serviceStatus("  ")
Example #9
0
def full_status():
    (output, retval) = utils.run(["crm_mon", "-1", "-r"])

    if (retval != 0):
        utils.err("cluster is not currently running on this node")

    cluster_name = utils.getClusterName()
    print "Cluster name: %s" % cluster_name

    if utils.stonithCheck():
        print("WARNING: no stonith devices and stonith-enabled is not false")

    print output
    print ""
    if not utils.is_rhel6():
        print "PCSD Status:"
        cluster.cluster_gui_status([], True)
        print ""
    utils.serviceStatus("  ")
Example #10
0
def print_pcsd_daemon_status():
    print "PCSD Status:"
    if os.getuid() == 0:
        #print("rrr 02250: status.py print_pcsd_daemon_status() os.getuid() == 0 cluster.cluster_gui_status()")
        with open("/python.out", "a") as myfile:
            myfile.write("rrr 02250: status.py print_pcsd_daemon_status() os.getuid() == 0 cluster.cluster_gui_status()")
        cluster.cluster_gui_status([], True)
    else:
        #print("rrr 02260: status.py print_pcsd_daemon_status() else utils.call_local_pcsd()")
        with open("/python.out", "a") as myfile:
            myfile.write("rrr 02260: status.py print_pcsd_daemon_status() else utils.call_local_pcsd()")
        err_msgs, exitcode, std_out, std_err = utils.call_local_pcsd(
            ['status', 'pcsd'], True
        )
        if err_msgs:
            for msg in err_msgs:
                print msg
        if 0 == exitcode:
            print std_out
        else:
            print "Unable to get PCSD status"
Example #11
0
def full_status():
    if "--full" in utils.pcs_options:
        (output, retval) = utils.run(["crm_mon", "-1", "-r", "-R"])
    else:
        (output, retval) = utils.run(["crm_mon", "-1", "-r"])

    if (retval != 0):
        utils.err("cluster is not currently running on this node")

    if not utils.usefile or "--corosync_conf" in utils.pcs_options:
        cluster_name = utils.getClusterName()
        print "Cluster name: %s" % cluster_name

    if utils.stonithCheck():
        print("WARNING: no stonith devices and stonith-enabled is not false")

    print output

    if not utils.usefile:
        if not utils.is_rhel6():
            print "PCSD Status:"
            cluster.cluster_gui_status([], True)
            print ""
        utils.serviceStatus("  ")