summaryrefslogtreecommitdiffstats
path: root/plugins/check_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_load.c')
-rw-r--r--plugins/check_load.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 780ffff..296a823 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -153,7 +153,16 @@ main (int argc, char **argv)
153 printf (_("Could not open stderr for %s\n"), PATH_TO_UPTIME); 153 printf (_("Could not open stderr for %s\n"), PATH_TO_UPTIME);
154 } 154 }
155 fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process); 155 fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process);
156 sscanf (input_buffer, "%*[^l]load average: %lf, %lf, %lf", &la1, &la5, &la15); 156 if(strstr(input_buffer, "load average:")) {
157 sscanf (input_buffer, "%*[^l]load average: %lf, %lf, %lf", &la1, &la5, &la15);
158 }
159 else if(strstr(input_buffer, "load averages:")) {
160 sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15);
161 }
162 else {
163 printf (_("could not parse load from uptime: %s\n"), result, PATH_TO_UPTIME);
164 return STATE_UNKNOWN;
165 }
157 166
158 result = spclose (child_process); 167 result = spclose (child_process);
159 if (result) { 168 if (result) {