On Thu, May 04, 2006 at 01:00:33PM +0800, [EMAIL PROTECTED] wrote:
> 
> G'day all
> 
> Newbie type question but I can't seem to find a readily available answer.
> 
> I'd like byte counts in and out from my nodes... but on other interfaces (eg.
> eth2 is used for gmond but I'm interested in eth0 and eth1).
> 
> gmond.conf doesn't seem to offer such an option. Do I need to modify the 
> source
> or do I run gmeter with an ifconfig+grep special?

I wrote a script to report individual interface values, and then edited
the ganglia PHP to display a network report (along with load, CPU,
memory, etc.) that showed each interface in a different color.

The script is at http://cryptio.net/~ben/ganglia/network_gmetric.sh 

I think I only modified conf.php and graph.php.

I added the following lines to conf.php

-=-=-=-=-=-=-=-=-=----8<----=-=--=-=-=-=-=-=----8<-----=-=-=-=-=--
#
# Colors for the split network report graph
#
$total_rx_color = "FF0000";
$total_tx_color = "0000FF";
$eth0_rx_color = "333333";
$eth0_tx_color  = "00FF00";
$eth1_rx_color = "FF00FF";
$eth1_tx_color  = "00FFFF";

-=-=-=-=-=-=-=-=-=----8<----=-=--=-=-=-=-=-=----8<-----=-=-=-=-=--

I made the following changes to graph.php

-=-=-=-=-=-=-=-=-=----8<----=-=--=-=-=-=-=-=----8<-----=-=-=-=-=--

[EMAIL PROTECTED]:/var/www/html/ganglia$ diff -c graph.php.orig graph.php
*** graph.php.orig      2005-05-09 11:27:45.000000000 -0700
--- graph.php   2005-09-27 16:20:26.000000000 -0700
***************
*** 18,25 ****
  # Assumes we have a $start variable (set in get_context.php).
  if ($size == "small")
      {
!       $height = 40;
!       $width = 130;
      }
  else if ($size == "medium")
      {
--- 18,25 ----
  # Assumes we have a $start variable (set in get_context.php).
  if ($size == "small")
      {
!       $height = 60;
!       $width = 200;
      }
  else if ($size == "medium")
      {
***************
*** 176,181 ****
--- 176,215 ----
                 ."LINE2:'bytes_in'#$mem_cached_color:'In' "
                 ."LINE2:'bytes_out'#$mem_used_color:'Out' ";
           }
+       else if ($graph == "split_network_report")
+          {
+             $style = "Split Network";
+
+             $lower_limit = "--lower-limit 0 --rigid";
+             $extras = "--base 1024";
+             $vertical_label = "--vertical-label 'Bytes/sec'";
+
+             $series = 
"DEF:'total_tx'='${rrd_dir}/network_tx.rrd':'sum':AVERAGE "
+                ."DEF:'total_rx'='${rrd_dir}/network_rx.rrd':'sum':AVERAGE "
+                ."DEF:'eth0_rx'='${rrd_dir}/eth0_rx.rrd':'sum':AVERAGE "
+                ."DEF:'eth0_tx'='${rrd_dir}/eth0_tx.rrd':'sum':AVERAGE "
+                ."DEF:'eth1_rx'='${rrd_dir}/eth1_rx.rrd':'sum':AVERAGE "
+                ."DEF:'eth1_tx'='${rrd_dir}/eth1_tx.rrd':'sum':AVERAGE "
+                ."LINE3:'total_tx'#$total_tx_color:'Total TX' "
+                ."LINE3:'total_rx'#$total_rx_color:'Total RX' "
+                ."LINE2:'eth0_tx'#$eth0_tx_color:'Eth0 TX' "
+                ."LINE2:'eth0_rx'#$eth0_rx_color:'Eth0 RX' "
+                ."LINE2:'eth1_tx'#$eth1_tx_color:'Eth1 TX' "
+                ."LINE2:'eth1_rx'#$eth1_rx_color:'Eth1 RX' ";
+          }
+       else if ($graph == "disk_report")
+          {
+             $style = "Disk";
+
+             $lower_limit = "--lower-limit 0 --rigid";
+             $extras = "--base 1024";
+             $vertical_label = "--vertical-label 'Blocks/sec'";
+
+             $series = 
"DEF:'disk_writes'='${rrd_dir}/disk_writes.rrd':'sum':AVERAGE "
+                ."DEF:'disk_reads'='${rrd_dir}/disk_reads.rrd':'sum':AVERAGE "
+                ."LINE2:'disk_writes'#$mem_cached_color:'Write' "
+                ."LINE2:'disk_reads'#$mem_used_color:'Read' ";
+          }
        else if ($graph == "packet_report")
           {
              $style = "Packets";

-=-=-=-=-=-=-=-=-=----8<----=-=--=-=-=-=-=-=----8<-----=-=-=-=-=--

-ben


-- 
Ben Hartshorne
email: [EMAIL PROTECTED]
http://ben.hartshorne.net

Attachment: signature.asc
Description: Digital signature

Reply via email to