Ganglia
gmetad : ganglia metadata deamon
gmond : ganglia monitor deamon
sudo apt-get install ganglia-monitor
sudo apt-get install ganglia-webfrontend
-- server
sudo vim /etc/ganglia/gmetad.conf -- 修改收集器
sudo vim /etc/ganglia/gmond.conf -- 修改监视器
sudo ln -s /usr/share/ganglia-webfrontend/ /var/www/ganglia -- 将web工程弄到apache2下面去
service gmetad restart
service ganglia-monitor restart
service apache2 restart
-------------------------------------------------------------------------------------------------------------------------------------
下面做深入分析
gmond 和 gmeta 工具,
zhou@zhou:/etc/ganglia$ gmond -h
gmond 3.1.7
Purpose:
The Ganglia Monitoring Daemon (gmond) listens to the cluster
message channel, stores the data in-memory and when requested
will output an XML description of the state of the cluster
Usage: gmond [OPTIONS]...
-h, --help Print help and exit
-V, --version Print version and exit
-c, --conf=STRING Location of gmond configuration file
(default='/etc/ganglia/gmond.conf')
-l, --location=STRING Location of this host in the cluster
'rack,rank,plane'. (default='0,0,0')
-d, --debug=INT Debug level. If greater than zero, daemon will stay in
foreground. (default='0')
-f, --foreground Run in foreground (don't daemonize) (default=off)
-t, --default_config Print the default configuration to stdout and exit
(default=off)
-m, --metrics Print the list of metrics this gmond supports
(default=off)
-b, --bandwidth Calculate minimum bandwidth use for configuration
(default=off)
-r, --convert=STRING Convert a 2.5.x configuration file to the new 3.x
format
-p, --pid-file=STRING Write process-id to file
zhou@zhou:/etc/ganglia$ gmetad -h
gmetad 3.1.7
Purpose:
The Ganglia Meta Daemon (gmetad) collects information from
multiple gmond or gmetad data sources, saves the information to local
round-robin databases, and exports XML which is the concatentation of
all data sources
Usage: gmetad [OPTIONS]...
-h, --help Print help and exit
-V, --version Print version and exit
-c, --conf=STRING Location of gmetad configuration file
(default='/etc/ganglia/gmetad.conf')
-d, --debug=INT Debug level. If greater than zero, daemon will stay in
foreground. (default='0')
-p, --pid-file=STRING Write process-id to file
其中, gmond -m 列出了所有metrics
zhou@zhou:/etc/ganglia$ gmond -m
load_one One minute load average (module load_module)
os_release Operating system release date (module sys_module)
mem_total Total amount of memory displayed in KBs (module mem_module)
cpu_intr cpu_intr (module cpu_module)
proc_run Total number of running processes (module proc_module)
load_five Five minute load average (module load_module)
disk_free Total free disk space (module disk_module)
gexec gexec available (module core_metrics)
mem_cached Amount of cached memory (module mem_module)
mtu Network maximum transmission unit (module sys_module)
cpu_sintr cpu_sintr (module cpu_module)
pkts_in Packets in per second (module net_module)
location Location of the machine (module core_metrics)
bytes_in Number of bytes in per second (module net_module)
swap_total Total amount of swap space displayed in KBs (module mem_module)
bytes_out Number of bytes out per second (module net_module)
load_fifteen Fifteen minute load average (module load_module)
mem_free Amount of available memory (module mem_module)
os_name Operating system name (module sys_module)
boottime The last time that the system was started (module sys_module)
cpu_idle Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request (module cpu_module)
cpu_aidle Percent of time since boot idle CPU (module cpu_module)
cpu_nice Percentage of CPU utilization that occurred while executing at the user level with nice priority (module cpu_module)
cpu_user Percentage of CPU utilization that occurred while executing at the user level (module cpu_module)
sys_clock Time as reported by the system clock (module sys_module)
mem_buffers Amount of buffered memory (module mem_module)
cpu_system Percentage of CPU utilization that occurred while executing at the system level (module cpu_module)
part_max_used Maximum percent used for all partitions (module disk_module)
disk_total Total available disk space (module disk_module)
heartbeat Last heartbeat (module core_metrics)
mem_shared Amount of shared memory (module mem_module)
machine_type System architecture (module sys_module)
cpu_wio Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request (module cpu_module)
cpu_num Total number of CPUs (module cpu_module)
proc_total Total number of processes (module proc_module)
cpu_speed CPU Speed in terms of MHz (module cpu_module)
pkts_out Packets out per second (module net_module)
swap_free Amount of available swap memory (module mem_module)
基本上对应 gmond.conf里面的配置, 这里指定了各个module的so对应的位置
/* Each metrics module that is referenced by gmond must be specified and
loaded. If the module has been statically linked with gmond, it does not
require a load path. However all dynamically loadable modules must include
a load path. */
modules {
module {
name = "core_metrics"
}
module {
name = "cpu_module"
path = "/usr/lib/ganglia/modcpu.so"
}
module {
name = "disk_module"
path = "/usr/lib/ganglia/moddisk.so"
}
module {
name = "load_module"
path = "/usr/lib/ganglia/modload.so"
}
module {
name = "mem_module"
path = "/usr/lib/ganglia/modmem.so"
}
module {
name = "net_module"
path = "/usr/lib/ganglia/modnet.so"
}
module {
name = "proc_module"
path = "/usr/lib/ganglia/modproc.so"
}
module {
name = "sys_module"
path = "/usr/lib/ganglia/modsys.so"
}
}