windows mysql5.7 关闭ssl_快速部署zabbix并监控windows服务

其实zabbix的部署不是什么高深的玩意儿,部署后的监控节点设计、二次开发才是正事儿。今天我们简单分享下zabbix监控windows服务的步骤。

先快速部署一个zabbix环境出来

1、系统防火墙配置

[root@redhat html]# firewall-cmd --permanent --zone=public --add-service=https[root@redhat html]# firewall-cmd --permanent --zone=public --add-service=http[root@redhat html]# firewall-cmd --permanent --zone=public --add-service=ssh[root@redhat html]# firewall-cmd --permanent --zone=public --add-port=10051/tcp[root@redhat html]# firewall-cmd --reload

2、关闭SElinux

9f71eb34adc4077c4b914104224c412b.png

3、安装LAMP

  • PHP
[root@redhat html]# yum -y install httpd httpd-devel[root@redhat html]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm[root@redhat html]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm[root@redhat html]# yum -y install mod_php72w.x86_64[root@redhat html]# yum install openssl openssl-devel[root@redhat html]# yum -y install php72w-pdo php72w-mbstring php72w-mysql php72w-ldap php72w-bcmath php72w-xml php72w-fpm php72w-gd php72w-cli修改配置文件AddType application/x-httpd-php-source .phpsAddType application/x-httpd-php .php
  • MariaDB
配置YUM源[root@redhat html]# vi /etc/yum.repos.d/MariaDB.repo# MariaDB 10.2.4 CentOS repository list - created 2017-05-05 16:13 UTC# http://downloads.mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDBgpgcheck=1wq安装[root@redhat html]# yum -y install MariaDB-server MariaDB-client[root@redhat html]# systemctl start mariadb #启动服务[root@redhat html]# systemctl enable mariadb #设置开机启动[root@redhat html]# mysql -uroot[root@redhat html]# mysql_secure_installation配置init_connect='SET collation_connection = utf8_unicode_ci'init_connect='SET NAMES utf8'character-set-server=utf8collation-server=utf8_unicode_ciskip-character-set-client-handshakedefault-character-set=utf8创建数据库和用户mysql -uroot -pzabbixcreate database zabbix;mysql>grant all on zabbix.* to zabbix@localhost identified by 'zabbix@123';

4、安装zabbix

[root@redhat html]#rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm[root@redhat html]#yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent[root@redhat html]#gunzip /usr/share/doc/zabbix-server-mysql*/create.sql.gz[root@redhat html]#mysql -uzabbix -pzabbix@123source /usr/share/doc/zabbix-server-mysql*/create.sql[root@redhat html]#vim /etc/zabbix/zabbix_server.conf ADD DBPassword=zabbix@123CacheSize=10240M[root@redhat html]#vim /etc/httpd/conf.d/zabbix.confphp_value date.timezone Asia/Shanghai[root@redhat html]#systemctl restart zabbix-server zabbix-agent httpd[root@redhat html]#systemctl enable zabbix-server zabbix-agent httpd[root@redhat html]#vim /usr/share/zabbix/include/defines.inc.phpdefine('ZBX_GRAPH_FONT_NAME', 'msyh');define('ZBX_FONT_NAME', 'msyh');

5、配置SSL

[root@redhat html]#yum install mod_ssl -y[root@redhat html]#vim /etc/httpd/conf.d/ssl.confSSLCertificateFile /etc/httpd/ssl/2_www.**.cn.crt #填写证书文件路径SSLCertificateKeyFile /etc/httpd/ssl/3_www.***.cn.key #填写私钥文件路径SSLCertificateChainFile /etc/httpd/ssl/1_root_bundle.crt #填写证书链文件路径、

6、zabbix agent安装

  • centos/redhat 7:
 [root@redhat html]#rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.7-1.el7.x86_64.rpm 
  • centos/redhat 6:
[root@redhat html]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-agent-4.0.7-1.el6.x86_64.rpm[root@redhat html]#vim /etc/zabbix/zabbix_agentd.confPidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix/zabbix_agentd.logLogFileSize=0Server=zabbix server addressServerActive=zabbix server addressHostname=local hostnameInclude=/etc/zabbix/zabbix_agentd.d/*.conf
  • centos/redhat 6 :
[root@redhat html]#chkconfig zabbix-agent on [root@redhat html]#iptables -I INPUT 3 -s zabbix server address -p tcp --dport 10050 -j ACCEPT
  • centos/redhat 7 :
 [root@redhat html]#systemctl enable zabbix-agent.service
  • centos/redhat 6 :
 [root@redhat html]#service zabbix-agent start 
  • centos/redhat 7 :
 [root@redhat html]#systemctl start zabbix-agent
  • Selinux 配置
[root@redhat html]#yum install policycoreutils-python[root@redhat html]#yum update selinux-policy.noarch selinux-policy-targeted.noarch [root@redhat html]#cat /var/log/audit/audit.log | grep zabbix_agentd | grep denied | audit2allow -M zabbix_agent_setrlimit [root@redhat html]#semodule -i zabbix_agent_setrlimit.pp

监控windows服务状态

依次点开:配置--模版--Template OS Windows--自动发现--Windows service discovery,

先看监控项原型的定义,service.info[{#SERVICE.NAME},state]即获取服务的启动类型。

f2ea119d7afa55329e9011f60a8b5a0e.png
6feebdd8f4e48eb35302153e21b6480d.png

再看应用集,以DC01这台windows server为例,其应用集中有两个windows service的自动发现规则,定义只发现startup为automatic和automatic delayed的服务

ea43c30fe373bbc53162b975f74fb32f.png

最后进入触发器原型,{Template OS Windows:service.info[{#SERVICE.NAME},state].min(#3)}<>0 表示监控项原型中获取到的最近3次的state最小值,均不等于0

57a1d80561c1f79c61362c023621e838.png
综上3个条件:1、自动发现startup为automatic和automatic delayed的服务2、获取这些服务的状态3、如果不为0则报警(0表示运行中)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值