mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
add a ctdb command to print the default public ip of a host.
(This used to be ctdb commit 7de5489f6ebd0e5671e7afa5cb51471043ee46d1)
This commit is contained in:
parent
b5a3653471
commit
2b51871bad
@ -442,6 +442,28 @@ static int control_ip(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
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
|
||||
*/
|
||||
@ -907,6 +929,7 @@ static const struct {
|
||||
{ "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>"},
|
||||
|
Loading…
Reference in New Issue
Block a user