Fixed the nedi issue of not showing the rrd graph of subinterface

After installed nedi 1.0.w, I got the following error msg when viewed the graph for subinterface from web gui.

 RRD /usr/local/nedi/rrd/dv1/eth5.401.rrd not found!

/usr/local/rrdtool/bin/rrdtool graph  - -a PNG --title="Traffic in Byte/s on Tue, 15 May 2007 08:53:16 -0400 for the last 7 days" -w800 -h200 -s -7d -L6
    DEF:inoct0=/usr/local/nedi/rrd/dv1/eth5.401.rrd:inoct:AVERAGE AREA:inoct0#0000aa:"eth5.401  in\l"
    DEF:outoct1=/usr/local/nedi/rrd/dv1/eth5.401.rrd:outoct:AVERAGE LINE2:outoct1#008800:"eth5.401 out"

While at the same time the graph just show up fine for the normal interfaces.

Got into the /usr/local/nedi/rrd/dv1/ directory and found the file name was actually eth5%2E401.rrd instead of eth5.401.rrd. %2E is actually the ascii value of "." so must some inconsistency between the data acquisition module and presentation module.

And here is the patch for inc/libmisc.pl under nedi directory to fix this issue.

--- libmisc.pl.old      2007-05-16 15:45:29.000000000 -0400
+++ libmisc.pl  2007-05-16 16:44:23.000000000 -0400
@@ -792,7 +792,7 @@
        my $dv          = $_[0];
        my $ok          = 0;

-       $dv =~ s/([^a-zA-Z0-9_-])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
+       $dv =~ s/([^a-zA-Z0-9_.-])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
        if (-e "$rrdpath/$dv"){
                $ok = 1;
        }else{
@@ -831,7 +831,7 @@
                foreach my $i ( keys(%{$main::int{$_[0]}}) ){
                        if(exists $main::int{$_[0]}{$i}{ina}){                                                  # Avoid errors due empty ifnames
                                $irf =  $main::int{$_[0]}{$i}{ina};
-                               $irf =~ s/([^a-zA-Z0-9_-])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
+                               $irf =~ s/([^a-zA-Z0-9_.-])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
                                if (-e "$rrdpath/$dv/$irf.rrd"){
                                        $ok = 1;
                                }else{

Now enjoy...

Free PDF books

Tehnology books, updates every day : http://bookgrill.com/?getej.html Get free books

Posted this blog into nedi forum.

It took a while for me to get my id approved in the nedi forum and I posted it there almost right away. It's now at http://z11.invisionfree.com/Nedi/index.php?showtopic=623

Post new comment

  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post PHP code. You should include <?php ?> tags.

More information about formatting options