分类标签归档:shell

linux 服务器监控客户端部署


# 下载地址
wget https://tool-box.oss-cn-hangzhou.aliyuncs.com/shell/monitor_client.sh
  • monitor_client.sh
#!/bin/bash

function omsa_install 
{
# install omsa (DELL 硬件监控)
  echo "#####开始安装OMSA####"
  echo "根据网络情况,此过程需要话比较长的时间"
  wget -q -O - http://linux.dell.com/repo/hardware/lates

Read more

腾讯的cli工具的安装和使用


1、安装tccli

pip3.8 install  -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com tccli

如果在线安装tencentcloud-sdk-python过程出现安装错误,可以尝试先从官网下载whl文件本地安装 https://pypi.org/project/tencentcloud-sdk-python/#files

2、配置tccli

$ tccli configure
TencentCloud API secretId [*afcQ]:AKIDwLw1234xxxxxxe2g9nR2OTI

Read more

记一次认真学习iptables(汇总)


一、通过什么方式管理你的iptables

1、通过iptables 自带的工具

# iptables 安装
yum -y install iptables
# iptables 自带  iptables 、iptables-save、iptables-restore等工具
iptables -F # 清空iptables
iptables-save > /etc/sysconfig/iptables # 将现有的iptables保存到指定文件
iptables-restore < /etc/sysconfig/iptables #将文件中的iptables还原到现有的iptable

Read more

常用shell 工具使用技巧汇总


1、用|| 来表示如果第一个命令执行不成功就执行第二个命令

# 例如 在不同操作系统下获取mac地址
cat /sys/class/net/[^vtlsb]*/address || esxcfg-vmknic -l |awk '{print $8}'|grep ':'

2、dmidecode 获取服务器相关信息

yum -y install dmidecode
dmidecode -s system-manufacturer # 获取厂商
dmidecode -s system-product-name # 服务器型号
dmidecode -s system-

Read more

OSS 对象存储工具ossutil64的安装与使用


1、下载与安装

wget http://gosspublic.alicdn.com/ossutil/1.6.10/ossutil64
chmod 755 ossutil64
./ossutil64 config
请输入配置文件名,文件名可以带路径(默认为:/home/user/.ossutilconfig,回车将使用默认路径。如果用户设置为其它路径,在使用命令时需要将--config-file选项设置为该路径): 
未输入配置文件路径,将使用默认配置文件:/home/user/.ossutilconfig。 
对于下述配置,回车将跳过相关配置项的设置,配置项的具体含义,请使用"hel

Read more

CentOS 7 系统初始化脚本(CentOS7-minimal版本的安装)


完整脚本:

#!/bin/bash
## for CentOS7-minimal版本的安装

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

yum install wget net-tools -y
systemctl enable rc-local.service
chmod +x /etc/rc.d/rc.local

## 修改yum资源库为阿里的镜像
cd /etc/yum.repos.d/
rm -f  *.repo 
wget -O /etc/yum.repos.d/CentOS-

Read more

CURL 指定后端HOST 下载文件,防止DNS轮询


最近碰到一个问题,在测试CDN缓存,每次上传更新一个同名文件,CDN后台并未做刷新缓存动作,但依旧能下载到新的文件,此时发现其实每次解析出来CDN节点都有很多个,怀疑我每次下载用的是不同的节点如下:

root@pc:~# nslookup cos.lejunwl.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
cos.lejunwl.com canonical name = cos.lejunwl.com.cdn.dnsv1.com.
cos.lejunwl.com.

Read more

curl 指定IP 下载文件


最近碰到一个问题,在测试CDN缓存,每次上传更新一个同名文件,CDN后台并未做刷新缓存动作,但依旧能下载到新的文件,此时发现其实每次解析出来CDN节点都有很多个,怀疑我每次下载用的是不同的节点如下:

root@pc:~# nslookup cos.lejunwl.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
cos.lejunwl.com canonical name = cos.lejunwl.com.cdn.dnsv1.com.
cos.lejunwl.com.

Read more