BB Unix Network Monitor - Message

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

Re: {bb} Monitoring cacti traffic graphs



John,

Nice Catch! The easy answer would be to change the CF that is being
grabbed from "AVERAGE" to "LAST". When I do a rrdtool info on the RRD,
there is no "LAST" CF. If you click on the wrench next to the graph in
Cacti, it will show you an output of the command used to create the
graph, hence, where/how they obtained the current value. When I do a
dump I get:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="SERVERNAME - Traffic - IP  (Intel(R) Advanc)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="/var/www/html/cacti-0.8.6e/rra/servername_traffic_in_1172.rrd":traffic_in:AVERAGE
\
DEF:b="/var/www/html/cacti-0.8.6e/rra/servername_traffic_in_1172.rrd":traffic_out:AVERAGE
\
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00:"Inbound"  \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#002A97:"Outbound"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s"

Maybe it's just early in the morning, but I'm having some trouble
seeing how they get the Current value from the Average.

Thoughts?

-Dan


>>> "John Boyd" <jboyd@hi5.com> 11/02/05 6:25 PM >>>
Hi Dan,

I think that the following subroutine is the one that I'm interested  
in but I'm confused as to how to get the  "Current:   220.12"  that  
you see in this attached image.    The "rrdtool fetch" command seems  
to output some numbers that represent the AVERAGE in a format that  
looks nothing like what appears on the screen.  I've attached an  
image to this email to illustrate what I'm seeing on the graph:
*.


sub getColor
{
         my ($rrd, $yellowThresh, $redThresh) = @_;
    my ($per, $color);

         my $lastUpdate = `$rrdtool last $rrd`;
         chomp($lastUpdate);

         my $cmd = "$rrdtool fetch -s '$lastUpdate' -e '$lastUpdate'  
$rrd AVERAGE|";
         open(RRD, $cmd) or warn "Cannot run command: $cmd\n";
         while (<RRD>)
         {
                 next unless /\d/;
       my $currentLine = $_;
                 if ($bbtest eq 'cpustat')
                 {
          return &novellCpuUtilization($currentLine, $rrd,  
$yellowThresh, $redThresh);
                 }
                 elsif ($bbtest eq 'volstat')
                 {
          return &novellVolumeUtilization($currentLine, $rrd,  
$yellowThresh, $redThresh);
                 }
         }
         close RRD;
}




John




On Nov 2, 2005, at 1:17 PM, DANIEL MAGNUSZEWSKI wrote:

> John,
>
> I have written an BB external script, dubbed "Big Cactus", that
should
> do what you're looking for. There may need to be some customization
to
> the script depending on what you are monitoring because I am only  
> really
> using it for Novell servers.
>
> Here's my thread from the Cacti list.
>
> http://forums.cacti.net/viewtopic.php?t=6309&highlight=brother 
>
> The script is also available on deadcat:
>
> http://www.deadcat.net/viewfile.php?fileid=890 
>
> I haven't had much time at all to work on the script lately, but it
> works for what I need it for. Let me know if you have any  
> questions, and
> I'll do my best to help you out.
>
>
>
> Daniel Magnuszewski
> CCNA
> M & T Bank
> dmagnuszewski { at } mandtbank.com
>
>
>>>> jboyd@hi5.com 11/02/05 3:45 PM >>>
>>>>
> Has anybody tried to monitor (with alerts) Cacti traffic graphs?
> The traffic graphs show "Current" values within a .png or .jpg
image,
>
> so parsing the html page is not possible.  Has anyone figured out
> another way?
>
> John
>
>
> --
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> To unsubscribe from this list, or to subscribe to the bb-digest list
> send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
> subscribe bb-digest in the BODY of the message.
>
>
> --
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> To unsubscribe from this list, or to subscribe to the bb-digest list
> send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
> subscribe bb-digest in the BODY of the message.
>


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index