<?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>Shell Monitor (监控) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-2021-12.github.io/category/languages/shell/shell-tool/shell-monitor/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-2021-12.github.io/</link>
	<description></description>
	<lastBuildDate>Sun, 26 Dec 2021 09:18:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[工具] Shell LNMP 没运行则重启系统 （systemctl 版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-lnmp-check-restart-systemctl/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 10 Dec 2021 14:26:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Monitor (监控)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=19607</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：LNMP 没运行则重启系统作用：LNMP 没运行则重启系统 使用方法：1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：LNMP 没运行则重启系统<br>作用：LNMP 没运行则重启系统</p>



<p>使用方法：<br>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash
  
systemctl status nginx | grep 'active (running)'
if &#91; $? -ne 0 ];then
        /usr/sbin/reboot
fi

systemctl status mariadb | grep 'active (running)'
if &#91; $? -ne 0 ];then
        /usr/sbin/reboot
fi

systemctl status php-fpm | grep 'active (running)'
if &#91; $? -ne 0 ];then
        /usr/sbin/reboot
fi</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 实时监控内存 （永久版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-real-time-monitoring-endless/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 03 Oct 2021 05:15:52 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17672</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：实时监控内存作用：实时监控内存，并每 3 秒钟更新一次状态信息 使用方法：1. 给此脚本添加执行权限2. 执行此脚本 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：实时监控内存<br>作用：实时监控内存，并每 3 秒钟更新一次状态信息</p>



<p>使用方法：<br>1. 给此脚本添加执行权限<br>2. 执行此脚本</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

while true
do
        sleep 10
        free -m | head -1
        free -g | grep Mem
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 实时监控内存 （进行 100 次版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-real-time-monitoring-100/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 01 Sep 2021 06:16:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17605</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：实时监控内存作用：实时监控内存，并每 3 秒钟更新一次状态信息，总过进行 100 次 使用方法：1. 给此脚本添加执行权限2. 执行此脚本 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：实时监控内存<br>作用：实时监控内存，并每 3 秒钟更新一次状态信息，总过进行 100 次</p>



<p>使用方法：<br>1. 给此脚本添加执行权限<br>2. 执行此脚本</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

i=1

free -m | head -1

while &#91; $i -le 100 ]
do
        let i=i+1
        free -m | grep Mem
        sleep 3
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 查看所有可升级的软件版本，并自动生成相应的升级命令 （openSUSE&#038;SUSE）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-rpms-info-command-opensusesuse/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 27 Jul 2021 08:34:16 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=17150</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：openSUSE&#38;SUSE 查看所有可升级的软件版本，并自动生成相应的升级命令作用：openSUSE&#38;SUSE 查看所有可升级的软件版本，并自动生成相应的升级命令 使用方法：给此脚本添加执行权限执行此脚本执行此脚本大致会生成以下内容： 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：openSUSE&amp;SUSE 查看所有可升级的软件版本，并自动生成相应的升级命令<br>作用：openSUSE&amp;SUSE 查看所有可升级的软件版本，并自动生成相应的升级命令</p>



<p>使用方法：<br>给此脚本添加执行权限<br>执行此脚本<br>执行此脚本大致会生成以下内容：</p>



<pre class="wp-block-code"><code>zypper update  MozillaFirefox-78.12.0-lp152.2.61.1 MozillaFirefox-translations-common-78.12.0-lp152.2.61.1 alsa-oss-1.1.8-lp152.4.3.1</code></pre>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

m=''

for n in `zypper list-updates | tail -n +5 | awk '{print $7"-"$11}'`
do
        m="$m $n"
done

echo "zypper update $m"</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 检测服务器某个端口有没有启动</title>
		<link>https://eternalcenter-2021-12.github.io/shell-port-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 18 May 2021 06:23:57 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=14314</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：检测服务器某个端口有没有启动作用：检测服务器某个端口有没有启动 使用方法：1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本4. 如果被检测的端口被启动则会被记录在指定文件里 脚本分割线里的变量：1. checkport=&#8217;7111&#8242; #被检测的端口2. logfile=&#8217;checkportlog.txt&#8217; #记录文件 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：检测服务器某个端口有没有启动<br>作用：检测服务器某个端口有没有启动</p>



<p>使用方法：<br>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本<br>4. 如果被检测的端口被启动则会被记录在指定文件里</p>



<p>脚本分割线里的变量：<br>1. checkport=&#8217;7111&#8242; #被检测的端口<br>2. logfile=&#8217;checkportlog.txt&#8217; #记录文件</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################
checkport='7111'
logfile='checkportlog.txt'
####################### Separator ########################

a=`/sbin/ss -ntulap | grep udp | grep $checkport | awk '{print $7}' | awk -F'"' '{print $2}'`

if &#91; -n "$a" ];then
       echo `date` >> $logfile
       echo $checkport >> $logfile
       echo `/sbin/ss -ntulap | grep udp | grep $checkport | awk '{print $7}' | awk -F'"' '{print $2}'` >> $logfile
       echo >> $logfile
fi</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 检测服务器 CPU 占用率并报警写入日志</title>
		<link>https://eternalcenter-2021-12.github.io/shell-cpu-monitor/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 18 Mar 2021 09:32:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13622</guid>

					<description><![CDATA[介绍： #名称：检测服务器 CPU 占用率并报警写入日志#作用：检测服务器 CPU 占用率并报警写入日志 #使用方法：#1. 在此脚本的分割线内写入相应的内容#2. 给此脚本添加执行权限#3. 将此脚本添加到周期性计划任务里#4. 如果 CPU 占用率超过了报警值则将报警信息写入 /var/log/message 脚本分割线里的变量：cputhreshold=95 #CPU 报警的占比值 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>#名称：检测服务器 CPU 占用率并报警写入日志<br>#作用：检测服务器 CPU 占用率并报警写入日志</p>



<p>#使用方法：<br>#1. 在此脚本的分割线内写入相应的内容<br>#2. 给此脚本添加执行权限<br>#3. 将此脚本添加到周期性计划任务里<br>#4. 如果 CPU 占用率超过了报警值则将报警信息写入 /var/log/message</p>



<p>脚本分割线里的变量：<br>cputhreshold=95 #CPU 报警的占比值</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################
cputhreshold=95
####################### Separator ########################

cpumonitor() {
cpu=`top -n 1 -b | grep Cpu | awk -F, '{print $1}'| awk -F: '{print $2}'| awk '{print $1}'`

if &#91; `echo "$cpu > $1"|bc` -ne 0 ]
then
        logger "CPU_Alarm CPU until $cpu"
fi
}

cpumonitor $cputhreshold</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量检测服务器 TCP 端口的联通状态 （nc 版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-tcp-check-nc/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 25 Jan 2021 10:34:16 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13243</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量检测服务器 TCP 端口的联通状态作用：批量检测服务器 TCP 端口的联通状态 使用方法：1. 端口清单 $portlist 每一个端口占用一行，格式为：&#60;要联通端口号对应的 IP 地址&#62;:&#60;要联通的端口号&#62;:&#60;端口功能&#62;2. 在此脚本的分割线内写入相应的内容，并和此脚本放在同一目录下3. 给此脚本添加执行权限4. 执行此脚本，并将要测试的服务器 IP 地址跟在脚本的后面，例：. &#60;脚本名&#62; &#60;服务器 IP 地址 1&#62; &#60;服务器 IP 地址 2&#62; &#8230;&#8230; 脚本分割线里的变量：portlist=tcp_ports.txt #存放要测试的 TCP 端口的文件 注意：1. 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器2. 执行此脚本前确保 nc 命令已经安装 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量检测服务器 TCP 端口的联通状态<br>作用：批量检测服务器 TCP 端口的联通状态</p>



<p>使用方法：<br>1. 端口清单 $portlist 每一个端口占用一行，格式为：&lt;要联通端口号对应的 IP 地址&gt;:&lt;要联通的端口号&gt;:&lt;端口功能&gt;<br>2. 在此脚本的分割线内写入相应的内容，并和此脚本放在同一目录下<br>3. 给此脚本添加执行权限<br>4. 执行此脚本，并将要测试的服务器 IP 地址跟在脚本的后面，例：. &lt;脚本名&gt; &lt;服务器 IP 地址 1&gt; &lt;服务器 IP 地址 2&gt; &#8230;&#8230;</p>



<p>脚本分割线里的变量：<br>portlist=tcp_ports.txt #存放要测试的 TCP 端口的文件</p>



<p>注意：<br>1. 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器<br>2. 执行此脚本前确保 nc 命令已经安装</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

portlist=tcp_ports.txt

####################### Separator ########################

for hosts in $*
do

        echo $hosts
        ssh $hosts "which nc" &amp;> /dev/null

        if &#91; $? -ne 0 ];then
                echo -e "\033&#91;31m$hosts can not use nc !!!!!!!!!!\033&#91;0m"
                continue
        fi

        for line in `cat $portlist`
        do
                ips=`echo $line | awk -F':' '{print $1}'`
                ports=`echo $line | awk -F':' '{print $2}'`
                remarks=`echo $line | awk -F':' '{print $3}'`

                ssh $hosts "nc -z -w 3 $ips $ports"

                if &#91; $? -ne 0 ];then
                        echo -e "\033&#91;31m$ips $ports $remarks can not be connected !!!!!!!!!!\033&#91;0m"
                else
                        echo -e "\033&#91;32m$ips $ports $remarks can be connected\033&#91;0m"
                fi

        done

done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[TOOL] Shell Check Memory Usage (15 seconds each time, 100 times in total)</title>
		<link>https://eternalcenter-2021-12.github.io/tool-shell-check-memory-usage-15-seconds-each-time-100-times-in-total%ef%bc%89/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 18 Dec 2020 07:02:08 +0000</pubDate>
				<category><![CDATA[English (英文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=13094</guid>

					<description><![CDATA[Introduce： Author: Mingyu ZhuName: view the process using swapFunction: view the process using swap Usage:1. Add execution permission to this script2. Execute the script Script:]]></description>
										<content:encoded><![CDATA[
<h2>Introduce：</h2>



<p>Author: Mingyu Zhu<br>Name: view the process using swap<br>Function: view the process using swap</p>



<p>Usage:<br>1. Add execution permission to this script<br>2. Execute the script</p>



<h2>Script:</h2>



<pre class="wp-block-code"><code>#!/bin/bash

i=1

while &#91; $i -le 100 ]
do free -m
        sleep 15
        let i=i+1
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 查看可以无密码登陆系统的用户</title>
		<link>https://eternalcenter-2021-12.github.io/shell-no-password-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 11 Nov 2020 15:23:35 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=11670</guid>

					<description><![CDATA[脚本： 作者：朱明宇名称：查看可以无密码登陆系统的用户作用：查看可以无密码登陆系统的用户 使用方法：1. 给此脚本添加执行权限2. 执行此脚本 介绍：]]></description>
										<content:encoded><![CDATA[
<h2>脚本：</h2>



<p>作者：朱明宇<br>名称：查看可以无密码登陆系统的用户<br>作用：查看可以无密码登陆系统的用户</p>



<p>使用方法：<br>1. 给此脚本添加执行权限<br>2. 执行此脚本</p>



<h2>介绍：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

for name in `egrep '^.*\:!!\:.*$|^.*\:\*\:.*$' /etc/shadow | cut -d : -f 1`
do
        egrep '/sbin/nologin|/bin/false' /etc/passwd | egrep $name > /dev/null

        if &#91; $? -ne 0 ];then
                envi=`grep $name /etc/passwd | cut -d : -f 7`
                echo "$name has no password but maybe can access system, it is $envi"
        fi

done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 检测服务器 SSH 端口的联通状态</title>
		<link>https://eternalcenter-2021-12.github.io/shell-ssh-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 26 Sep 2020 15:46:56 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=10603</guid>

					<description><![CDATA[介绍 #作者：朱明宇#名称：检测服务器 SSH 端口的联通状态#作用：检测服务器 SSH 端口的联通状态 #使用方法：#1. 在此脚本的分割线内写入相应的内容#2. 给此脚本添加执行权限#3. 执行此脚本#4. 如果联通检测失败则会将结果写入脚本同目录下的 checkserver.txt 脚本分割线里的变量：host=&#8221;8.8.8.8&#8243; #需要检测 SSH 端口联通性的服务器 IP 地址 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍</h2>



<p>#作者：朱明宇<br>#名称：检测服务器 SSH 端口的联通状态<br>#作用：检测服务器 SSH 端口的联通状态</p>



<p>#使用方法：<br>#1. 在此脚本的分割线内写入相应的内容<br>#2. 给此脚本添加执行权限<br>#3. 执行此脚本<br>#4. 如果联通检测失败则会将结果写入脚本同目录下的 checkserver.txt</p>



<p>脚本分割线里的变量：<br>host=&#8221;8.8.8.8&#8243; #需要检测 SSH 端口联通性的服务器 IP 地址</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

host="8.8.8.8"

####################### Separator ########################

checktime=`date +%Y-%m-%d-%H-%M`
sleep 2 | telnet $host 22 | grep SSH

if &#91; $? -ne 0 ];then
	echo "$checktime server timeout" &gt;&gt; checkserver.txt
fi</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量检测某一个软件包的安装情况 （通过读取和生成 CSV 文件实现）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-rpm-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 04 May 2020 06:13:35 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=8925</guid>

					<description><![CDATA[介绍： 使用方法：1. 将此脚本和 patch.cs 文件放在同一目录下2. patch.cs 里每一个 IP 地址和每一个 RPM 包名称占用一行3. 给此脚本添加执行权限4. 执行此脚本5. 此脚本执行完成后，会将运行结果写入当前目录下的 checkout.csv 注意：此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器 补充：patch.cs 示例如下： 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>使用方法：<br>1. 将此脚本和 patch.cs 文件放在同一目录下<br>2. patch.cs 里每一个 IP 地址和每一个 RPM 包名称占用一行<br>3. 给此脚本添加执行权限<br>4. 执行此脚本<br>5. 此脚本执行完成后，会将运行结果写入当前目录下的 checkout.csv</p>



<p>注意：此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器</p>



<p>补充：patch.cs 示例如下：</p>



<pre class="wp-block-code"><code>192.168.100.101,kernel-4.18.0-80.el8.x86_64,other0
192.168.100.102,kernel-4.18.0-80.el8.x86_64,other1
192.168.100.103,kernel-4.11.0-80.el8.x86_64,other2
192.168.100.104,kernel-4.18.0-80.el8.x86_64,other3
192.168.100.105,kernel-4.18.0-80.el8.x86_64,other4</code></pre>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

for i in `seq 1 $(cat patch.csv | wc -l)`
do

        servername=`sed -n "$&#91;i]p" patch.csv | cut -d ',' -f 1`
        software=`sed -n "$&#91;i]p" patch.csv | cut -d ',' -f 2`

        ssh $servername "rpm -qa | grep $software" &amp;> /dev/null

        if &#91; $? -eq 0 ];then
                echo "$servername,$software,have not patched"
        else
                echo "$servername,$software,have patched"
        fi

done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 查看使用 swap 的进程</title>
		<link>https://eternalcenter-2021-12.github.io/shell-swap-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 27 Apr 2020 13:14:15 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=8867</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：查看使用 swap 的进程作用：查看使用 swap 的进程 使用方法：1. 给此脚本添加执行权限2. 执行此脚本3. 执行结果会输出到脚本同目录下的 swapcheck.txt 目录中 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：查看使用 swap 的进程<br>作用：查看使用 swap 的进程</p>



<p>使用方法：<br>1. 给此脚本添加执行权限<br>2. 执行此脚本<br>3. 执行结果会输出到脚本同目录下的 swapcheck.txt 目录中</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

echo > swapcheck.txt

for pid in `ls /proc/ | egrep ^&#91;0-9] | awk '$0 > 100'`
do 

        ls /proc/$pid &amp;> /dev/null
        
        if &#91; $? -ne 0 ];then
                continue
        fi

        size=`awk '/Swap:/{a=a+$2}END{print a}' /proc/$pid/smaps` 
        name=`ps -aux | egrep $pid`

        if &#91; -z $size ];then
                continue
        fi

        if &#91; $size -eq 0 ];then
                continue
        fi

        echo "$&#91;size]k $pid \"$name\"" >> swapcheck.txt
        echo  >> swapcheck.txt

done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量检测服务器 TCP 端口的联通状态 （telnet 版）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-tcp-check-telnet/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 03 Dec 2019 06:31:27 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=7197</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量检测服务器 TCP 端口的联通状态作用：批量检测服务器 TCP 端口的联通状态，并将此服务器无法联通的端口存储到 $checklist 文件里 使用方法：1. 将此脚本和端口清单 $portlist 文件放在同一目录下2. 端口清单 $portlist 每一个端口占用一行，格式为：&#60;要联通端口号对应的 IP 地址&#62;:&#60;要联通的端口号&#62;:&#60;端口功能&#62;，并和此脚本放在同一目录下3. 在此脚本的分割线内写入相应的内容4. 给此脚本添加执行权限5. 执行此脚本，并将要测试的服务器 IP 地址跟在脚本的后面，例：. &#60;脚本名&#62; &#60;服务器 IP 地址 1&#62; &#60;服务器 IP 地址 2&#62; &#8230;&#8230; 脚本分割线里的变量：1. portlist=tcp_ports.txt #存放要测试的 TCP 端口的文件2. checklist=tcp_ports_checklist.txt #存放测试结果的文件 注意：1. 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器2. 此脚本会清空 $checklist3. 执行此脚本前确保 telnet 命令已经安装4. 执行此脚本可能有些慢 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量检测服务器 TCP 端口的联通状态<br>作用：批量检测服务器 TCP 端口的联通状态，并将此服务器无法联通的端口存储到 $checklist 文件里</p>



<p>使用方法：<br>1. 将此脚本和端口清单 $portlist 文件放在同一目录下<br>2. 端口清单 $portlist 每一个端口占用一行，格式为：&lt;要联通端口号对应的 IP 地址&gt;:&lt;要联通的端口号&gt;:&lt;端口功能&gt;，并和此脚本放在同一目录下<br>3. 在此脚本的分割线内写入相应的内容<br>4. 给此脚本添加执行权限<br>5. 执行此脚本，并将要测试的服务器 IP 地址跟在脚本的后面，例：. &lt;脚本名&gt; &lt;服务器 IP 地址 1&gt; &lt;服务器 IP 地址 2&gt; &#8230;&#8230;</p>



<p>脚本分割线里的变量：<br>1. portlist=tcp_ports.txt #存放要测试的 TCP 端口的文件<br>2. checklist=tcp_ports_checklist.txt #存放测试结果的文件</p>



<p>注意：<br>1. 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器<br>2. 此脚本会清空 $checklist<br>3. 执行此脚本前确保 telnet 命令已经安装<br>4. 执行此脚本可能有些慢</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

portlist=tcp_ports.txt
checklist=tcp_ports_checklist.txt

####################### Separator ########################

echo  > $checklist
maxnum=`cat $portlist | wc -l`

for hosts in $*
do

        echo $hosts >> $checklist

        for i in `seq 1 $maxnum`
        do

                ips=`sed -n $&#91;i]p $portlist | awk -F':' '{print $1}'`
                ports=`sed -n $&#91;i]p $portlist | awk -F':' '{print $2}'`
                remarks=`sed -n $&#91;i]p $portlist | awk -F':' '{print $3}'`

                ssh $hosts "(sleep 1;) | telnet $ips $ports 2>&amp;1" | grep 'timed out' >> $checklist

                if &#91; $? == 0 ];then
                        echo "`sed -n $&#91;i]p $portlist`" >> $checklist
                        echo >> $checklist
                fi

        done

        echo >> $checklist

done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量检测服务器网络的联通状态</title>
		<link>https://eternalcenter-2021-12.github.io/shell-ping/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 21 Aug 2019 05:26:33 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=5387</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量检测服务器网络的联通状态作用：批量检测服务器网络的联通状态 使用方法：1. 将此脚本和清单 $list 文件放在同一目录下2. 清单 $list 里每一个远程服务器名或 IP 地址占用一行3. 在此脚本的分割线内写入相应的内容4. 给此脚本添加执行权限5. 执行此脚本 脚本分割线里的变量：list=&#8221;servers_all_list.txt&#8221; #指定服务器清单 脚本： （补充：清单示例如下，可直接复制粘贴，如果不更改脚本，清单请命名为 servers_all_list.txt： db1db2db3web1web2）]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量检测服务器网络的联通状态<br>作用：批量检测服务器网络的联通状态</p>



<p>使用方法：<br>1. 将此脚本和清单 $list 文件放在同一目录下<br>2. 清单 $list 里每一个远程服务器名或 IP 地址占用一行<br>3. 在此脚本的分割线内写入相应的内容<br>4. 给此脚本添加执行权限<br>5. 执行此脚本</p>



<p>脚本分割线里的变量：<br>list=&#8221;servers_all_list.txt&#8221; #指定服务器清单</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

list="servers_all_list.txt"

####################### Separator ########################

read -p "will ping please input y " a
echo $a

if &#91; "$a" != "y" ];then
        echo "you don't agree so exit now"
        exit
fi

num=0

for i in `awk '{print $1}' servers_all_list.txt`
do
        let num++
        echo "$num $i"
        ping -c3 -i0.4 -w0.8 $i
        echo
done</code></pre>



<hr class="wp-block-separator"/>



<p>（<br>补充：清单示例如下，可直接复制粘贴，如果不更改脚本，清单请命名为 servers_all_list.txt：</p>



<p>db1<br>db2<br>db3<br>web1<br>web2<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量检测域名的 DNS 解析是否正确</title>
		<link>https://eternalcenter-2021-12.github.io/shell-dns-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 11 Aug 2019 04:03:58 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Other Services (其他服务)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=5112</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：批量检测域名的 DNS 解析是否正确作用：批量检测域名的 DNS 解析是否正确 使用方法：1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本 脚本分割线里的变量：1. main_domain=eternalcenter.com #此处填写网站的“主域名”，网站一般会有几个域名，其中“主域名”直接指向 ip 地址，其他的域名都指向主域名2. ip=192.154.240.64 #域名指向的 ip 地址3. nginx=1.16.0 #web 程序的对应版本的版本4. content1=&#8221;eteranlcenter&#8221; # 随即填写一个具有代表性的网站首页的内容5. content2=&#8221;Mingyu&#8221; # 随即填写一个具有代表性的网站首页的内容，但是要和前面的 content1 在同一行6. domain=&#8221;eternalcenter.com eternalcentre.com zhumingyu.com mingyuzhu.com eternalcenter.org eternalcentre.org&#8221; #需要检测的域名 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：批量检测域名的 DNS 解析是否正确<br>作用：批量检测域名的 DNS 解析是否正确</p>



<p>使用方法：<br>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本</p>



<p>脚本分割线里的变量：<br>1. main_domain=eternalcenter.com #此处填写网站的“主域名”，网站一般会有几个域名，其中“主域名”直接指向 ip 地址，其他的域名都指向主域名<br>2. ip=192.154.240.64 #域名指向的 ip 地址<br>3. nginx=1.16.0 #web 程序的对应版本的版本<br>4. content1=&#8221;eteranlcenter&#8221; # 随即填写一个具有代表性的网站首页的内容<br>5. content2=&#8221;Mingyu&#8221; # 随即填写一个具有代表性的网站首页的内容，但是要和前面的 content1 在同一行<br>6. domain=&#8221;eternalcenter.com eternalcentre.com zhumingyu.com mingyuzhu.com eternalcenter.org eternalcentre.org&#8221; #需要检测的域名</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

main_domain=eternalcenter.com
ip=144.48.142.148
nginx=1.16.0
content1="eternalcenter"
content2="Mingyu"
domain="eternalcenter.com eternalcentre.com zhumingyu.com mingyuzhu.com eternalcenter.org eternalcentre.org"

####################### Separator ########################

check_domain_name(){
if &#91; $1 == $main_domain ];then
	
	ping -c4 -i0.4 $1 | grep $ip &amp;&gt; /dev/null
	if &#91; $? -ne 0 ];then
		echo -e "\033&#91;31m $1 is error !!!!! ip is error !!!!! \033&#91;0m"
	else
		curl $1 | grep $nginx &amp;&gt; /dev/null
		if &#91; $? -ne 0 ];then
			echo -e "\033&#91;31m $1 is error !!!!! software is error !!!!! \033&#91;0m"
		else	
			elinks $1 | grep "$content1" | grep "$content2" &amp;&gt; /dev/null
			if &#91; $? -ne 0 ];then
				echo -e "\033&#91;31m $1 is error !!!!! web is error !!!!! \033&#91;0m"
			else
				echo -e "\033&#91;32m $1 is ok \033&#91;0m"
			fi
		fi
		
	fi
else
	elinks $1 | grep "$content1" | grep "$content2" &amp;&gt; /dev/null
	if &#91; $? -ne 0 ];then
		echo -e "\033&#91;31m $1 is error !!!!! web is error !!!!! \033&#91;0m"
	else
		echo -e "\033&#91;32m $1 is ok \033&#91;0m"
	fi


fi
}

for i in $domain
do
	check_domain_name $i
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 检测性能指标 （例如：剩余硬盘空间、内存空间等）</title>
		<link>https://eternalcenter-2021-12.github.io/shell-performance-check/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 01 Aug 2019 07:59:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-2021-12.github.io/?p=4930</guid>

					<description><![CDATA[介绍： #名称: 检测性能指标（例如：剩余硬盘空间、内存空间等）#作用: 检测性能指标（例如：剩余硬盘空间、内存空间等） #使用方法：#1. 给此脚本添加执行权限#2. 执行此脚本 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>#名称: 检测性能指标（例如：剩余硬盘空间、内存空间等）<br>#作用: 检测性能指标（例如：剩余硬盘空间、内存空间等）</p>



<p>#使用方法：<br>#1. 给此脚本添加执行权限<br>#2. 执行此脚本</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

ip=`ip a s | awk '/noprefixroute ens33/{print $2}'`
host=`hostname`
disk=`df -h | awk '/\/$/{print $5}'`
mem=`free -m | awk '/Mem/{print $4}'`
cpu=`top -bn 1 | awk -F',' '/^%Cpu/{print $4 }' | awk '{print $1}'`
soft=`rpm -qa | wc -l`
port=`ss -ntulap | wc -l`

echo "$ip $host disk $disk"
echo "$ip $host mem $mem"
echo "$ip $host cpu $cpu"
echo "$ip $host soft $soft"
echo "$ip $host port $port"
echo</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
