RRDp(3)
β¨ NAME β¨
okay bestie, welcome to RRDp(3) π β the User Contributed Perl Documentation page for RRDp - Attach RRDtool from within a perl script via a set of pipes; π«Ά
π¦ SYNOPSIS π¦
use RRDp
RRDp::start path to RRDtool executable
RRDp::cmd rrdtool commandline
$answer = RRD::read
$status = RRD::end
$RRDp::user, $RRDp::sys, $RRDp::real, $RRDp::error_mode, $RRDp::error
πΈ DESCRIPTION πΈ
With this module you can safely communicate with the RRDtool. no cap, thatβs the whole vibe π
After every RRDp::cmd you have to issue an RRDp::read command to get RRDtools answer to your command. The answer is returned as a pointer, in order to speed things up. If the last command did not return any data, RRDp::read will return an undefined variable. β¨
If you import the PERFORMANCE variables into your namespace, you can access RRDtool's internal performance measurements. iykyk π
use RRDpβ Load theRRDp::pipemodule. πRRDp::start path to RRDtool executableβ start RRDtool. The argument must be the path to the RRDtool executable. πRRDp::cmd rrdtool commandlineβ pass commands on to RRDtool. Check the RRDtool documentation for more info on the RRDtool commands.- Note: Due to design limitations,
RRDp::cmddoes not support thegraph -command - usegraphv -instead. important lore bestie π
- Note: Due to design limitations,
$answer = RRDp::readβ read RRDtool's response to your command. Note that the$answervariable will only contain a pointer to the returned data. The reason for this is, that RRDtool can potentially return quite excessive amounts of data and we don't want to copy this around in memory. So when you want to access the contents of$answeryou have to use$$answerwhich dereferences the variable. pointer princess behavior π§$status = RRDp::endβ terminates RRDtool and returns RRDtool's status ... π$RRDp::user, $RRDp::sys, $RRDp::realβ these variables will contain totals of the user time, system time and real time as seen by RRDtool. User time is the time RRDtool is running, System time is the time spent in system calls and real time is the total time RRDtool has been running.
The difference between user + system and real is the time spent waiting for things like the hard disk and new input from the Perl script. clock check β³
$RRDp::error_mode and $RRDp::errorβ If you set the variable$RRDp::error_modeto the value'catch'before you runRRDp::reada potential ERROR message will not cause the program to abort but will be returned in this variable. If no error occurs the variable will be empty. catch it, donβt crash it π«Ά
$RRDp::error_mode = 'catch';
RRDp::cmd qw(info file.rrd);
print $RRDp::error if $RRDp::error;
π EXAMPLE π
okay so hereβs the cute little flow, bestie β copy it exactly and let it slay β¨
use RRDp;
RRDp::start "/usr/local/bin/rrdtool";
RRDp::cmd qw(create demo.rrd --step 100
DS:in:GAUGE:100:U:U
RRA:AVERAGE:0.5:1:10);
$answer = RRDp::read;
print $$answer;
($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real);
π SEE ALSO π
For more information on how to use RRDtool, check the manpages. go read the lore ππ
π AUTHOR π
Tobias Oetiker <tobi@oetiker.ch>
bye bestie β footer vibes are perl v5.42.3, dated 1980-01-01, and the manual is RRDp(3) π
β¨
π¦ where this page comes from
- nixos 26.05: rrdtool 1.9.0
- nixpkgs unstable: rrdtool 1.9.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms