Openstack-Ceilometer-SNMP的使用

來源:互聯網
上載者:User

標籤:style   blog   io   ar   color   os   使用   sp   for   

 

1. 物理伺服器配置1.1安裝
#yum install -y net-snmp net-snmp-utils
1.2      配置

複製【附件】中snmpd.conf檔案到/etc/snmp/目錄下。(原有的重新命名,儲存)

關閉selinux和防火牆

#setenforce 0#vi /etc/sysconfig/selinux 修改為:SELINUX=disabled#service snmpd start#chkconfig snmpd on
2. 在Ceilometer中測試

添加一個已存在的meter

2.1在pipline.yaml新增meter

增加一個記憶體meter,/etc/ceilometer/pipline.yaml

- name: hardware_memory_sourceinterval: 60meters:- "hardware.memory.*"resources:- snmp://172.16.1.212sinks:- meter_sink
2.2重啟ceilometer
#systemctl restart openstack-ceilometer-central.service
2.3 擷取meter
#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 |

+--------------+-----------------------+-------+-------------+------+---------------------+

3. Ceilometer中使用snmp新增meter3.1Ceilomter目前支援的OID

分類

名稱

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

網卡進訪問量

3.2 新增OID

Pro-path/hardware/inspector/snmp.py  SNMPInspector類

#system uptime_system_uptime_oid = ".1.3.6.1.2.1.1.3.0"
3.3 新增Mapping

Pro-path/hardware/inspector/snmp.py

‘system.uptime‘:{            ‘matching_type‘:EXACT,            ‘metric_oid‘:(_system_uptime_oid,str),            ‘metadata‘:{},            ‘post_op‘:None,}
3.4 處理類

Pro-path/hardware/pollsters/system.py

class SystemUptimePollster(_SystemBase):    IDENTIFIER = ‘system.uptime‘    TYPE = sample.TYPE_GAUGE    UNIT = ‘%‘
3.5 新增模組

/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
3.6測試

參考1.3

Openstack-Ceilometer-SNMP的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.