This configuration is useful for polling performance metrics from servers using collectd snmp plugin and writing statistics data to graphite whisper database and visualize them.
collectd.conf file as follows:
LoadPlugin snmp
LoadPlugin write_graphite
<Plugin snmp>
<Data "linux_load">
Type "load"
Table false
Values "UCD-SNMP-MIB::laLoadInt.1" "UCD-SNMP-MIB::laLoadInt.2" "UCD-SNMP-MIB::laLoadInt.3"
Scale 0.01
</Data>
<Data "linux_cpu_user_raw">
Type "cpu"
Table false
Instance "user_raw"
Values "UCD-SNMP-MIB::ssCpuRawUser.0"
</Data>
<Data "linux_cpu_system_raw">
Type "cpu"
Table false
Instance "system_raw"
Values "UCD-SNMP-MIB::ssCpuRawSystem.0"
</Data>
<Data "linux_cpu_idle_raw">
Type "cpu"
Table false
Instance "idle_raw"
Values "UCD-SNMP-MIB::ssCpuRawIdle.0"
</Data>
<Data "linux_cpu_wait_raw">
Type "cpu"
Table false
Instance "wait_raw"
Values "UCD-SNMP-MIB::ssCpuRawWait.0"
</Data>
<Data "linux_cpu_nice_raw">
Type "cpu"
Table false
Instance "nice_raw"
Values "UCD-SNMP-MIB::ssCpuRawNice.0"
</Data>
<Data "linux_cpu_kernel_raw">
Type "cpu"
Table false
Instance "kernel_raw"
Values "UCD-SNMP-MIB::ssCpuRawKernel.0"
</Data>
<Data "linux_mem_total">
Type "memory"
Table false
Instance "total_real"
Values "UCD-SNMP-MIB::memTotalReal.0"
</Data>
<Data "linux_mem_avail">
Type "memory"
Table false
Instance "avail_real"
Values "UCD-SNMP-MIB::memAvailReal.0"
</Data>
<Host "server1">
Address "xxx.xxx.xxx.xxx"
Version 2
Community "xxxxxx"
Collect "linux_cpu_user_raw" "linux_cpu_idle_raw" "linux_cpu_system_raw" "linux_cpu_wait_raw" "linux_cpu_nice_raw" "linux_cpu_kernel_raw" "linux_mem_total" "linux_mem_avail"
</Host>
<Host "server2">
Address "xxx.xxx.xxx.xxx"
Version 2
Community "xxxxxx"
Collect "linux_cpu_user_raw" "linux_cpu_idle_raw" "linux_cpu_system_raw" "linux_cpu_wait_raw" "linux_cpu_nice_raw" "linux_cpu_kernel_raw" "linux_mem_total" "linux_mem_avail"
</Host>
</Plugin>
<Plugin write_graphite>
<Node "graphing">
Host "xxx.xxx.xxx.xxx"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "snmp."
Postfix ""
StoreRates true
AlwaysAppendDS false
EscapeCharacter "_"
</Node>
</Plugin>
collectd.conf file as follows:
LoadPlugin snmp
LoadPlugin write_graphite
<Plugin snmp>
<Data "linux_load">
Type "load"
Table false
Values "UCD-SNMP-MIB::laLoadInt.1" "UCD-SNMP-MIB::laLoadInt.2" "UCD-SNMP-MIB::laLoadInt.3"
Scale 0.01
</Data>
<Data "linux_cpu_user_raw">
Type "cpu"
Table false
Instance "user_raw"
Values "UCD-SNMP-MIB::ssCpuRawUser.0"
</Data>
<Data "linux_cpu_system_raw">
Type "cpu"
Table false
Instance "system_raw"
Values "UCD-SNMP-MIB::ssCpuRawSystem.0"
</Data>
<Data "linux_cpu_idle_raw">
Type "cpu"
Table false
Instance "idle_raw"
Values "UCD-SNMP-MIB::ssCpuRawIdle.0"
</Data>
<Data "linux_cpu_wait_raw">
Type "cpu"
Table false
Instance "wait_raw"
Values "UCD-SNMP-MIB::ssCpuRawWait.0"
</Data>
<Data "linux_cpu_nice_raw">
Type "cpu"
Table false
Instance "nice_raw"
Values "UCD-SNMP-MIB::ssCpuRawNice.0"
</Data>
<Data "linux_cpu_kernel_raw">
Type "cpu"
Table false
Instance "kernel_raw"
Values "UCD-SNMP-MIB::ssCpuRawKernel.0"
</Data>
<Data "linux_mem_total">
Type "memory"
Table false
Instance "total_real"
Values "UCD-SNMP-MIB::memTotalReal.0"
</Data>
<Data "linux_mem_avail">
Type "memory"
Table false
Instance "avail_real"
Values "UCD-SNMP-MIB::memAvailReal.0"
</Data>
<Host "server1">
Address "xxx.xxx.xxx.xxx"
Version 2
Community "xxxxxx"
Collect "linux_cpu_user_raw" "linux_cpu_idle_raw" "linux_cpu_system_raw" "linux_cpu_wait_raw" "linux_cpu_nice_raw" "linux_cpu_kernel_raw" "linux_mem_total" "linux_mem_avail"
</Host>
<Host "server2">
Address "xxx.xxx.xxx.xxx"
Version 2
Community "xxxxxx"
Collect "linux_cpu_user_raw" "linux_cpu_idle_raw" "linux_cpu_system_raw" "linux_cpu_wait_raw" "linux_cpu_nice_raw" "linux_cpu_kernel_raw" "linux_mem_total" "linux_mem_avail"
</Host>
</Plugin>
<Plugin write_graphite>
<Node "graphing">
Host "xxx.xxx.xxx.xxx"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "snmp."
Postfix ""
StoreRates true
AlwaysAppendDS false
EscapeCharacter "_"
</Node>
</Plugin>
Comments
Post a Comment