diff options
-rw-r--r-- | plugins/check_nt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/check_nt.c b/plugins/check_nt.c index f76a52a..fa93fce 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c | |||
@@ -356,7 +356,12 @@ int main(int argc, char **argv){ | |||
356 | { | 356 | { |
357 | /* Let's format the output string, finally... */ | 357 | /* Let's format the output string, finally... */ |
358 | 358 | ||
359 | asprintf (&output_message, "%s = %.2f %s", description, counter_value, counter_unit); | 359 | if (strstr(description, "%") == NULL) { |
360 | asprintf (&output_message, "%s = %.2f %s", description, counter_value, counter_unit); | ||
361 | } else { | ||
362 | /* has formatting, will segv if wrong */ | ||
363 | asprintf (&output_message, description, counter_value); | ||
364 | } | ||
360 | output_message = strcat (output_message, "|"); | 365 | output_message = strcat (output_message, "|"); |
361 | output_message = strcat (output_message, | 366 | output_message = strcat (output_message, |
362 | fperfdata (description, counter_value, counter_unit, | 367 | fperfdata (description, counter_value, counter_unit, |
@@ -672,7 +677,8 @@ Windows NT/2000/XP/2003 server.\n\n")); | |||
672 | Request a -l parameters with the following syntax:\n\ | 677 | Request a -l parameters with the following syntax:\n\ |
673 | -l \"\\\\<performance object>\\\\counter\",\"<description>\n\ | 678 | -l \"\\\\<performance object>\\\\counter\",\"<description>\n\ |
674 | The <description> parameter is optional and \n\ | 679 | The <description> parameter is optional and \n\ |
675 | is given to a printf output command which require a float parameters.\n\ | 680 | is given to a printf output command which requires a float parameter.\n\ |
681 | If <description> does not include \"%%\", it is used as a label.\n\ | ||
676 | Some examples:\n\ | 682 | Some examples:\n\ |
677 | \"Paging file usage is %%.2f %%%%\"\n\ | 683 | \"Paging file usage is %%.2f %%%%\"\n\ |
678 | \"%%.f %%%% paging file used.\"\n")); | 684 | \"%%.f %%%% paging file used.\"\n")); |