[Patch] Show all queues in RRD graph



  • It was bugging me a lot that I couldn't see all the queues in the RRD graphs, so I spent the past hour coming up with this.

    For your queue to appear in the graphs,  your queue name has to end with "up", "down", "in" or "out" (case insensitive).

    Yes I know these aren't diff files, unfortunately I do not know how to make those, so I'm doing my best.
    I modified the files in pfSense 1.2-RELEASE

    /etc/inc/pfsense-utils.inc

    
    -Line 3101: $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/)) { ";
    +Line 3101: $rrdupdatesh .= "if ((\$1 == \"queue\") && (( \$2 ~ /^q/) || ( tolower(\$2) ~ /in\$/ ) || ( tolower(\$2) ~ /out\$/ ) || ( tolower(\$2) ~ /up\$/ ) || ( tolower(\$2) ~ /down\$/ ))) { ";
    -Line 3117: $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/)) { ";
    +Line 3117: $rrdupdatesh .= "if ((\$1 == \"queue\") && (( \$2 ~ /^q/) || ( tolower(\$2) ~ /in\$/ ) || ( tolower(\$2) ~ /out\$/ ) || ( tolower(\$2) ~ /up\$/ ) || ( tolower(\$2) ~ /down\$/ ))) { ";
    
    

    /usr/local/www/status_rrd_graph_img.php

    
    -Line 457: if((stristr($name, "$upif")) || (stristr($name, "up"))) {
    +Line 457: if((stristr($name, "$upif")) || (stristr($name, "up")) || (stristr($name,"out"))) {
    -Line 473: if((stristr($name, "$downif")) || (stristr($name, "down"))) {
    +Line 473: if((stristr($name, "$downif")) || (stristr($name, "down")) || (stristr($name,"in"))) {
    
    

    After modifying those two files,
    In Diagnostics->Command run:
    PHP Execute: enable_rrd_graphing();

    This is all you should have to do because it looks like the rrd files are created with all the queues, but only the wizard queues are updated and displayed.

    If your other queues still do not appear, run
    Execute Shell Command: rm /var/db/rrd/queue.rrd
    Warning This will delete all your past RRD data for the queues that do show up now.
    and then
    PHP Execute: enable_rrd_graphing();


Locked