Ticket #232 (closed defect: for support check mailinglist)
RPN expression valid under rrdtool (from shell) and not from Perl RRDs.
| Reported by: | human | Owned by: | oetiker |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | misc | Version: | |
| Keywords: | Cc: |
Description
The following:
# rrdtool graph /tmp/consolidation.png DEF:clusrhel0=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel0/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel1=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel1/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel2=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel2/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel3=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel3/Temp_Node_Collection.rrd:1:AVERAGE CDEF:average=clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/ LINE2:average#00a000 480x155 [root@clusrhel0 PM]#
works fine from the shell whereas, the same thing from the Perl binding RRDS::graph gives the following error message: ERROR while creating RRD graph: invalid rpn expression 'clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/'
So what is the reason?
Thanks.
Version used:
# rrdtool -v RRDtool 1.0.49 Copyright 1997-2004 by Tobias Oetiker <tobi@…>
Usage: rrdtool [options] command command_options
Valid commands: create, update, graph, dump, restore,
last, info, fetch, tune, resize, xport
RRDtool is distributed under the Terms of the GNU General Public License Version 2. (www.gnu.org/copyleft/gpl.html)
For more information read the RRD manpages
Change History
comment:1 follow-up: ↓ 2 Changed 3 years ago by oetiker
- Status changed from new to closed
- Resolution set to worksforme
comment:2 in reply to: ↑ 1 Changed 3 years ago by human
Replying to oetiker:
my guess is that the perl version of your code is not aequivalent to your shell version ... the rpn interpreter is the same in both instances ...
Actually, the 'shell' version comes from the Perl one: [...] print "rrdtool graph $output $defs $cdef $RRD_GRAPH_CMD\n"; my $data = RRDs::graph($output, $defs, $cdef, $RRD_GRAPH_CMD); my $ERR=RRDs::error; So when I execute this Perl script, I have the following: ]# ./consolidate_temp.pl rrdtool graph /tmp/consolidation.png DEF:clusrhel0=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel0/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel1=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel1/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel2=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel2/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel3=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel3/Temp_Node_Collection.rrd:1:AVERAGE CDEF:average=clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/ LINE2:average#00a000 ERROR while creating RRD graph: invalid rpn expression 'clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/'
Then, I copy/paste the 'shell' line, and if executed, I have: [root@clusrhel0 PM]# ./consolidate_temp.pl rrdtool graph /tmp/consolidation.png DEF:clusrhel0=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel0/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel1=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel1/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel2=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel2/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel3=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel3/Temp_Node_Collection.rrd:1:AVERAGE CDEF:average=clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/ LINE2:average#00a000 ERROR while creating RRD graph: invalid rpn expression 'clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/' [root@clusrhel0 PM]# rrdtool graph /tmp/consolidation.png DEF:clusrhel0=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel0/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel1=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel1/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel2=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel2/Temp_Node_Collection.rrd:1:AVERAGE DEF:clusrhel3=/opt/BSMServer-Base/engine/nagios/share/perfdata/clusrhel3/Temp_Node_Collection.rrd:1:AVERAGE CDEF:average=clusrhel0,clusrhel1,clusrhel2,clusrhel3,+,+,+,4,/ LINE2:average#00a000 480x155 [root@clusrhel0 PM]#
So, as far as I understand (I am quite new to Perl), I construct the shell command line using exactly the same String components given to the RRDs::graph function. Therefore, it seems that something differs between the two behavior. Version maybe ? How can I know the Perl version installed ? (The shell version is 1.0.49).
Thanks & Regards.
comment:3 Changed 3 years ago by human
- Status changed from closed to reopened
- Resolution worksforme deleted



my guess is that the perl version of your code is not aequivalent to your shell version ... the rpn interpreter is the same in both instances ...