[collectd] collection.cgi reports error when processing TIME_WAIT data

James Valente jamesv at zupercomputer.net
Fri Nov 2 02:13:11 CET 2007


It appears as though the following patch will allow this to work.

--- collectd-4.2.0/src/tcpconns.c.orig  2007-11-01 16:42:55.000000000 -0700
+++ collectd-4.2.0/src/tcpconns.c       2007-11-01 16:43:11.000000000 -0700
@@ -55,7 +55,7 @@
    "SYN_RECV",
    "FIN_WAIT1",
    "FIN_WAIT2",
-  "TIME_WAIT",
+  "tIME_WAIT",
    "CLOSED",
    "CLOSE_WAIT",
    "LAST_ACK",
@@ -81,7 +81,7 @@
    "CLOSING",
    "LAST_ACK",
    "FIN_WAIT2",
-  "TIME_WAIT"
+  "tIME_WAIT"
  };

  # define TCP_STATE_LISTEN 1


James Valente wrote:
> 
> After further investigation, I have identified the source of the 
> problem.  Apparently, rrdtool reports an error when a DEF name starting 
> with the capital letters "TIME" is used in a CDEF.  This is because 
> "TIME" is a special function when used in a CDEF (see the Time section 
> of the rrdgraph_rpm man page).  (I am using rrdtool 1.2.12).
> 
> As a result, the use of TIME_WAIT_avg by collectd in the CDEF causes the 
> following error.
> 
>    invalid rpn expression in: TIME_WAIT_avg,UN,0,TIME_WAIT_avg,IF
> 
> Solution is to rename the variable to something other than TIME_WAIT.
> 
> 
> James Valente wrote:
>>
>> When invoking the collection.cgi script, I receive the following error 
>> output for each directory of "tcpconns-[portnum]-local" data.
>>
>>    [Wed Oct 31 21:51:04 2007] collection.cgi: RRDs::graph:
>>    invalid rpn expression in: TIME_WAIT_avg,UN,0,TIME_WAIT_avg,IF
>>    at /usr/local/lighttpd/htdocs/cgi-bin/collection.cgi line 2446
>>
>> The line number refers to the "if" line of code in the 
>> "meta_graph_generic_stack" sub of the collection.cgi script.  (I point 
>> this out, because my version of collection.cgi is slightly different 
>> after I added a couple of "use lib [directory]" lines.
>>
>>   RRDs::graph (@cmd);
>>   if (my $errmsg = RRDs::error ())           # line 2446
>>   {
>>     confess ("RRDs::graph: $errmsg");
>>   }
>>
>> There appears to be something wrong within the tcpconns TIMW_WAIT RRD 
>> files themselves.  After shutting down the collectd daemon, I then 
>> deleted all TIME_WAIT files.
>>
>>    rm tcpconns-*/*TIME_WAIT*
>>
>> I then re-invoked the collection.cgi script successfully, with a graph 
>> resulting -- albeit without any TIME_WAIT data.
>>
>> I have uploaded an "rrdtool dump" version of my TIME_WAIT RRD data 
>> file to the following web site.  There, you will find a complete, gzip 
>> compressed version of the TIME_WAIT file, as well as a version with 
>> all data points removed.
>>
>>    http://www.zupercomputer.net/misc/collectd-TIME_WAIT-error/
>>
>>
>>
> 

-- 
----------------------------------------------------------------
antispam signature key:  a0b7b92f29276f726b2741205caf799c
----------------------------------------------------------------



More information about the collectd mailing list