Updates for mbmon

This commit is contained in:
Michiel Broek 2004-03-21 13:40:25 +00:00
parent 85c892cc12
commit 4c4a5f7bef
3 changed files with 9 additions and 8 deletions

View File

@ -118,7 +118,7 @@ v0.51.2 06-Mar-2004
On screen 2 added disk status.
On screen 3, the warning colors for diskspace are now triggered
by the global config setting, red for the upper limit, and
yellow for the upper limit * 4.
yellow for the upper limit * 4. Added RO/RW status indicator.
mbtask:
Added communication commands for disk watch thread.

View File

@ -328,7 +328,7 @@ void system_stat(void)
void disk_stat(void)
{
int ch, i;
int ch, i, ro;
char buf[1024], *cnt, *type, *fs, *p, sign;
unsigned long last[10], size, used, perc, avail;
@ -336,7 +336,7 @@ void disk_stat(void)
set_color(WHITE, BLACK);
mvprintw( 5, 6, "3. FILESYSTEM USAGE");
set_color(YELLOW, RED);
mvprintw( 7, 1, " Size MB Used MB Perc. FS-Type Mountpoint ");
mvprintw( 7, 1, " Size MB Used MB Perc. FS-Type St Mountpoint ");
set_color(CYAN, BLACK);
mvprintw(lines - 2, 6, "Press any key");
IsDoing("Filesystem Usage");
@ -361,7 +361,8 @@ void disk_stat(void)
perc = (used * 100) / size;
sign = ' ';
fs = strtok(NULL, " ");
type = strtok(NULL, ",;");
type = strtok(NULL, " ");
ro = atoi(strtok(NULL, ",;"));
if (used > last[i])
sign = '^';
if (used < last[i])
@ -373,7 +374,7 @@ void disk_stat(void)
mvprintw(i+8, 1, "%8lu %8lu ", size, used);
set_color(WHITE, BLACK);
printf("%c ", sign);
if ((strstr(type, "iso") == NULL) && (strstr(type, "9660") == NULL)) {
if (ro == 0) {
if (avail <= CFG.freespace)
set_color(LIGHTRED, BLACK);
else if (avail <= (CFG.freespace * 4))
@ -381,12 +382,12 @@ void disk_stat(void)
else
set_color(CYAN, BLACK);
} else {
set_color(CYAN, BLACK);
set_color(GREEN, BLACK);
}
printf("%3lu", perc);
putchar('%');
set_color(CYAN, BLACK);
printf(" %-8s %-40s", type, fs);
printf(" %-8s %s %-37s", type, ro ?"RO":"RW", fs);
}
locate(i+8, 1);
clrtoeol();

View File

@ -197,7 +197,7 @@ char *disk_getfs()
else
ans = xstrcat(ans, (char *)",");
tt[0] = '\0';
sprintf(tt, "%lu %lu %s %s", tmp->size, tmp->avail, tmp->mountpoint, tmp->fstype);
sprintf(tt, "%lu %lu %s %s %d", tmp->size, tmp->avail, tmp->mountpoint, tmp->fstype, tmp->ro);
ans = xstrcat(ans, tt);
if (i == 10) /* No more then 10 filesystems */
break;