zoukankan      html  css  js  c++  java
  • 微信公众号实现zaabix报警2017脚本(升级企业微信后)

    #!/bin/bash
    
    CropID='xxxxxxxxxxxxxxxxx'
    Secret='xxxxxxxxxxxxxxxx'
    GURL="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CropID&corpsecret=$Secret"
    Gtoken=$(/usr/bin/curl -s -G $GURL | awk -F" '{print $10}')
    
    PURL="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$Gtoken"
    
    function body() {
            local int AppID=28
            local UserID=$1
            local PartyID=3
            local Msg=$(echo "$@" | cut -d" " -f3-)
            printf '{
    '
            printf '	"touser" : "'"$UserID""",
    "
            printf '	"toparty" : "'"$PartyID""",
    "
            printf '	"totag" : "'"1""",
    "
            printf '	"msgtype" : "text",
    '
            printf '	"agentid" : "'"$AppID""",
    "
            printf '	"text" : {
    '
            printf '		"content" : "'"$Msg"""
    "
            printf '	}
    '
            printf '}
    '
    }
    /usr/bin/curl --data-ascii "$(body  $1 $2 $3)" $PURL
  • 相关阅读:
    Java_多线程入门
    JAVA多线程基础(一)
    多线程1
    1.优化MySQL数据库
    廖胤松
    Mybatais
    Spring Boot入门
    MySQL的安装步骤详解
    MySQL入门
    WEB测试方法
  • 原文地址:https://www.cnblogs.com/yangliheng/p/6944779.html
Copyright © 2011-2022 走看看