标签:style blog io ar color os 使用 sp for
#yum install -y net-snmp net-snmp-utils
复制【附件】中snmpd.conf文件到/etc/snmp/目录下。(原有的重命名,保存)
关闭selinux和防火墙
#setenforce 0 #vi /etc/sysconfig/selinux 修改为:SELINUX=disabled #service snmpd start #chkconfig snmpd on
添加一个已存在的meter
增加一个内存meter,/etc/ceilometer/pipline.yaml
- name: hardware_memory_source interval: 60 meters: - "hardware.memory.*" resources: - snmp://172.16.1.212 sinks: - meter_sink
#systemctl restart openstack-ceilometer-central.service
#ceilometer meter-list | grep hardware #ceilometer sample-list -m hardware.memory.total
示例
+--------------+-----------------------+-------+-------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------+-----------------------+-------+-------------+------+---------------------+
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T03:41:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T03:31:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T03:21:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T03:11:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T03:01:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T02:51:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T02:41:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T02:31:10 |
| 172.16.1.212 | hardware.memory.total | gauge | 198293684.0 | B | 2014-12-05T02:21:10 |
+--------------+-----------------------+-------+-------------+------+---------------------+
分类 |
名称 |
OID |
说明 |
CPU |
_cpu_1_min_load_oid |
1.3.6.1.4.1.2021.10.1.3.1 |
1分钟CPU负载 |
_cpu_5_min_load_oid |
1.3.6.1.4.1.2021.10.1.3.2 |
5分钟CPU负载 |
|
_cpu_15_min_load_oid |
1.3.6.1.4.1.2021.10.1.3.3 |
15分钟CPU负载 |
|
Memory |
_memory_total_oid |
1.3.6.1.4.1.2021.4.5.0 |
内存总量 |
_memory_used_oid |
1.3.6.1.4.1.2021.4.6.0 |
内存已使用 |
|
_memory_total_swap_oid |
1.3.6.1.4.1.2021.4.3.0 |
|
|
_memory_avail_swap_oid |
1.3.6.1.4.1.2021.4.4.0 |
|
|
Disk |
_disk_index_oid |
1.3.6.1.4.1.2021.9.1.1 |
磁盘索引 |
_disk_path_oid |
1.3.6.1.4.1.2021.9.1.2 |
磁盘挂载位置 |
|
_disk_device_oid |
1.3.6.1.4.1.2021.9.1.3 |
磁盘挂载名称 |
|
_disk_size_oid |
1.3.6.1.4.1.2021.9.1.6 |
磁盘大小 |
|
_disk_used_oid |
1.3.6.1.4.1.2021.9.1.8 |
磁盘已使用 |
|
Network Interface |
_interface_index_oid |
1.3.6.1.2.1.2.2.1.1 |
网卡索引 |
_interface_name_oid |
1.3.6.1.2.1.2.2.1.2 |
网卡名称 |
|
_interface_speed_oid |
1.3.6.1.2.1.2.2.1.5 |
网卡速度 |
|
_interface_mac_oid |
1.3.6.1.2.1.2.2.1.6 |
网卡mac地址 |
|
_interface_ip_oid |
1.3.6.1.2.1.4.20.1.2 |
网卡ip |
|
_interface_received_oid |
1.3.6.1.2.1.2.2.1.10 |
网卡进流量 |
|
_interface_transmitted_oid |
1.3.6.1.2.1.2.2.1.16 |
网卡出流量 |
|
_interface_error_oid |
1.3.6.1.2.1.2.2.1.20 |
网卡错误包 |
|
System stats |
_system_stats_cpu_idle_oid |
1.3.6.1.4.1.2021.11.11.0 |
系统CPU空闲 |
_system_stats_io_raw_sent_oid |
1.3.6.1.4.1.2021.11.57.0 |
磁盘出IO |
|
_system_stats_io_raw_received_oid |
1.3.6.1.4.1.2021.11.58.0 |
磁盘进IO |
|
_network_ip_out_requests_oid |
1.3.6.1.2.1.4.10.0 |
网卡出访问量 |
|
_network_ip_in_receives_oid |
1.3.6.1.2.1.4.3.0 |
网卡进访问量 |
Pro-path/hardware/inspector/snmp.py SNMPInspector类
#system uptime _system_uptime_oid = ".1.3.6.1.2.1.1.3.0"
Pro-path/hardware/inspector/snmp.py
‘system.uptime‘:{ ‘matching_type‘:EXACT, ‘metric_oid‘:(_system_uptime_oid,str), ‘metadata‘:{}, ‘post_op‘:None, }
Pro-path/hardware/pollsters/system.py
class SystemUptimePollster(_SystemBase): IDENTIFIER = ‘system.uptime‘ TYPE = sample.TYPE_GAUGE UNIT = ‘%‘
/usr/lib/python2.7/site-packages/ceilometer-2014.2-py2.7.egg-info/entry_points.txt
[ceilometer.poll.central]
hardware.system.uptime = ceilometer.hardware.pollsters.system:SystemUptimePollster
参考1.3
标签:style blog io ar color os 使用 sp for
原文地址:http://www.cnblogs.com/smallcoderhujin/p/4150368.html