used_hdd_space = r->total_hdd_space - r->free_hdd_space;
printf ("====== System resources ======\n"
+ "Uptime: %10.2f days\n"
"RouterOS version: %11s\n"
"Architecture name: %11s\n"
"Board name: %15s\n"
"Sectors written: %13"PRIu64" (%"PRIu64")\n"
"Bad blocks: %15"PRIu64"\n"
"==============================\n",
- r->version,
+ ((double) r->uptime) / 86400.0, r->version,
r->architecture_name, r->board_name,
r->cpu_model, r->cpu_count, r->cpu_load, r->cpu_frequency,
r->free_memory,
if (strcmp ("re", ros_reply_status (r)) != 0)
return (rt_reply_to_system_resource (ros_reply_next (r), ret));
- /* TODO: Uptime */
+ ret->uptime = sstrtodate (ros_reply_param_val_by_key (r, "uptime"));
ret->version = ros_reply_param_val_by_key (r, "version");
ret->architecture_name = ros_reply_param_val_by_key (r, "architecture-name");