</refsect3>
</refsect2>
+ <refsect2>
+ <title>natgw {master|list|status}</title>
+ <para>
+ This command shows different aspects of NAT gateway status.
+ For an overview of CTDB's NAT gateway functionality please see
+ the <citetitle>NAT GATEWAY</citetitle> section in
+ <citerefentry><refentrytitle>ctdb</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>.
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>master</term>
+ <listitem>
+ <para>
+ Show the PNN and private IP address of the current NAT
+ gateway master node.
+ </para>
+ <para>
+ Example output:
+ </para>
+ <screen>
+1 192.168.2.201
+ </screen>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>list</term>
+ <listitem>
+ <para>
+ List the private IP addresses of nodes in the current
+ NAT gateway group, annotating the master node.
+ </para>
+ <para>
+ Example output:
+ </para>
+ <screen>
+192.168.2.200
+192.168.2.201 MASTER
+192.168.2.202
+192.168.2.203
+ </screen>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem>
+ <para>
+ List the nodes in the current NAT gateway group and
+ their status.
+ </para>
+ <para>
+ Example output:
+ </para>
+ <screen>
+pnn:0 192.168.2.200 UNHEALTHY (THIS NODE)
+pnn:1 192.168.2.201 OK
+pnn:2 192.168.2.202 OK
+pnn:3 192.168.2.203 OK
+ </screen>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+
<refsect2>
<title>ping</title>
<para>
exit(1);
}
+/* Display NAT gateway status */
+static int control_natgw(struct ctdb_context *ctdb, int argc, const char **argv)
+{
+ static char prog[PATH_MAX+1] = "";
+
+ if (argc != 1) {
+ 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, argv[0], NULL);
+
+ DEBUG(DEBUG_ERR,
+ ("Unable to run NAT gateway helper %s\n", strerror(errno)));
+ exit(1);
+}
+
/*
display the status of the scripts for monitoring (or other events)
*/
{ "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"},
{ "setreclock", control_setreclock, true, false, "Set/clear the reclock file of a node", "[filename]"},