<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>服务器安全维护工作室 &#187; DDOS攻击防御服务</title>
	<atom:link href="https://www.fuwuqiok.com/tag/ddos%e6%94%bb%e5%87%bb%e9%98%b2%e5%be%a1%e6%9c%8d%e5%8a%a1/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fuwuqiok.com</link>
	<description></description>
	<lastBuildDate>Sun, 01 Mar 2020 07:28:40 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.26</generator>
	<item>
		<title>ZABBIX监控SSL证明书有效期限</title>
		<link>https://www.fuwuqiok.com/zabbix%e7%9b%91%e6%8e%a7ssl%e8%af%81%e6%98%8e%e4%b9%a6%e6%9c%89%e6%95%88%e6%9c%9f%e9%99%90/</link>
		<comments>https://www.fuwuqiok.com/zabbix%e7%9b%91%e6%8e%a7ssl%e8%af%81%e6%98%8e%e4%b9%a6%e6%9c%89%e6%95%88%e6%9c%9f%e9%99%90/#comments</comments>
		<pubDate>Wed, 06 Dec 2017 03:03:02 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[服务器代维]]></category>
		<category><![CDATA[服务器安全代维]]></category>
		<category><![CDATA[DDOS攻击防御服务]]></category>
		<category><![CDATA[VPS代维]]></category>
		<category><![CDATA[ZABBIX监控SSL证明书有效期限]]></category>
		<category><![CDATA[云服务运维]]></category>
		<category><![CDATA[代维外包]]></category>
		<category><![CDATA[网站代维]]></category>
		<category><![CDATA[香港主机代维]]></category>
		<category><![CDATA[香港服务器代维]]></category>
		<category><![CDATA[高防服务器租用]]></category>

		<guid isPermaLink="false">https://www.fuwuqiok.com/?p=3400</guid>
		<description><![CDATA[<p>谷歌于2015年12月18日发布，优先收录https的页面。而运行 http站点或者应用时不可缺少的就是SSL [&#8230;]</p>
<p><a rel="nofollow" href="https://www.fuwuqiok.com/zabbix%e7%9b%91%e6%8e%a7ssl%e8%af%81%e6%98%8e%e4%b9%a6%e6%9c%89%e6%95%88%e6%9c%9f%e9%99%90/">ZABBIX监控SSL证明书有效期限</a>，首发于<a rel="nofollow" href="https://www.fuwuqiok.com">服务器安全维护工作室</a>。</p>
]]></description>
				<content:encoded><![CDATA[<h2 id="post_title" class="rich_font"></h2>
<div id="left_col">
<div id="article">
<div id="post_image"><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/WatchSSLExpiryData.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/WatchSSLExpiryData.png" alt="WatchSSLExpiryData" width="678" height="381" /></a></div>
<div id="single_share_top" class="single_share clearfix"></div>
<div class="post_content clearfix">
<p>谷歌于2015年12月18日发布，优先收录https的页面。而运行 http站点或者应用时不可缺少的就是SSL证明书，介绍在Zabbix监视SSL证明书有效期限的方法。</p>
<h3 class="style3a">(1) 确认ExternalScripts参数的设定</h3>
<pre>### Option: ExternalScripts
#       Full path to location of external scripts.
#       Default depends on compilation options.
#
# Mandatory: no
# Default:
# ExternalScripts=${datadir}/zabbix/externalscripts

ExternalScripts=/usr/lib/zabbix/externalscripts</pre>
<p>如果没有该目录的话，用mkdir命令进行创建。</p>
<pre># mkdir -p /usr/lib/zabbix/externalscripts
</pre>
<h3 class="style3a">(2) 创建ssl-cert-check.sh</h3>
<p>在/usr/lib/zabbix/externalscripts目录下，以以下内容创建ssl-cert-check.sh文件。</p>
<pre>#!/bin/sh
 
SERVER=$1
PORT=$2
TIMEOUT=25
 
PATH=/bin:/usr/bin; export PATH
basedir=`dirname $0`

$basedir/timeout $TIMEOUT $basedir/ssl-cert-check -s $SERVER -p $PORT -n | sed 's/  */ /g' | cut -f6 -d" " | sed 's/^.*=//g'</pre>
<p>ssl-cert-check.sh执行需要timeout及ssl-cert-check文件，用wget命令进行下载。</p>
<ul>
<li><a href="http://www.pixelbeat.org/scripts/timeout" target="_blank">http://www.pixelbeat.org/scripts/timeout</a></li>
<li><a href="http://prefetch.net/code/ssl-cert-check" target="_blank">http://prefetch.net/code/ssl-cert-check</a></li>
</ul>
<pre># cd /usr/lib/zabbix/externalscripts
# wget http://www.pixelbeat.org/scripts/timeout
# wget http://prefetch.net/code/ssl-cert-check
# chmod 755 *
</pre>
<h3 class="style3a">(3) 执行ssl-cert-check.sh脚本查看结果</h3>
<p>查看www.fuwuqiok.com的SSL证明书还有多少天可用。</p>
<pre># cd /usr/lib/zabbix/externalscripts/
# ./ssl-cert-check.sh www.fuwuqiok.com 443
361
</pre>
<p>还有361天可用，确认脚本执行结果没有问题以后，接下来配置Zabbix。</p>
<h3 class="style3a">(4) 配置Zabbix</h3>
<h4>创建主机</h4>
<p>登录Zabbix管理页面之后，依次点击「组态」-&gt;「主机」-&gt;「创建主机」。</p>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/HostDetail-600x505.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/HostDetail-600x505.png" alt="HostDetail-600x505" width="600" height="505" /></a></p>
<ul>
<li>主机名称：www.fuwuqiok.com</li>
<li>可见的名称：www.fuwuqiok.com</li>
<li>群组：Linux servers</li>
<li>端点代理程式的界面<br />
IP地址：120.26.41.73<br />
DNS名称：www.fuwuqiok.com<br />
埠：10050</li>
</ul>
<p>填写以上信息之后，点击「添加」。</p>
<h4>创建监控项</h4>
<p>在刚创建的主机www.fuwuqiok.com的页面，点击「项目」。</p>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/ClickItem-600x195.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/ClickItem-600x195.png" alt="ClickItem-600x195" width="600" height="195" /></a></p>
<p>填写以下内容之后，点击「添加」。</p>
<ul>
<li>名称：Web SSL-Cert</li>
<li>类型：外在检查</li>
<li>键值：ssl-cert-check.sh[{HOST.DNS},”443″]</li>
<li>单位：Days</li>
<li>更新间隔(秒)：86400 (1天确认一次)</li>
</ul>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/ItemDetail-600x578.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/ItemDetail-600x578.png" alt="ItemDetail-600x578" width="600" height="578" /></a></p>
<div class="notice">类型为外在检查时，Zabbix1.8为止第一个参数默认是主机名，而Zabbix2系列开始需要指定该参数。</div>
<h4>创建触发器</h4>
<p>和创建监控项时一样，在主机页面点击「触发器」-&gt;「创建触发器」之后，填写如下内容并点击「添加」。</p>
<ul>
<li>名称：SSL Certification will to expiration {HOST.DNS}</li>
<li>表示式：{www.fuwuqiok.com:ssl-cert-check.sh[{HOST.DNS},”443″].last(0)}&lt;31</li>
<li>严重性：一般严重</li>
</ul>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/TriggerDetail-600x383.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/TriggerDetail-600x383.png" alt="TriggerDetail-600x383" width="600" height="383" /></a></p>
<h4>创建图形</h4>
<p>在主机(www.fuwuqiok.com)页面点击「图形」-&gt;「创建图形」。</p>
<p>填写「名称：SSL Certificate Expiry Date」之后，点击「添加」。</p>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail-600x345.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail-600x345.png" alt="GraphDetail-600x345" width="600" height="345" /></a></p>
<p>勾选「Web SSL-Cert」-&gt;「选择」。</p>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail01-600x79.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail01-600x79.png" alt="GraphDetail01-600x79" width="600" height="79" /></a></p>
<p>功能选择「最小」之后，点击「添加」。</p>
<p><a href="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail02-600x360.png"><img class="attachment-medium" src="https://www.fuwuqiok.com/wp-content/uploads/2017/12/GraphDetail02-600x360.png" alt="GraphDetail02-600x360" width="600" height="360" /></a></p>
</div>
</div>
</div>
<p><a rel="nofollow" href="https://www.fuwuqiok.com/zabbix%e7%9b%91%e6%8e%a7ssl%e8%af%81%e6%98%8e%e4%b9%a6%e6%9c%89%e6%95%88%e6%9c%9f%e9%99%90/">ZABBIX监控SSL证明书有效期限</a>，首发于<a rel="nofollow" href="https://www.fuwuqiok.com">服务器安全维护工作室</a>。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fuwuqiok.com/zabbix%e7%9b%91%e6%8e%a7ssl%e8%af%81%e6%98%8e%e4%b9%a6%e6%9c%89%e6%95%88%e6%9c%9f%e9%99%90/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
