Page 1 of 1

[Nagios-devel] Semicolons replaced by colons in plugin output -

Posted: Mon Mar 23, 2009 8:00 am
by Guest
This is a multi-part message in MIME format.
--------------050307090102000808070006
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


Hi Ethan, hi list,

working on HTML improved plugin output I noticed that semicolons in
plugin output are generally replaced by simple colons. What is the
intention behind that? It makes it very difficult to write HTML
extensions for plugin output.

As a side note: this replacement is only implemented for the
standard plugin output and not for the long_plugin_output.

If there isn't any present reason for it any more I would be very
pleased if these replacements could be removed. A patch against the
current CVS is attached.

Cheers,
-Matthias

--------------050307090102000808070006
Content-Type: text/x-patch;
name="checks.c_no_semicolon_replacement.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="checks.c_no_semicolon_replacement.patch"

--- checks.c.semicolon_replacement 2008-11-30 18:22:58.000000000 +0100
+++ checks.c 2009-03-23 09:40:27.000000000 +0100
@@ -1013,12 +1013,6 @@
if(temp_service->plugin_output==NULL)
temp_service->plugin_output=(char *)strdup("(No output returned from plugin)");

- /* replace semicolons in plugin output (but not performance data) with colons */
- else if((temp_ptr=temp_service->plugin_output)){
- while((temp_ptr=strchr(temp_ptr,';')))
- *temp_ptr=':';
- }
-
log_debug_info(DEBUGL_CHECKS,2,"Parsing check output...\n");
log_debug_info(DEBUGL_CHECKS,2,"Short Output: %s\n",(temp_service->plugin_output==NULL)?"NULL":temp_service->plugin_output);
log_debug_info(DEBUGL_CHECKS,2,"Long Output: %s\n",(temp_service->long_plugin_output==NULL)?"NULL":temp_service->long_plugin_output);
@@ -2725,12 +2719,6 @@
hst->plugin_output=(char *)strdup("(No output returned from host check)");
}

- /* replace semicolons in plugin output (but not performance data) with colons */
- if((temp_ptr=hst->plugin_output)){
- while((temp_ptr=strchr(temp_ptr,';')))
- *temp_ptr=':';
- }
-
/* if we're not doing aggressive host checking, let WARNING states indicate the host is up (fake the result to be STATE_OK) */
if(use_aggressive_host_checking==FALSE && result==STATE_WARNING)
result=STATE_OK;
@@ -3290,12 +3278,6 @@
temp_host->plugin_output=(char *)strdup("(No output returned from host check)");
}

- /* replace semicolons in plugin output (but not performance data) with colons */
- if((temp_ptr=temp_host->plugin_output)){
- while((temp_ptr=strchr(temp_ptr,';')))
- *temp_ptr=':';
- }
-
log_debug_info(DEBUGL_CHECKS,2,"Parsing check output...\n");
log_debug_info(DEBUGL_CHECKS,2,"Short Output: %s\n",(temp_host->plugin_output==NULL)?"NULL":temp_host->plugin_output);
log_debug_info(DEBUGL_CHECKS,2,"Long Output: %s\n",(temp_host->long_plugin_output==NULL)?"NULL":temp_host->long_plugin_output);

--------------050307090102000808070006--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]