Ganglia Gmetric repository
Quick Links
This is my collection of metric collection tools to be used with Ganglia. Ganglia
is a scalable distributed monitoring system for
high-performance computing systems such as clusters and Grids. It is
based on a hierarchical design targeted at federations of clusters.
This is not to say that same scripts cannot be used with other
monitoring tools you just need to modify the script to do so.
1. NFS server/client stats
Purpose: This script will collect NFSd server and/or NFS client stats on the host running the service.
OS: Linux only

Please download the script ganglia_nfs_stats.pl and install it on a machine running NFSd. Then do following
- Check that $gmetric_command variable points to the gmetric binary
- Currently following NFS calls are being collected - getattr,
setattr, lookup,
access, read, write, create, remove. If you need
additional calls collected adjust the @which_metrics array.
- Put it in a cron and run it however often you want.
- If you don't supply an argument will send NFSd (server) statistics
- To collect NFS client statistics supply -c flag
- If you want both run two different invocations
- IMPORTANT: This script collects only NFSv3 statistics.
2. Local Disk Stats
Purpose: This script will collect local disk stats on the host running the service.
OS: Linux only

Please download the script ganglia_disk_stats.pl and install it. Then do following
- Check that $gmetric_command variable points to gmetric binary
- Currently following metrics are collected - read, write, io wait queue. If you need
additional metrics collected adjust the @which_metrics array.
- Put it in a cron and run it however often you want.
- IMPORTANT: You need to supply disk you want stats as the argument e.g.
- ./ganglia_disk_stats.pl sda
- if you type cat /proc/diskstats you can see list of all devices
3. mySQL server stats
Purpose: This script will collect mySQL server stats as reported by extended-status
OS: Cross platform - any platform that has perl support including Windows (cygwin recommended for Windows)
mysqladmin will report extended-status statistics such as these. Explanation of all metrics can be found at
http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html
| Threads_cached | 0 |
| Threads_connected | 5 |
| Threads_created | 14706 |
| Threads_running | 1 |
Unfortunately that doesn't tell us much unless we can graph it.
After you run the script you get these pretty graphs :-)

Please download the script ganglia_mysql_stats.pl and install it. Then do following
- Check that $gmetric_exec and $gmetric_options variable match your environment
- Also check the stats command and make sure you can actually execute mysqladmin with the credentials you specified.
- Currently following metrics are collected "Bytes_received", "Bytes_sent", "Com_delete",
"Com_insert", "Com_replace" ,"
Com_select", "Com_update", "Questions", "Connections"
=> "connections", "Slow_queries", "Threads_created", "Threads_running" . If you need
additional metrics collected adjust the %counter_metrics or %absolute_metrics array/hash.
- Difference between counter and absolute metrics is that for
certain things mySQL keeps a running counter of things ie. how many
bytes have been transferred since the stats were last cleared. In that
case we need to calculate the delta/difference. Absolute metrics are
non-counter values ie. number of threads_running right now.
- Put it in a cron and run it however often you want.
Author: Vladimir Vuksan
Page Last Change: $Date$
Go back