zabbix监控ssl证书到期时间
监控脚本
cat ssl_check.sh
#!/bin/bash
#
#获取ssl证书的过期时间
#menghao
#获取证书的有效时间
time=$(echo | openssl s_client -connect $: >/dev/null | openssl x509 -noout -dates |awk -F'=' 'NR==2{print $2}')
#有效时间生成时间戳
time1=$(date +%s -d "$time")
#当前时间生成时间戳
time2=$(date +%s)
#当前时间减去有效时间,获得将要过期的天数
time3=$(((time1-time2)/(**)))
echo $time3
修改配置文件,添加如下行
vim /etc/zabbix/zabbix_agentd.conf
UserParameter=ssl_check[*],/etc/zabbix/script/ssl_check.sh $
在server端测试,看能不能获取到数据
[udbac@localhost ~]$ zabbix_get -s 192.168.0.108 -p -k ssl_check[www.baidu.com]
成功获取到了数据,接下来配置zabbix界面
配置-->主机-->监控项-->创建监控项
主要是键值[ ]里面写要监控的网址,然后点击更新就行了!

触发器:
过期时间小于10则报警



zabbix监控ssl证书到期时间的更多相关文章
- zabbix监控ssl证书过期时间
获取证书过期时间脚本: /etc/zabbix/scripts/check-cert-expire.sh: #!/bin/bash host=$ port=$ end_date=`/usr/bin/o ...
- zabbix 监控域名证书到期时间!!!!
在客户端机器上创建脚本 vim /etc/zabbix/zabbix_agentd.d/check-cert-expire.sh #!/bin/sh host=$1port=$2end_date=`o ...
- zabbix监控SSL证书有效期
想给公司网站加上证书的监控,发现agent无此监控项.科普之后发现需要自行添加脚本以及一些操作. 环境信息 系统版本: Ubuntu20.04 zabbix server版本:5.4 (这个自定义貌似 ...
- 使用nagios监控ssl证书过期时间
1.编写监控脚本. # vim check_ssl_expiry.sh #!/bin/bash STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 Host=$1 ...
- 检查阿里云ssl证书到期情况
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-06-10 16:00 # @Author : Anthony.long # ...
- 阿里云SSL证书到期(续期)图文教程
今天公司项目突然报错 后来查询是SSL证书过期了.友情提示: 证书产品仅支持新签发.不支持续费.证书到期前需在阿里云SSL证书控制台重新购买和申请证书. 登录阿里云控制台,点击产品与服务,在搜索框搜索 ...
- 查看IOS-app证书到期时间
参照: iOS企业版证书到期 https://www.jianshu.com/p/44b0dc46ef37 如果不能十分确定每一个打出来的ipa的有效期(过期时间),而又需要关注它具体什么时候需要强制 ...
- 002_监测ssl证书过期时间
一. s_client This implements a generic SSL/TLS client which can establish a transparent connection to ...
- 查看域名https证书到期时间
1.通过域名获取: echo | openssl s_client -servername 域名 -connect 域名:443 2>/dev/null | openssl x509 -noou ...
随机推荐
- Maven运行报错
在创建Maven项目时,出现报错:No goals have been specified for this build pom.xml文件加入 <build><defaultGo ...
- springboot配置SSL自签名证书
1.证书生成 每一个JDK或者JRE里都有一个工具,叫做:keytool,安装了jdk或jre之后,配置好JAVA环境之后,就可以直接在控制台使用该命令生成自签名证书: 在控制台输入: keytool ...
- C语言之将弧度值转换为角度值
#include<stdio.h> #include<stdlib.h> #define pi 3.141592 void conver_radian(float radian ...
- git bash 连接github并提交项目工程
借鉴博客:https://www.cnblogs.com/flora5/p/7152556.html https://blog.csdn.net/heng_yan/article/details/79 ...
- SpringMVC的各种注解
@RequestMapping 这个注解标注在方法名上,如 /** * 拦截所有请求: * @RequestMapping(value="/*", method = {Reques ...
- jmeter 安装
3.1 windows10环境下测试工具jmeter安装与配置 3.1.1下载安装java 浏览器中打开链接:http://down-www.7down.net/pcdown/soft/xiazai/ ...
- Get Remote Computer Install Software
#requires -Version 2 function Get-Software { param ( [string] $DisplayName='*', [string] $UninstallS ...
- tensorflow-TFRecord报错ValueError: Protocol message Feature has no "feature" field.
编写代码用TFRecord数据结构存储数据集信息是报错:ValueError: Protocol message Feature has no "feature" field.或和 ...
- TensorFlow 辨异 —— tf.placeholder 与 tf.Variable
https://blog.csdn.net/lanchunhui/article/details/61712830 https://www.cnblogs.com/silence-tommy/p/70 ...
- Vue(小案例_vue+axios仿手机app)_购物车(计算商品总金额)
一.前言 1.计算总金额 2.点击删除按钮,删除对应的商品信息 3.当还没结算的时候,当用户跳到其他页面 ...