zoukankan      html  css  js  c++  java
  • zabbix_QQ邮件告警部署(待续。。。。。。)

    安装sendmail

    wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz

    yum -y install perl-Net-SSLeay perl-IO-Socket-SSL

    tar xf sendEmail-v1.56.tar.gz -C /usr/local/

    cd /usr/local/sendEmail-v1.56/

    /bin/cp -ra sendEmail /usr/local/bin/

    chmod +x /usr/local/bin/sendEmail

    登录qq邮箱进行设置:

    测试邮件发送

    cd /usr/local/sendEmail-v1.56/

    sendEmail -f 1450595701@qq.com -t 1450595701@qq.com -u "zabbix_server" -s smtp.qq.com -o message-content-type=html -o tls=no message-charset=utf8 -xu 1450595701@qq.com -xp zoyswlqfhxhricdf

     -m "邮件发送成功"

    编写QQ邮件平台报警脚本

    cd /usr/local/zabbix/share/zabbix/alertscripts

    vim sendmail.sh

    #!/bin/bash

    # author:wei

    to=$1

    subject=$2

    body=$3

    from=1450595701@qq.com

    smtp=smtp.qq.com

    passwd=zoyswlqfhxhricdf #qq邮箱的兑换码

    /usr/local/bin/sendEmail -f "$from" -t "$to" -s "$smtp" -u "$subject" -o message-content-type=html -o tls=no message-charset=utf8 -xu "$from" -xp "$passwd" -m "$body"

    chmod +x sendmail.sh

    chown zabbix.zabbix sendmail.sh

    测试邮件发送

    sh sendmail.sh 1450595701@qq.com "hello world" "新.一天"

     

  • 相关阅读:
    Power of Cryptography
    Radar Installation
    Emag eht htiw Em Pleh
    Help Me with the Game
    89. Gray Code
    87. Scramble String
    86. Partition List
    85. Maximal Rectangle
    84. Largest Rectangle in Histogram
    82. Remove Duplicates from Sorted List II
  • 原文地址:https://www.cnblogs.com/creater-wei/p/10014130.html
Copyright © 2011-2022 走看看