Zabbix监控 Openstck实例

8 篇文章 0 订阅
4 篇文章 0 订阅

Zabbix-OpenStack-Instance

Monitoring OpenStack Instance Info with Zabbix referred from https://github.com/superbigsea/zabbix-kvm

As we all know,Openstack has plenty of Compute nodes .Each Compute node has its own Virtual machine.Sometimes,we want to monitor the Virtual machine info by install celiometer moudle .However,it is so awkward .This project can make it with libvirt.We can get cpu、mem、disk、network info through it.

We get KVM info by libvirt-python api on Compute nodes which we install zabbix-agent,and then send it to Zabbix Server which we can set up in our controller node.

Install Zabbix agent

Download

Youy should Install Zabbix Server before you begin.You can choose to install zabbix-agent from Packages.

  • CentOS:

    # rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
    # yum clean all
    # yum install -y zabbix-agent
    
  • Ubuntu:

    # wget https://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-2+bionic_all.deb
    # dpkg -i zabbix-release_3.0-2+bionic_all.deb
    # apt update
    # apt install -y zabbix-agent
    

Modify zabbix_agentd.conf file

1.Allow the agent to run as “root” by set "AllowRoot =1 ".

2.Remove the “#” before “Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf”

3.UnsafeUserParameters=1

Install libvirt-python

Python2 or Python3 is all ok in this project

# pip install libvirt-python

Copy files

  • Copy zabbix-kvm.py to /etc/zabbix

    # chmod u+x zabbix-kvm.py
    # python /etc/zabbix/zabbix-kvm.py --item discovery          # print instanceinfo
    # python  /etc/zabbix/zabbix-kvm.py --item cpu --uuid '0ae1e5df-ecd3-47ff-ac47-12fe4ccc1bfc'                                                # change uuid to yours
    

    uuid is your instance uuid we can get it from libvirt python api

  • Copy userparameter_zabbix-kvm.conf to /etc/zabbix/zabbix_agentd.conf.d

    # systemctl restart zabbix-agent                           # restart zabbix-agent
    
  • Check in Zabbix-server

    # zabbix_get -s 192.168.1.213 -k kvm.domain.discover
    # zabbix_get -s 192.168.1.214 -k kvm.domain.port1_net_out[0ae1e5df-ecd3-47ff-ac47-12fe4ccc1bfc]
    

    Import OpenStack.xml

    As we can see,we can import xml file into Zabbix Template.Then apply it to your own host.
    在这里插入图片描述
    在这里插入图片描述

Check Latest data

在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值