9888359 款待喜欢调换的朋友进入

Zabbix3.2.9QQ群音信落成告急,zabbix3.2.9qq告急

Zabbix自动化监察和控制QQ交流群:9888359 招待喜欢调换的相爱的人步向!

一、环境

cat /etc/redhat-release 
操作系统:CentOS Linux release 7.3.1611 (Core) 
Zabbix软件版本:zabbix_server (Zabbix) 3.2.9

二、安装所需包
yum install lrzsz chrony gcc gcc-c++ git openssl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker -y

systemctl enable chronyd
systemctl start chronyd

三、安装Mojo-Webqq
curl -L https://cpanmin.us/ -o /usr/bin/cpanm && chmod +x /usr/bin/cpanm
cpanm --mirror http://mirrors.sohu.com/CPAN/ Digest::MD5 Encode::Locale IO::Socket::SSL Mojolicious Time::Piece Time::Seconds Compress::Raw::Zlib Digest::SHA --force
cpanm  Mojo::SMTP::Client MIME::Lite

cd /usr/src/ && git clone https://github.com/sjdy521/Mojo-Webqq.git
cd Mojo-Webqq/ && perl Makefile.PL
make && make install

vim /usr/local/bin/MojoWebqq.pl
#!/usr/bin/env perl
use Mojo::Webqq;
my ($host,$port,$post_api);
$host = "0.0.0.0";
$qq = "10880347";
$port = 5000;
my $client = Mojo::Webqq->new(qq=>$qq);
$client->load("PostQRcode",data=>{
        smtp    =>  'smtp.qq.com',
        port    =>  '25',
        from    =>  '[email protected]',
        to      =>  '[email protected]',
        user    =>  '[email protected]',
        pass    =>  '***************',
  });

$client->login();
#$client->load("ShowMsg");
$client->load("Openqq",data=>{listen=>[{host=>$host,port=>$port}], post_api=>$post_api});
$client->run();

添加执行权限 
chmod +x /usr/local/bin/MojoWebqq.pl

后台启动Mojo-Webqq进程
/usr/local/bin/MojoWebqq.pl  >>/var/log/zabbix/zabbix-Mojo-Webqq.log 2>&1 &

tail -f /var/log/zabbix/zabbix-Mojo-Webqq.log
 (Missing semicolon on previous line?)
syntax error at /usr/local/bin/MojoWebqq.pl line 14, near "pass    =>  '"
Execution of /usr/local/bin/MojoWebqq.pl aborted due to compilation errors.
[17/10/29 20:36:43] [info] 当前正在使用 Mojo-Webqq v2.1.4
[17/10/29 20:36:43] [info] 执行插件[ Mojo::Webqq::Plugin::PostQRcode ]
[17/10/29 20:36:43] [info] 初始化 smartqq 客户端参数...
[17/10/29 20:36:43] [info] 正在获取登录二维码...
[17/10/29 20:36:44] [info] 二维码已下载到本地[ /tmp/mojo_webqq_qrcode_default.png ]
[17/10/29 20:36:44] [info] 登录二维码已经发送到邮箱: [email protected]
[17/10/29 20:36:44] [info] 等待手机QQ扫描二维码...

vim zabbix_qq.sh

qq=$1
server=”172.16.8.111″
port=”5000″
message=`echo -e “$2\n$3″|od -t x1 -A n -v -w1000000000 | tr ” ” %`
api_url=””
parameter=”uid=$qq&content=$message”
#CURL=`curl -d $parameter $api_url`
curl -d $parameter $api_url

测量试验结果

只要出现该难点:

[17/11/21 17:20:32] [error] 发送邮件,请先安装模块
Mojo::SMTP::Client
[17/11/21 17:20:32] [error]
插件[Mojo::Webqq::Plugin::PostQRcode]邮件发送失败: 

清除办法

cpanm  Mojo::SMTP::Client MIME::Lite  --force  

Zabbix自动化监察和控制QQ沟通群:9888359 应接喜欢交换的意中人步向!


1


0

翻开商量

Zabbix自动化监察和控制 QQ 沟通群 : 9888359 接待喜欢沟通的仇敌加入!
意气风发、处境cat /etc/redhat-release 操作系…

相关文章