Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

rrdtool.OperationalError: bad CF: MAXCDEF #31

Closed
VeNoMouS opened this issue Nov 11, 2019 · 2 comments
Closed

rrdtool.OperationalError: bad CF: MAXCDEF #31

VeNoMouS opened this issue Nov 11, 2019 · 2 comments
Assignees

Comments

@VeNoMouS
Copy link

VeNoMouS commented Nov 11, 2019

Describe the bug
Getting this error

rrdtool.OperationalError: bad CF: MAXCDEF

To Reproduce
Steps to reproduce the behavior:
something as simple as the followng

rrdtool.graph(
    '/tmp/out.png',
    '--start',
    '1546296957',
    '--end',
    '1573426557',
    'DEF:outoctets=/tmp/port-668.rrd:OUTOCTETS:AVERAGE',
    'DEF:inoctets=/tmp/port-668.rrd:INOCTETS:AVERAGE',
    'DEF:outoctets_max=/tmp/port-668.rrd:OUTOCTETS:MAX',
    'DEF:inoctets_max=/tmp/port-668.rrd:INOCTETS:MAX'
    'CDEF:octets=inoctets,outoctets,+',
    'CDEF:outbits=outoctets,8,*',
    'CDEF:inbits=inoctets,8,*',
    'CDEF:highbits=inoctets,outoctets,MAX,8,*',
)

**Expected behavior**
For it to work, it does in cmd line

**Screenshots**
If applicable, add screenshots and/or console outputs to help explain your problem.

![image](https://user-images.githubusercontent.com/597545/68554100-017a9f00-048b-11ea-9fe8-119e619ebcb2.png)

**Desktop (please complete the following information):**
 - Python version:
 - RRDtool version:
 - python-rrdtool version:

**Additional context**
Add any other context about the problem here.
@VeNoMouS VeNoMouS added the bug label Nov 11, 2019
@commx commx self-assigned this Nov 12, 2019
@commx
Copy link
Owner

commx commented Nov 12, 2019

Hi,

this looks not like a bug in the bindings, as they call the internal rrdtool functions with the given parameters as-is.

Your graph call triggers some internal error without setting an error message (as it usually happens when something is wrong). The command line client will simply ignore that and exit with status code 0 while the bindings will raise an exception since the rrdtool function rrd_graph (part of librrd) returns with a non-zero status code.

Your Python example in the screenshot lacks a trailing comma before the first CDEF argument.

In the end, your parameters are somehow broken. Calling rrdtool graph with the provided arguments will exit with status code 0, but no file is created. You may report that to upstream as it should exit with a non-zero status code and display an error on what went wrong (IMO).

@VeNoMouS
Copy link
Author

VeNoMouS commented Nov 12, 2019

In the end, i wrapped the output in ‘sh’ module as I’m doing prints, to extract 95th percentile information , don’t actually need to graph it

@commx commx removed the bug label Nov 12, 2019
@commx commx closed this as completed Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants