[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] Sending Data from external script to an RRD - can't see graphs - only links



One thing I see that I made the same mistake at is in your hobbitgraph.cfg:

[if_load]
        FNPATTERN if_load(.*).rrd
        TITLE Network Traffic
        YAXIS Bits/second
        DEF:in (at) RRDIDX (at) = (at) RRDFN@:in:AVERAGE
        CDEF:inbytes (at) RRDIDX (at) =in (at) RRDIDX@,8,*
        DEF:out (at) RRDIDX (at) = (at) RRDFN@:out:AVERAGE
        CDEF:outbytes (at) RRDIDX (at) =out (at) RRDIDX@,8,*
        LINE1:inbytes (at) RRDIDX (at) # (at) COLOR@:@RRDPARAM@ In
        GPRINT:inbytes (at) RRDIDX@:LAST: %8.2lf %s (cur)
        GPRINT:inbytes (at) RRDIDX@:MAX: %8.2lf %s (max)
        GPRINT:inbytes (at) RRDIDX@:MIN: %8.2lf %s (min)
        GPRINT:inbytes (at) RRDIDX@:AVERAGE: %8.2lf %s (avg)\n
        LINE1:outbytes (at) RRDIDX (at) # (at) COLOR@:@RRDPARAM@ Out
        GPRINT:outbytes (at) RRDIDX@:LAST: %8.2lf %s (cur)
        GPRINT:outbytes (at) RRDIDX@:MAX: %8.2lf %s (max)
        GPRINT:outbytes (at) RRDIDX@:MIN: %8.2lf %s (avg)
        GPRINT:outbytes (at) RRDIDX@:AVERAGE: %8.2lf %s (avg)\n

you need to replace "(at)" with "@", It looks like when the post was made it converted all the @ to (at). But that was my big problem. And I am not using the NCV function and don't think it is to be done using that but could be wrong. And my extra-rrd.pl looks like this:

#!/usr/bin/perl

# Input parameters: Hostname, testname (column), and messagefile
$HOSTNAME=$ARGV[0]; ;
$TESTNAME=$ARGV[1]; ;
$FNAME=$ARGV[2]; ;

# Read the entire files
open (FILEHANDLE,$FNAME) || die ("cant read file\n");
@input = <FILEHANDLE>;
close (FILEHANDLE);

if ( $TESTNAME eq "if_load" ) {

        # Analyze the message we got
        foreach $line (@input) {
                if ($line =~ /(^[A-Z].*) (\d+):(\d+)$/ ) {

                        # The RRD dataset definitions
                        print "DS:in:DERIVE:600:0:U\n";
                        print "DS:out:DERIVE:600:0:U\n";

                        # The filename
                        print "if_load_$1.rrd\n";

                        # The data
                        print "$2:$3\n";
                }
        }
}


Hope this helps you out and if you need anymore I will be glad to give ya what I know or have found out.

Josh

On Sep 24, 2007, at 2:13 AM, Javier Temponi wrote:

Hello, I want to graph the load information of my routers interfaces, I have been reading for several days the list, and I have learned a lot but not enough yet to make this works J…

This is the situation: I receive the information from devmon, and execute an external script to write the rrd file. The files are written but I can not see them from the hobbit page. I have the rrd files generated and updated but in the hobbit page I only can see the links and no graph (not an empty or blank graph, only the little box with the name of the link inside).

I’m using devmon 0.3.0-beta2 and hobbit 4.2 with the patch all in one installed.
OS: Linux kernel 2.6.9

Other graphs work fine, the default ones, for example the Conn graph.
The information from devmon is received ok by hobbit, because I have a table with the load of the interfaces that devmon sent.

These are the configuration files:

hobbitserver.cfg (to see the graphs in the load and trends columns):

TEST2RRD="…..,if_load=ncv"
NCV_if_load="in:GAUGE,out:GAUGE"

GRAPHS="……,if_load”

hobbitlaunch.cfg

[rrdstatus]
        ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
CMD hobbitd_channel --channel=status --log=$BBSERVERLOGS/rrd- status.log hobbitd_rrd --rrddir=$BBVAR/rrd --extra-script=$BBHOME/ ext/extra-rrd.pl --debug --extra-tests=if_load

This is the script  ext/extra-rrd.pl

#!/usr/bin/perl

# Input parameters: Hostname, testname (column), and messagefile
#$HOSTNAME=$ARGV[0]; ;
$TESTNAME=$ARGV[1]; ;
$FNAME=$ARGV[2]; ;
$filename="/tmp/if_log";

# Read the entire files
open (FILEHANDLE,$FNAME) || die (print "cant read file\n");
@input = <FILEHANDLE>;
close (FILEHANDLE);

if ( $TESTNAME eq "if_load" ) {

        # Analyze the message we got
        foreach $line (@input) {
                if ($line =~ /(^[A-Z].*) (\d+):(\d+)$/ ) {

                        # The RRD dataset definitions
                        print "DS:in:DERIVE:600:0:U\n";
                        print "DS:out:DERIVE:600:0:U\n";

                        # The filename
                        print "if_load_$1.rrd\n";

                        # The data
                        print "$2:$3\n";
                }
        }
}


hobbitgraph.cfg file :

[if_load]
        FNPATTERN if_load(.*).rrd
        TITLE Network Traffic
        YAXIS Bits/second
        DEF:in (at) RRDIDX (at) = (at) RRDFN@:in:AVERAGE
        CDEF:inbytes (at) RRDIDX (at) =in (at) RRDIDX@,8,*
        DEF:out (at) RRDIDX (at) = (at) RRDFN@:out:AVERAGE
        CDEF:outbytes (at) RRDIDX (at) =out (at) RRDIDX@,8,*
        LINE1:inbytes (at) RRDIDX (at) # (at) COLOR@:@RRDPARAM@ In
        GPRINT:inbytes (at) RRDIDX@:LAST: %8.2lf %s (cur)
        GPRINT:inbytes (at) RRDIDX@:MAX: %8.2lf %s (max)
        GPRINT:inbytes (at) RRDIDX@:MIN: %8.2lf %s (min)
        GPRINT:inbytes (at) RRDIDX@:AVERAGE: %8.2lf %s (avg)\n
        LINE1:outbytes (at) RRDIDX (at) # (at) COLOR@:@RRDPARAM@ Out
        GPRINT:outbytes (at) RRDIDX@:LAST: %8.2lf %s (cur)
        GPRINT:outbytes (at) RRDIDX@:MAX: %8.2lf %s (max)
        GPRINT:outbytes (at) RRDIDX@:MIN: %8.2lf %s (avg)
        GPRINT:outbytes (at) RRDIDX@:AVERAGE: %8.2lf %s (avg)\n


If anyone has any idea, where the problem could be or any work around I’ll really appreciate.

Thanks in advance
Javier