安装zabbix4.0 LTS
首页 > IT > Other   作者:eehello  2019年1月10日 10:14 星期四  浏览:8180  字号:   评论:0 条
时间:2019-1-10 10:14   浏览:8180  评论:0 条 


https://blog.csdn.net/xiaoying5191/article/details/79530280

https://blog.csdn.net/reblue520/article/details/80553221

 

我已经安装完成zabbix4.0 LTS下面我们来安装grafana

第一步安装grafana5.3.4

 

    官网下载grafana

    wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.3.4-1.x86_64.rpm

    安装

    yum -y install grafana-5.3.4-1.x86_64.rpm

    安装完成以后启动grafna,命令:

    /etc/init.d/grafnan-server start

    要安装一下grafana-zabbix插件,否则无法添加zabbix,命令:

    获取插件列表,命令:

    grafana-cli plugins list-remote

第三个插件alexanderzobnin-zabbix-app version: 3.8.1是我们要安装的zabbix插件,命令: 
grafana-cli plugins install alexanderzobnin-zabbix-app

 

重启grafana-server,用浏览器打开服务器的3000端口,http://ip:3000 进行登录。登录名密码默认都是admin

 

登录界面,启用zabbix插件

 

创建zabbix数据源,url要填写zabbix目录下的api_jsonrpc.php,格式为http://ip/zabbix/api_jsonrpc.php,下面的选项按实际情况填写,用户名密码填写zabbix的用户名和密码。

Direct DB Connection这里可选可不选,选择的好处是直接连接数据库获取数据比zabbix-api的方式要更快,更加节省资源。

 

 

Zabbix邮件报警设置

 

https://www.osyunwei.com/archives/8113.html

 

说明:

Zabbix监控服务端、客户端都已经部署完成,被监控主机已经添加,Zabiix监控运行正常。

实现目的:

Zabbix服务端设置邮件报警,当被监控主机宕机或者达到触发器预设值时,会自动发送报警邮件到指定邮箱。

具体操作:

以下操作在Zabbix监控服务端进行

备注:Zabbix监控服务端

操作系统:CentOS

主机名:zabbix.osyunwei.com

邮件报警有两种情况:

1Zabbix服务端只是单纯的发送报警邮件到指定邮箱,发送报警邮件的这个邮箱账号是Zabbix服务端的本地邮箱账号(例如:root@localhost.localdomain),只能发送,不能接收外部邮件。

2、使用一个可以在互联网上正常收发邮件的邮箱账号(例如:xxx@163.com),通过在Zabbix服务端中设置,使其能够发送报警邮件到指定邮箱。

第一种:使用Zabbix服务端本地邮箱账号发送邮件

一、安装sendmail或者postfix

yum install sendmail #安装

service sendmail start #启动

chkconfig sendmail on #设置开机启动

yum install postfix

service postfix start

chkconfig postfix on

CentOS 5.x 默认已经安装好sendmail

CentOS 6.x 默认已经安装好postfix

sendmailpostfix只需要安装一个即可并开启服务即可。

二、安装邮件发送工具mailx

yum install mailx #安装

CentOS 5.x 编译安装mailx,直接yum安装的mailx版本太旧,使用外部邮件发送会有问题。

yum remove mailx #卸载系统自带的旧版mailx

下载mailx

http://nchc.dl.sourceforge.net/project/heirloom/heirloom-mailx/12.4/mailx-12.4.tar.bz2

tar jxvf mailx-12.4.tar.bz2 #解压

cd mailx-12.4 #进入目录

make #编译

make install UCBINSTALL=/usr/bin/install #安装

ln -s /usr/local/bin/mailx /bin/mail #创建mailxmail的软连接

ln -s /etc/nail.rc /etc/mail.rc #创建mailx配置文件软连接

whereis mailx #查看安装路径

mailx -V #查看版本信息

echo "zabbix test mail" |mail -s "zabbix" xxx@163.com 

#测试发送邮件,标题zabbix,邮件内容:zabbix test mail,发送到的邮箱:xxx@163.com

第二种:使用外部邮箱账号发送报警邮件设置

一、关闭sendmail或者postfix

service sendmail stop #关闭

chkconfig sendmail off #禁止开机启动

service postfix stop

chkconfig postfix off

备注:

使用外部邮箱账号时,不需要启动sendmail或者postfix

如果在sendmail或者postfix启动的同时使用外部邮箱发送报警邮件,首先会读取外部邮箱

配置信息

二、安装邮件发送工具mailx

yum install mailx #安装

CentOS 5.x 编译安装mailx,直接yum安装的mailx版本太旧,使用外部邮件发送会有问题。

yum remove mailx #卸载系统自带的旧版mailx

下载mailx

http://nchc.dl.sourceforge.net/project/heirloom/heirloom-mailx/12.4/mailx-12.4.tar.bz2

tar jxvf mailx-12.4.tar.bz2 #解压

cd mailx-12.4 #进入目录

make #编译

make install UCBINSTALL=/usr/bin/install #安装

ln -s /usr/local/bin/mailx /bin/mail #创建mailxmail的软连接

ln -s /etc/nail.rc /etc/mail.rc #创建mailx配置文件软连接

whereis mailx #查看安装路径

mailx -V #查看版本信息

三、配置Zabbix服务端外部邮箱

vi /etc/mail.rc #编辑,添加以下信息

set from=xxx@163.com smtp=smtp.163.com

set smtp-auth-user=xxx@163.com smtp-auth-password=123456

set smtp-auth=login

:wq! #保存退出

echo "zabbix test mail" |mail -s "zabbix" yyy@163.com

#测试发送邮件,标题zabbix,邮件内容:zabbix test mail,发送到的邮箱:yyy@163.com

#这时候,邮箱yyy@163.com会收到来自xxx@163.com的测试邮件

https://blog.csdn.net/rujianxuezha/article/details/79844190


 您阅读这篇文章共花了: 
二维码加载中...
本文作者:eehello      文章标题: 安装zabbix4.0 LTS
本文地址:https://www.eehello.com/?post=242
版权声明:若无注明,本文皆为“点滴记忆---观雨亭”原创,转载请保留文章出处。

返回顶部| 首页| 手气不错| 留言板|后花园

Copyright © 2014-2023 点滴记忆---观雨亭