update the uptime command to indicate that time since last is either from alst recove...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 28 Oct 2009 23:58:14 +0000 (10:58 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 28 Oct 2009 23:58:14 +0000 (10:58 +1100)
(This used to be ctdb commit 467da12a785ba3367ed9cbdf79440394e9703289)

ctdb/tools/ctdb.c

index bad4450103721021e9c9c26956d64852ec19ae5e..c1fe88c535e9d13131b0cad598c2c51feb8dfeb1 100644 (file)
@@ -318,7 +318,7 @@ static int control_uptime(struct ctdb_context *ctdb, int argc, const char **argv
        }
 
        if (options.machinereadable){
-               printf(":Current Node Time:Ctdb Start Time:Last Recovery Time:Last Recovery Duration:\n");
+               printf(":Current Node Time:Ctdb Start Time:Last Recovery/Failover Time:Last Recovery/IPFailover Duration:\n");
                printf(":%u:%u:%u:%lf\n",
                        (unsigned int)uptime->current_time.tv_sec,
                        (unsigned int)uptime->ctdbd_start_time.tv_sec,
@@ -329,7 +329,7 @@ static int control_uptime(struct ctdb_context *ctdb, int argc, const char **argv
                return 0;
        }
 
-       printf("Current time of node  : %s", ctime(&uptime->current_time.tv_sec));
+       printf("Current time of node          :                %s", ctime(&uptime->current_time.tv_sec));
 
        tmp = uptime->current_time.tv_sec - uptime->ctdbd_start_time.tv_sec;
        seconds = tmp%60;
@@ -339,7 +339,7 @@ static int control_uptime(struct ctdb_context *ctdb, int argc, const char **argv
        hours   = tmp%24;
        tmp    /= 24;
        days    = tmp;
-       printf("Ctdbd start time      : (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&uptime->ctdbd_start_time.tv_sec));
+       printf("Ctdbd start time              : (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&uptime->ctdbd_start_time.tv_sec));
 
        tmp = uptime->current_time.tv_sec - uptime->last_recovery_finished.tv_sec;
        seconds = tmp%60;
@@ -349,9 +349,9 @@ static int control_uptime(struct ctdb_context *ctdb, int argc, const char **argv
        hours   = tmp%24;
        tmp    /= 24;
        days    = tmp;
-       printf("Time of last recovery : (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&uptime->last_recovery_finished.tv_sec));
+       printf("Time of last recovery/failover: (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&uptime->last_recovery_finished.tv_sec));
        
-       printf("Duration of last recovery : %lf seconds\n",
+       printf("Duration of last recovery/failover: %lf seconds\n",
                timeval_delta(&uptime->last_recovery_finished,
                              &uptime->last_recovery_started));