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.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 7995408e..66d6a4b7 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -145,6 +145,12 @@ int main(int argc, char **argv) {
145 mp_set_format(config.output_format); 145 mp_set_format(config.output_format);
146 } 146 }
147 147
148 char *ok_summary = NULL;
149 xasprintf(&ok_summary, "Load: 1m: %f - 5m: %f - 15m: %f", load_values[0], load_values[1],
150 load_values[2]);
151 mp_set_ok_summary(&overall, ok_summary);
152 free(ok_summary);
153
148 bool is_using_scaled_load_values = false; 154 bool is_using_scaled_load_values = false;
149 long numcpus; 155 long numcpus;
150 if (config.take_into_account_cpus && ((numcpus = GET_NUMBER_OF_CPUS()) > 0)) { 156 if (config.take_into_account_cpus && ((numcpus = GET_NUMBER_OF_CPUS()) > 0)) {
@@ -156,6 +162,11 @@ int main(int argc, char **argv) {
156 load_values[2] / numcpus, 162 load_values[2] / numcpus,
157 }; 163 };
158 164
165 xasprintf(&ok_summary, "Scaled Load (%ld CPUs): 1m: %f - 5m: %f - 15m: %f", numcpus,
166 load_values[0], load_values[1], load_values[2]);
167 mp_set_ok_summary(&overall, ok_summary);
168 free(ok_summary);
169
159 mp_subcheck scaled_load_sc = mp_subcheck_init(); 170 mp_subcheck scaled_load_sc = mp_subcheck_init();
160 scaled_load_sc = mp_set_subcheck_default_state(scaled_load_sc, STATE_OK); 171 scaled_load_sc = mp_set_subcheck_default_state(scaled_load_sc, STATE_OK);
161 scaled_load_sc.output = "Scaled Load (divided by number of CPUs)"; 172 scaled_load_sc.output = "Scaled Load (divided by number of CPUs)";
@@ -254,7 +265,7 @@ int main(int argc, char **argv) {
254 265
255 if (top_proc.errorcode == OK) { 266 if (top_proc.errorcode == OK) {
256 // +1 here since the string list contains the header line 267 // +1 here since the string list contains the header line
257 for (unsigned long i = 0; i < config.n_procs_to_show +1; i++) { 268 for (unsigned long i = 0; i < config.n_procs_to_show + 1; i++) {
258 xasprintf(&top_proc_sc.output, "%s\n%s", top_proc_sc.output, 269 xasprintf(&top_proc_sc.output, "%s\n%s", top_proc_sc.output,
259 top_proc.top_processes[i]); 270 top_proc.top_processes[i]);
260 } 271 }