diff --git a/ChangeLog b/ChangeLog index 215f483b..b618c359 100644 --- a/ChangeLog +++ b/ChangeLog @@ -96,6 +96,9 @@ v0.51.2 06-Mar-2004 mbmon: Switched to use new filesystems command. 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. mbtask: Added communication commands for disk watch thread. diff --git a/lib/clcomm.c b/lib/clcomm.c index da75f353..28484489 100644 --- a/lib/clcomm.c +++ b/lib/clcomm.c @@ -485,7 +485,6 @@ int enoughspace(unsigned long needed) rc = atoi(res); } - Syslog('s', "enoughspace() rc=%d", rc); return rc; } diff --git a/mbmon/mbmon.c b/mbmon/mbmon.c index 00d62456..f470951e 100644 --- a/mbmon/mbmon.c +++ b/mbmon/mbmon.c @@ -330,7 +330,7 @@ void disk_stat(void) { int ch, i; char buf[1024], *cnt, *type, *fs, *p, sign; - unsigned long last[10], size, used, perc; + unsigned long last[10], size, used, perc, avail; clr_index(); set_color(WHITE, BLACK); @@ -356,8 +356,8 @@ void disk_stat(void) for (i = 0; i < atoi(cnt); i++) { p = strtok(NULL, " "); size = atoi(p); - p = strtok(NULL, " "); - used = size - atoi(p); + avail = atoi(strtok(NULL, " ")); + used = size - avail; perc = (used * 100) / size; sign = ' '; fs = strtok(NULL, " "); @@ -373,12 +373,15 @@ void disk_stat(void) mvprintw(i+8, 1, "%8lu %8lu ", size, used); set_color(WHITE, BLACK); printf("%c ", sign); - set_color(CYAN, BLACK); if (strstr(type, "iso") == NULL) { - if (perc >= 95) + if (avail <= CFG.freespace) set_color(LIGHTRED, BLACK); - else if (perc >= 80) + else if (avail <= (CFG.freespace * 4)) set_color(YELLOW, BLACK); + else + set_color(CYAN, BLACK); + } else { + set_color(CYAN, BLACK); } printf("%3lu", perc); putchar('%'); diff --git a/mbtask/taskdisk.c b/mbtask/taskdisk.c index 08c72fe9..0d162e69 100644 --- a/mbtask/taskdisk.c +++ b/mbtask/taskdisk.c @@ -305,7 +305,7 @@ void add_path(char *path) } } Syslog('d', "Should be on \"%s\" \"%s\"", fsname, fstype); - fill_mfslist(&mfs, fsname); + fill_mfslist(&mfs, fsname, fstype); free(fsname); free(fstype); }