1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

Update ctdb uptime to provide machinereadable output

(This used to be ctdb commit 4f7f8aa6f178115b551ac35f7df2ec5aad054fe2)
This commit is contained in:
Ronnie Sahlberg 2008-03-04 13:29:48 +11:00
parent 61b52e0e64
commit b1cf2b5653

View File

@ -233,6 +233,15 @@ static int control_uptime(struct ctdb_context *ctdb, int argc, const char **argv
return ret;
}
if (options.machinereadable){
printf(":Current Node Time:Ctdb Start Time:Last Recovery Time:\n");
printf(":%u:%u:%u:\n",
(unsigned int)uptime->current_time.tv_sec,
(unsigned int)uptime->ctdbd_start_time.tv_sec,
(unsigned int)uptime->last_recovery_time.tv_sec);
return 0;
}
printf("Current time of node : %s", ctime(&uptime->current_time.tv_sec));
tmp = uptime->current_time.tv_sec - uptime->ctdbd_start_time.tv_sec;