1

I'm using RRDs::Simple function and it needs bunch of parameters.

I have placed these parameters in a special variable (parsing, sorting and calculating data from a file) with all quotes, commas and other stuff.

Of course

RRDs::create ($variable);

doesn't work.

I've glanced through all perl special variables and have found nothing.

How to substitute name of variable for the data that contained in that variable? At least could you tell me with what kind of tools(maybe another special variables) it can be done?

1 Answer 1

3

Assuming I'm understanding what you're asking:

You've build the 'create' data in $variable, and are now trying to use RRDs::create to actually do it?

First step is:

  • print $variable,"\n"; - to see what is actually there. You should be able to use this from the command line, with rrdtool create. (Which needs a filename, timestep, and some valid DS and RRA parameters)

  • usually, I'll use an array to pass into RRDs::create:

    RRDs::create ( "test.rrd", "-s 300", 
                "DS:name:GAUGE:600:U:U", )
    

etc.

If $variable contains this information already, then that should be ok. The way to tell what went wrong is:

  if ( RRDs::error ) { print RRDs::error,"\n"; }

It's possible that creating the file is the problem, or that your RRD definitions are invalid for some reason. rrdtool create on command line will tell you, as will RRDs::error;

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer. You understand me right. Also thank you for "RRDs::error"! I've found mistake inside $variable. So, turns out I do not need "some special variable", just print errors in RRDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.