Perfdata truncated
Marc Powell
marc at ena.com
Fri Sep 9 16:59:06 CEST 2005
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Andrea Gabellini
> Sent: Friday, September 09, 2005 6:22 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Perfdata truncated
>
> Hi,
>
> I wrote a plugin that return many perfdata. The output looks like it:
>
> Sessions in: 27 - Sessions out: 82 | '195.219.218.138'=1 'EX1'=1
> 'EX1-h323'=29 'EX2'=3 'EX2-h323'=15 'Ibasis-SIP-1'=3 'Ibasis-SIP-2'=1
> 'ditutel1-h323'=1 'ditutel10-h323'=1 'ditutel11-h323'=2
'ditutel12-h323'=2
> 'ditutel15-h323'=1 'ditutel18-h323'=1 'ditutel19-h323'=1
'ditutel2-h323'=2
> 'ditutel20-h323'=1 'ditutel3-h323'=1 'ditutel4-h323'=3
'ditutel5-h323'=1
> 'ditutel6-h323'=1 'ditutel7-h323'=1 'ipcrossing-h323'=1
> 'netglobalis-h323'=2 'planetit2-h323'=3 'planetit3-h323'=4
> 'planetit4-h323'=3 'silvertech-h323'=18 'technosphere-h323'=2
> 'technosphere2-h323'=1 'tseyva-h323'=3
>
> In the perfdata-service.log file the perfdata is truncated like it:
>
> 1126260797 localhost DETAIL Sessions in: 17 - Sessions
out:
> 54 OK 'EX1'=1 'EX1-h323'=13 'EX2'=1 'EX2-h323'=19
> 'Ibasis-SIP-1'=1 'Ibasis-SIP-2'=1 'ditutel10-h323'=1
'ditutel12-h323'=1
> 'ditutel13-h323'=1 'ditutel18-h323'=3 'ditutel19-h323'=1
'ditutel2-h323'=1
> 'ditutel20-h323'=2 'ditutel4-h323'=1 'ditutel5-h323'=1
'ditutel7-h323'=1
> 'ditutel9-h323'=3 'netglobalis-h323'=1 'plane
>
> I looked in the source code (2b4) but I didn't find anything (I'm not
a
> real C programmer :-( )
>
> Can someone help me?
Looking at checks.c, this appears to be controlled by the variable
MAX_PLUGIN_OUTPUT_LENGTH --
/* get performance data (if it exists) */
strncpy(temp_plugin_output,queued_svc_msg.output,sizeof(temp_plugin_outp
ut)-1);
temp_plugin_output[sizeof(temp_plugin_output)-1]='\x0';
temp_ptr=strtok(temp_plugin_output,"|\n");
temp_ptr=strtok(NULL,"\n");
if(temp_ptr!=NULL){
strip(temp_ptr);
strncpy(temp_service->perf_data,temp_ptr,MAX_PLUGINOUTPUT_LENGTH-1);
temp_service->perf_data[MAX_PLUGINOUTPUT_LENGTH-1]='\x0';
}
Which is
objects.h:#define MAX_PLUGINOUTPUT_LENGTH 352
/* max. length of plugin output */
You could try increasing that value but it may have undesired effects.
If you're using NSCA for passive checks you'll need to increase
MAX_INPUT_BUFFER (I believe) there as well. For passive checks, be sure
the value you use is less than your OS's PIPE_BUF size. You may just
want to re-write your plugin to return less data per check and check for
subsets of the above information.
HTH,
--
Marc
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list