解决ganglia客户端加载模块失败的小错误


环境debain 6.0
安装客户端ganglia
root@mdb:/etc/ganglia# apt-cache search ganglia
collectd-core - statistics collection and monitoring daemon (core system)
ganglia-monitor - cluster monitoring toolkit - node daemon
ganglia-webfrontend - cluster monitoring toolkit - web front-end
gmetad - cluster monitoring toolkit - Ganglia Meta-Daemon
libganglia1-dev - cluster monitoring toolkit - development libraries
libganglia1 - cluster monitoring toolkit - shared libraries

作为客户端,只需要
root@mdb:/etc/ganglia# apt-get install ganglia-monitor
安装完成
查看gmond加载模块
root@mdb:/usr/lib64/ganglia# gmond -m
Cannot load modcpu.so metric module: modcpu.so: cannot open shared object file: No such file or directory
Cannot load moddisk.so metric module: moddisk.so: cannot open shared object file: No such file or directory
Cannot load modload.so metric module: modload.so: cannot open shared object file: No such file or directory
Cannot load modmem.so metric module: modmem.so: cannot open shared object file: No such file or directory
Cannot load modnet.so metric module: modnet.so: cannot open shared object file: No such file or directory
Cannot load modproc.so metric module: modproc.so: cannot open shared object file: No such file or directory
Cannot load modsys.so metric module: modsys.so: cannot open shared object file: No such file or directory
heartbeat       Last heartbeat (module core_metrics)
location        Location of the machine (module core_metrics)
gexec           gexec available (module core_metrics)

查看
root@mdb:/etc/ganglia# ls /usr/lib64/ganglia/
modcpu.so  moddisk.so  modload.so  modmem.so  modmulticpu.so  modnet.so  modproc.so  modpython.so  modsys.so

解决办法很简单
只需要将默认的加载模块路径更改为绝对路径即可
vi /etc/ganglia/gmond.conf
。。
。。
。。
modules {
  module {
    name = "core_metrics"
  }
  module {
    name = "cpu_module"
    path = "/usr/lib64/ganglia/modcpu.so"
  }
  module {
    name = "disk_module"
    path = "/usr/lib64/ganglia/moddisk.so"
  }
  module {
    name = "load_module"
    path = "/usr/lib64/ganglia/modload.so"
  }
  module {
    name = "mem_module"
    path = "/usr/lib64/ganglia/modmem.so"
  }
  module {
    name = "net_module"
    path = "/usr/lib64/ganglia/modnet.so"
  }
  module {
    name = "proc_module"
    path = "/usr/lib64/ganglia/modproc.so"
  }
  module {
    name = "sys_module"
    path = "/usr/lib64/ganglia/modsys.so"
  }
}

root@mdb:/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)

搞定收工

你可能感兴趣的:(ganglia,metric)