Menu

#70 func feature bug / no documentation

open
None
5
2002-06-21
2002-06-20
Anonymous
No

1. Documentation.
The func feature is mentioned in the documentation as
an alternate way to provide data to the collector. They
documentation is scarce, and does not provide an
example.
The syntax appears to be:
data-source = "func:getMyData(%parm1%,%
parm2%,35)"
A simple example like this in the docs would be useful.

2. Parameters passed to perl eval() function
using "func:" can not begin with numbers, and possibly
other characters. eval() apparently thinks a number
should be followed by an arithmetic or other operator.

The way around this today, is to use the perl q/
quoteword function within your datasource definition like
this.

data-source = "func:getStrangeData(q/%mytag%/,q/%
param1%/)"

However it would be nice if the func: code could provide
the q// for each parameter, of course this would
probably require parsing the actual function call string,
to locate each parameter, building a new string with the
quotewording around each parameter. The new string
would be passed go the eval() function.

The advantage would be that users would not need to
add q// to the params, making the config tree easier to
read. Also the q// syntax is not very intuative especially
for non-programmer users.

I haven't looked deeply in the code, but maybe func.pm
is where the mod could be made.

Mike.

Discussion

  • Bert Driehuis

    Bert Driehuis - 2002-06-21
    • assigned_to: nobody --> driehuis
     
  • Bert Driehuis

    Bert Driehuis - 2002-06-21

    Logged In: YES
    user_id=8475

    Eliminating the need for q// is non-trivial. I will update
    the docs with your suggestions is noone beats me to it
    (assigning this bug to me in the mean time).

     

Log in to post a comment.