Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: rrdtools PNG debug output #213

Open
gitqlt opened this issue Sep 25, 2018 · 4 comments
Open

Feature Request: rrdtools PNG debug output #213

gitqlt opened this issue Sep 25, 2018 · 4 comments

Comments

@gitqlt
Copy link

gitqlt commented Sep 25, 2018

For debugging, I'd like to generate slightly modified PNG graphs width the rrdtool graph utility.
It would be very useful to see in the monitorix debug log the construction strings of the RRD PNG graphs assembled by the monitorix CGI functions. Something like

rrdtool graph 'graph.png' \
--width '400' \
--height '100' \
--start end-1d \
'DEF:d1=db.rrd:ds1:AVERAGE' \
'CDEF:q=d1,200,+' \
'VDEF:qv=d1,LAST' \
'VRULE:qv#000000' \
'AREA:d1#33FF66:ltex' \
'PRINT:qv:%.1lf'

(The example above was created by http://rrdwizard.appspot.com/)

@mikaku
Copy link
Owner

mikaku commented Sep 26, 2018

Can you, please, provide a screen shot?
Sometimes a picture is worth a thousand words. ;-)

@gitqlt
Copy link
Author

gitqlt commented Sep 26, 2018

Sorry, I cannot provide a screenshot. I suppose that monitorix creates the graphs using the data read from its files (like /var/lib/monitorix/zfs.rrd) and I will be able to regenerate the graphs with rrdtool graph commands, when having the evaluated graph construction strings from the debug log would be a great help. (The example below is from /usr/lib/monitorix/zfs.pm). Please ignore my request if I was wrong and generating the graphs this way is not possible.

    $pic = $rrd{$version}->

    ("$IMG_DIR" . "$IMG1",
        "--title=$config->{graphs}->{_zfs1}  ($tf->{nwhen}$tf->{twhen})",
        "--start=-$tf->{nwhen}$tf->{twhen}",
        "--imgformat=$imgfmt_uc",
        "--vertical-label=bytes",
        "--width=$width",
        "--height=$height",
        @riglim,
        $zoom,
        @{$cgi->{version12}},
        @{$colors->{graph_colors}},
        "DEF:arcsize=$rrd:zfs_arcsize:AVERAGE",
        "DEF:cmax=$rrd:zfs_cmax:AVERAGE",
        "DEF:cmin=$rrd:zfs_cmin:AVERAGE",
        "DEF:c=$rrd:zfs_arctgtsize:AVERAGE",
        "DEF:limit=$rrd:zfs_metalimit:AVERAGE",
        "DEF:max=$rrd:zfs_metamax:AVERAGE",
        "DEF:used=$rrd:zfs_metaused:AVERAGE",
        "CDEF:allvalues=arcsize,cmax,cmin,c,limit,max,used,+,+,+,+,+,+",
        @CDEF,
        "COMMENT: \\n",
        @tmp);

@mikaku
Copy link
Owner

mikaku commented Sep 26, 2018

Ah, I think I understood it now. You mean that you'd like to see real call to RRDs::graph[v], with all the values instead of their corresponding variables?

I don't know if RRDtool has a method to obtain such information, otherwise that would require to include a pre-formatting line before making the call, in order to be able to log its contents.

@mikaku
Copy link
Owner

mikaku commented Feb 24, 2020

In the latest Monitorix version, I've introduced a new option which may help you here.

With this new option, you might include any extra RRDtool option during the graph generation without having to touch a line of Perl code.

I hope that helped you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants