Git Product home page Git Product logo

k8s-zabbix's Introduction

k8s-zabbix

根据官方Dockerfile修改

修改内容

zabbix-server-mysql

  • 安装pip
  • 安装 python requests库
  • 修改时区为**
apk add py2-pip
apk add tzdata
pip install requests 
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
apk del tzdata

告警

#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import json
import sys
import os

headers = {'Content-Type': 'application/json;charset=utf-8'}
api_url = "https://oapi.dingtalk.com/robot/send?access_token=xxxxx"

def msg(text):
    json_text= {
     "msgtype": "markdown",
        "at": {
            "atMobiles": [
                "test"
            ],
            "isAtAll": False
        },
        "markdown": {
            "title": "zabbix monitor",
            "text": text,
        }
    }
    print requests.post(api_url,json.dumps(json_text),headers=headers).content

if __name__ == '__main__':
    text = sys.argv[1]
    msg(text)

告警内容

### <font color=#FF0000>---故障---</font>
#### {HOST.NAME}
### {TRIGGER.NAME}
##### 发生时间:{EVENT.DATE} {EVENT.TIME}
## **{ITEM.LASTVALUE}**
> 来自阿里云zabbix监控

恢复内容

###  <font color=#006000>---恢复---</font>
#### {HOST.NAME}
### {TRIGGER.NAME}
##### 恢复时间:{EVENT.RECOVERY.DATE} {EVENT.RECOVERY.TIME}
##### 持续时长:{EVENT.AGE}
## **{ITEM.LASTVALUE}**
> 来自阿里云zabbix监控

k8s-zabbix's People

Contributors

xanderzhou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.