Discussion:
[rrd-users] be more selective with datasources to plot
(too old to reply)
Alceu R. de Freitas Jr.
2014-10-13 14:26:02 UTC
Permalink
Greetings,
I'm creating a rrdtool database with a large number of datasources (~45). It is working fine, but due the large number of datasources, it's pretty hard to make find out which line is which datasource based on the legend since I'm forced to used small intervals of color to make them different to the eyes.
Just to illustrate, I used an array to fetch a color for each line (hope it is OK to put Perl code here):
    my @colors = (
        '000080', '0000CD', '006400', '008080', '00BFFF', '00FA9A',
        '00FF7F', '00FFFF', '1E90FF', '228B22', '2F4F4F', '3CB371',
        '4169E1', '483D8B', '4B0082', '5F9EA0', '66CDAA', '6A5ACD',
        '708090', '7B68EE', '7FFF00', '800000', '808000', '87CEEB',
        '8A2BE2', '8B008B', '8FBC8F', '9370DB', '98FB98', '9ACD32',
        'A52A2A', 'ADD8E6', 'AFEEEE', 'B0E0E6', 'B8860B', 'BC8F8F',
        'C0C0C0', 'CD5C5C', 'D2691E', 'D3D3D3', 'DA70D6', 'DB7093',
        'DCDCDC', 'DEB887', 'E6E6FA', 'EE82EE', 'F08080', 'F0F8FF',
        'F0FFFF', 'F5DEB3', 'F5F5F5', 'F8F8FF', 'FAEBD7', 'FAFAD2',
    );

In most of cases, only part of those datasources will have interesting results (~8% of datasources will have values near zero). I would like to filter only the datasources that have a value greater than a threshold.
My naive attempt was to use fetch with the same values I'll be using for graph (start date, end date an cfunc).
Is this procedure correct? Is there a better way to do that?
Thanks,
Alceu
Simon Hobson
2014-10-13 14:37:06 UTC
Permalink
Post by Alceu R. de Freitas Jr.
In most of cases, only part of those datasources will have interesting results (~8% of datasources will have values near zero). I would like to filter only the datasources that have a value greater than a threshold.
Fetch isn't a useful tool for this. Use graph, and PRINT (not GPRINT) to get the values you want (eg data source and max value). You can then use these in a script to dynamically generate a graph which only displays the data sources of interest.
Alceu R. de Freitas Jr.
2014-10-13 17:28:41 UTC
Permalink
Hello Simon,
Not sure if I made myself clear.
I'm first using fetch to loop over the same data interval I would do for graph. Inside this loop, I will get the names of data sources that actually have the values I'm interested to see.
Out of the loop, I have all the data source names. I can then supply those names with the other parameter to generate the chart.
I can post part of the code if it makes easier to understand.
Post by Alceu R. de Freitas Jr.
In most of cases, only part of those datasources will have interesting results (~8% of datasources will have values near zero). I would like to filter only the datasources that have a value greater than a threshold.
Fetch isn't a useful tool for this. Use graph, and PRINT (not GPRINT) to get the values you want (eg data source and max value). You can then use these in a script to dynamically generate a graph which only displays the data sources of interest.
Loading...