Imported Upstream version 1.4.16+git20130919
This commit is contained in:
parent
01ca3b324f
commit
57371046fd
50 changed files with 3885 additions and 500 deletions
|
@ -153,7 +153,16 @@ main (int argc, char **argv)
|
|||
printf (_("Could not open stderr for %s\n"), PATH_TO_UPTIME);
|
||||
}
|
||||
fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process);
|
||||
sscanf (input_buffer, "%*[^l]load average: %lf, %lf, %lf", &la1, &la5, &la15);
|
||||
if(strstr(input_buffer, "load average:")) {
|
||||
sscanf (input_buffer, "%*[^l]load average: %lf, %lf, %lf", &la1, &la5, &la15);
|
||||
}
|
||||
else if(strstr(input_buffer, "load averages:")) {
|
||||
sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15);
|
||||
}
|
||||
else {
|
||||
printf (_("could not parse load from uptime: %s\n"), result, PATH_TO_UPTIME);
|
||||
return STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
result = spclose (child_process);
|
||||
if (result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue