</refsect3>
</refsect2>
- <refsect2>
- <title>natgwlist</title>
- <para>
- Show the current NAT gateway master and the status of all
- nodes in the current NAT gateway group. See the
- <citetitle>NAT GATEWAY</citetitle> section in
- <citerefentry><refentrytitle>ctdb</refentrytitle>
- <manvolnum>7</manvolnum></citerefentry> for more details.
- </para>
-
- <refsect3>
- <title>Example</title>
- <screen>
-# ctdb natgwlist
-0 192.168.2.200
-Number of nodes:4
-pnn:0 192.168.2.200 OK (THIS NODE)
-pnn:1 192.168.2.201 OK
-pnn:2 192.168.2.202 OK
-pnn:3 192.168.2.203 OK
- </screen>
- </refsect3>
- </refsect2>
-
<refsect2>
<title>natgw {master|list|status}</title>
<para>
return ret;
}
-/*
- display the list of nodes belonging to this natgw configuration
- */
-static int control_natgwlist(struct ctdb_context *ctdb, int argc, const char **argv)
-{
- static char prog[PATH_MAX+1] = "";
-
- if (argc != 0) {
- usage();
- }
-
- if (!ctdb_set_helper("NAT gateway helper", prog, sizeof(prog),
- "CTDB_NATGW_HELPER", CTDB_HELPER_BINDIR,
- "ctdb_natgw")) {
- DEBUG(DEBUG_ERR, ("Unable to set NAT gateway helper\n"));
- exit(1);
- }
-
- execl(prog, prog, "natgwlist", NULL);
-
- DEBUG(DEBUG_ERR,
- ("Unable to run NAT gateway helper %s\n", strerror(errno)));
- exit(1);
-}
-
/* Display NAT gateway status */
static int control_natgw(struct ctdb_context *ctdb, int argc, const char **argv)
{
{ "scriptstatus", control_scriptstatus, true, false, "show the status of the monitoring scripts (or all scripts)", "[all]"},
{ "enablescript", control_enablescript, true, false, "enable an eventscript", "<script>"},
{ "disablescript", control_disablescript, true, false, "disable an eventscript", "<script>"},
- { "natgwlist", control_natgwlist, false, true, "show the nodes belonging to this natgw configuration"},
{ "natgw", control_natgw, false, true, "show NAT gateway configuration ", "[master|list|status]"},
{ "xpnn", control_xpnn, false, true, "find the pnn of the local node without talking to the daemon (unreliable)" },
{ "getreclock", control_getreclock, true, false, "Show the reclock file of a node"},
master Display node number and private IP address of master node
list List private IP addresses of nodes in group, annotate master
status Show status of nodes in NAT gateway group
- natgwlist Combination of "master" and "status", for backward compatiblity
EOF
exit 1
}
EOF
}
-# For backward compatibility
-natgwlist ()
-{
- _ret=0
- find_master
- if [ $? -eq 2 ] ; then
- echo "-1 0.0.0.0"
- _ret=2
- fi
- _t=$(nodes_status) || return $?
- _n=$(echo "$_t" | wc -l)
- echo "Number of nodes:${_n}"
- echo "$_t"
- return $_ret
-}
-
prog=$(basename "$0")
cmd="$1"
master) find_master ;;
list) nodes_list ;;
status) nodes_status ;;
- natgwlist) natgwlist ;;
*) usage ;;
esac