152 |
|
printw("Mem Free :"); |
153 |
|
|
154 |
|
/* Swap */ |
155 |
< |
move(6, 21); |
156 |
< |
printw("Swap Total:"); |
157 |
< |
move(7, 21); |
158 |
< |
printw("Swap Used :"); |
159 |
< |
move(8, 21); |
160 |
< |
printw("Swap Free :"); |
155 |
> |
move(6, 21); |
156 |
> |
printw("Swap Total:"); |
157 |
> |
move(7, 21); |
158 |
> |
printw("Swap Used :"); |
159 |
> |
move(8, 21); |
160 |
> |
printw("Swap Free :"); |
161 |
|
|
162 |
|
/* VM */ |
163 |
|
move(6, 42); |
354 |
|
/* Network */ |
355 |
|
network_stat_ptr = stats.network_io_stats; |
356 |
|
for(counter=0;counter<stats.network_io_entries;counter++){ |
357 |
< |
move(line, 42); |
357 |
> |
move(line, 42); |
358 |
|
printw("%s", network_stat_ptr->interface_name); |
359 |
|
move(line, 62); |
360 |
|
rt = (network_stat_ptr->systime)? (network_stat_ptr->rx / network_stat_ptr->systime): network_stat_ptr->rx; |
390 |
|
clear(); |
391 |
|
display_headings(); |
392 |
|
display_data(); |
393 |
< |
signal(SIGWINCH, sig_winch_handler); |
393 |
> |
signal(SIGWINCH, sig_winch_handler); |
394 |
|
} |
395 |
|
|
396 |
|
int get_stats(){ |
416 |
|
} |
417 |
|
|
418 |
|
void usage(char *progname){ |
419 |
< |
fprintf(stderr, "Usage: %s [-d delay] [-v] [-h]\n\n", progname); |
420 |
< |
fprintf(stderr, " -d Sets the update time in seconds\n"); |
419 |
> |
fprintf(stderr, "Usage: %s [-d delay] [-v] [-h]\n\n", progname); |
420 |
> |
fprintf(stderr, " -d Sets the update time in seconds\n"); |
421 |
|
fprintf(stderr, " -v Prints version number\n"); |
422 |
< |
fprintf(stderr, " -h Displays this help information.\n"); |
423 |
< |
fprintf(stderr, "\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT); |
424 |
< |
exit(1); |
422 |
> |
fprintf(stderr, " -h Displays this help information.\n"); |
423 |
> |
fprintf(stderr, "\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT); |
424 |
> |
exit(1); |
425 |
|
} |
426 |
|
|
427 |
|
int main(int argc, char **argv){ |
428 |
|
|
429 |
< |
extern char *optarg; |
430 |
< |
int c; |
429 |
> |
extern char *optarg; |
430 |
> |
int c; |
431 |
|
|
432 |
|
time_t last_update = 0; |
433 |
|
|
443 |
|
return 1; |
444 |
|
} |
445 |
|
|
446 |
< |
while ((c = getopt(argc, argv, "vhd:")) != -1){ |
447 |
< |
switch (c){ |
448 |
< |
case 'd': |
449 |
< |
delay = atoi(optarg); |
446 |
> |
while ((c = getopt(argc, argv, "vhd:")) != -1){ |
447 |
> |
switch (c){ |
448 |
> |
case 'd': |
449 |
> |
delay = atoi(optarg); |
450 |
|
if (delay < 1){ |
451 |
|
fprintf(stderr, "Time must be 1 second or greater\n"); |
452 |
|
exit(1); |
453 |
|
} |
454 |
< |
break; |
454 |
> |
break; |
455 |
|
case 'v': |
456 |
|
version_num(argv[0]); |
457 |
|
break; |
460 |
|
usage(argv[0]); |
461 |
|
return 1; |
462 |
|
break; |
463 |
< |
} |
464 |
< |
} |
463 |
> |
} |
464 |
> |
} |
465 |
|
|
466 |
|
signal(SIGWINCH, sig_winch_handler); |
467 |
< |
initscr(); |
468 |
< |
nonl(); |
469 |
< |
cbreak(); |
470 |
< |
noecho(); |
467 |
> |
initscr(); |
468 |
> |
nonl(); |
469 |
> |
cbreak(); |
470 |
> |
noecho(); |
471 |
|
timeout(delay * 1000); |
472 |
< |
window=newwin(0, 0, 0, 0); |
472 |
> |
window=newwin(0, 0, 0, 0); |
473 |
|
clear(); |
474 |
|
|
475 |
|
if(!get_stats()){ |