make 'ctdb ip' provide machinereadble output using '-Y'
authorRonnie Sahlberg <sahlberg@samba.org>
Tue, 4 Mar 2008 02:18:27 +0000 (13:18 +1100)
committerRonnie Sahlberg <sahlberg@samba.org>
Tue, 4 Mar 2008 02:18:27 +0000 (13:18 +1100)
(This used to be ctdb commit 446e2f4e650b12d6fce5677a6841006462c23dba)

ctdb/doc/ctdbd.1
ctdb/doc/ctdbd.1.html
ctdb/tools/ctdb.c

index 274e0ffa0ed892a6561b2305fd5d249d3e8be8a3..baa7d51278d10d0a14b95d008db6dee4e69eb5d9 100644 (file)
@@ -331,7 +331,7 @@ When set to 1, ctdb will not perform failback of ip addresses when a node become
 .PP
 Use with caution! Normally when a node becomes available to the cluster ctdb will try to reassign public ip addresses onto the new node as a way to distribute the workload evenly across the clusternode. Ctdb tries to make sure that all running nodes have approximately the same number of public addresses it hosts.
 .PP
-when you enable this tunable, CTDB will no longer attempt to rebalance the cluster by failing ip addresses back to the new nodes. An unbalanced cluster will therefore remain unbalanced until there is manual intervention from the administrator. (When this parameter is set, you can manually fail public ip addresses over to the new node(s) using the 'ctdb moveip' command.
+When you enable this tunable, CTDB will no longer attempt to rebalance the cluster by failing ip addresses back to the new nodes. An unbalanced cluster will therefore remain unbalanced until there is manual intervention from the administrator. When this parameter is set, you can manually fail public ip addresses over to the new node(s) using the 'ctdb moveip' command.
 .SH "SEE ALSO"
 .PP
 ctdb(1), onnode(1)
index 9960d31db5780f3296e0ebf45bdfa6ef722a0e62..34df46b68b2981d10881463cffcc90fe9e1344fd 100644 (file)
     Use with caution! Normally when a node becomes available to the cluster
 ctdb will try to reassign public ip addresses onto the new node as a way to distribute the workload evenly across the clusternode. Ctdb tries to make sure that all running nodes have approximately the same number of public addresses it hosts.
     </p><p>
-    when you enable this tunable, CTDB will no longer attempt to rebalance the cluster by failing ip addresses back to the new nodes. An unbalanced cluster will therefore remain unbalanced until there is manual intervention from the administrator. (When this parameter is set, you can manually fail public ip addresses over to the new node(s) using the 'ctdb moveip' command.
+    When you enable this tunable, CTDB will no longer attempt to rebalance the cluster by failing ip addresses back to the new nodes. An unbalanced cluster will therefore remain unbalanced until there is manual intervention from the administrator. When this parameter is set, you can manually fail public ip addresses over to the new node(s) using the 'ctdb moveip' command.
     </p></div></div><div class="refsect1" lang="en"><a name="id2529120"></a><h2>SEE ALSO</h2><p>
       ctdb(1), onnode(1)
       <a href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
index b2d6f0efacaad2ebb32fe2838316f703090eda4c..a5e042db3fb3579c5a45a24ba7a5d0193e38b90e 100644 (file)
@@ -720,7 +720,11 @@ static int control_ip(struct ctdb_context *ctdb, int argc, const char **argv)
        }
 
        for (i=1;i<=ips->num;i++) {
-               printf("%s %d\n", inet_ntoa(ips->ips[ips->num-i].sin.sin_addr), ips->ips[ips->num-i].pnn);
+               if (options.machinereadable){
+                       printf(":%s:%d:\n", inet_ntoa(ips->ips[ips->num-i].sin.sin_addr), ips->ips[ips->num-i].pnn);
+               } else {
+                       printf("%s %d\n", inet_ntoa(ips->ips[ips->num-i].sin.sin_addr), ips->ips[ips->num-i].pnn);
+               }
        }
 
        talloc_free(tmp_ctx);