Version that pushes ps aux when load too high.
This commit is contained in:
parent
da20542bb4
commit
746c84950a
4
dot.c
4
dot.c
@ -17,6 +17,10 @@ void print_load() {
|
|||||||
perror("getloadavg failed");
|
perror("getloadavg failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(loadavg[0] > 0.2){
|
||||||
|
int result = system("ps aux");
|
||||||
|
(void)result;
|
||||||
|
}
|
||||||
printf("%.2f %.2f %.2f", loadavg[0], loadavg[1], loadavg[2]);
|
printf("%.2f %.2f %.2f", loadavg[0], loadavg[1], loadavg[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user