return 0;
}
+/*
+ display public ip address of this node
+ */
+static int control_publicip(struct ctdb_context *ctdb, int argc, const char **argv)
+{
+ int ret;
+ struct ctdb_all_public_ips *ips;
+ uint32_t myvnn;
+
+ myvnn = ctdb_ctrl_getvnn(ctdb, TIMELIMIT(), options.vnn);
+
+ ret = ctdb_ctrl_get_public_ips(ctdb, TIMELIMIT(), options.vnn, ctdb, &ips);
+ if (ret != 0) {
+ printf("Unable to get public ips from node %u\n", options.vnn);
+ return ret;
+ }
+
+ printf("%-16s\n", inet_ntoa(ips->ips[myvnn].sin.sin_addr));
+
+ return 0;
+}
+
/*
display pid of a ctdb daemon
*/
{ "statistics", control_statistics, false, "show statistics" },
{ "statisticsreset", control_statistics_reset, true, "reset statistics"},
{ "ip", control_ip, true, "show which public ip's that ctdb manages" },
+ { "publicip", control_publicip, false, "show the default public ip address for this node" },
{ "process-exists", control_process_exists, true, "check if a process exists on a node", "<pid>"},
{ "getdbmap", control_getdbmap, true, "show the database map" },
{ "catdb", control_catdb, true, "dump a database" , "<dbname>"},