The Ganglia gmetric utility provides an easy way to integrate
additional metrics without having to program anything. As I have
received some requests for device specific information for Ganglia
(e.g., how much data is going in and out over that specific ethernet
adapter), I have written the following utility programs for that
purpose:
- Network adapter information:
- g_aix_netif for AIX
- g_linux_netif for Linux on POWER
- ent_adapter.sh for AIX
- This is a Korn Shell program for AIX which uses the 'entstat'
command to obtain the Ethernet adapter statistics. The libperfstat
API seems to not to report any statistics about Ethernet adapters
if there are no interfaces defined on that adapter.
- It can also serve as an example how to add gmetric statistics
via shell scripts on AIX but please keep in mind that my shell script
writing capabilities are rather limited.
- Disk information:
- g_aix_disk for AIX
- g_linux_disk for Linux on POWER
- Disk adapter information:
- g_aix_adapter for AIX
- fcs_adapter.sh for AIX
- This is a Korn Shell program for AIX which uses the 'fcstat'
command to obtain the Fibre Channel adapter statistics. The libperfstat
API seems to not to report any statistics about Fibre Channel adapters
if there are no disks attached to the adapter.
- It can also serve as an example how to add gmetric statistics
via shell scripts on AIX but please keep in mind that my shell script
writing capabilities are rather limited.
Notes:
- All programs expect gmetric will be found in $PATH and gmond
is already running. They will disconnect from your terminal to become a
daemon.
- All programs expect a couple of command line parameters and also
support a debug mode (option "-d") to see what device information is
obtained and what gmetric call would be made.
Source
code and binaries to download:
- AIX v4.3.3
(compiled on AIX 4.3.3 ML 11):
- g_aix_netif (md5sum: 87095007d65ed8ecfb6f7265d26afef7)
- g_aix_disk (md5sum: 1bb66e45ef589a995312d8cb3e1f5c0d)
- g_aix_adapter can't be compiled on AIX
v4.3.3 as the libperfstat library does not contain the necessary data.
- AIX 5L v5.1
and v5.2 (compiled on AIX 5.1 ML 04):
- g_aix_netif (md5sum: 7bc515b77dfdcf5f959b19b4ee824fbb)
- g_aix_disk (md5sum: 6a686cf83b7c44a58c1a4770933d265d)
- g_aix_adapter can't be compiled on AIX
v5.1 as the libperfstat library does not contain the necessary data.
- AIX 5L v5.3 (compiled on AIX 5.3
ML 00) and higher:
- SUSE Linux (tested on SLES 9,
SLES 10, openSUSE 10.0, openSUSE 10.1, openSUSE 10.2):
- Red Hat Linux (tested on RHEL 4,
RHEL5, Fedora Core 4, Fedora Core 5, Fedora Core 6):
Examples:
- g_aix_netif -s5 -b3 -p3 -m
en1
Every 5 seconds get the number of bytes/sec and packets/sec
transferred in and out as well as the current MTU size for network
interface en1.
- g_aix_disk -s10 -i -o hdisk3
Every 10 seconds get the number of bytes/sec transferred in and out for
disk hdisk3.
- g_aix_adapter -s5 -i -o
scsi0
Every 5 seconds get the number of bytes/sec transferred in and out for
SCSI adapter scsi0.
- If you run any of the utility programs without any options they
output all the possible command line options, e.g., when calling "$ ./g_aix_netif"
./g_aix_netif: Version 1.0
g_aix_netif [OPTIONS]
<network-interface>
[-?] or
[-h] This help information
[-s
seconds] The time between
output (default is 60 seconds),
seconds must be in the range [1..3600].
[-c
loop_count] The number of loops (default = 20
million),
loop_count must be in the range [10..20000000].
[-b
0|1|2|3] Show bytes
received/sent (default = off)
0 = don't show, 1 = show incoming
2 = show outgoing, 3 = show both
[-p
0|1|2|3] Show packets
received/sent (default = off)
0 = don't show, 1 = show incoming
2 = show outgoing, 3 = show both
[-m]
Show MTU size for <network-interface> (default = off)
[-d]
Debug mode, remain in foreground, output only to screen
Please note:
If not in debug mode (-d)
g_aix_netif runs the same command via a shell
and assumes gmetric will be
found in the PATH and gmond is already running.
g_aix_netif will disconnect
from your terminal to become a daemon.
Use "ps -ef | grep
g_aix_netif" to confirm it is running.