检查OS环境脚本

# cat check_env.sh

#!/bin/bash
#
echo "=== 检查CPU ==="
ansible all -m shell -a "cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c"

echo "=== 检查内存 ==="
ansible all -m shell -a "free -h | tail -2 | head -1"

echo "=== 检查磁盘 ==="
ansible all -m shell -a "lsblk |grep disk |wc -l"

echo "=== 检查OS版本 ==="
ansible all -a 'lsb_release -d'

echo "=== 检查内核版本 ==="
ansible all -a 'uname -r'

echo "=== 检查docker版本 ==="
ansible all -a 'docker -v'

echo "=== 检查ceph版本 ==="
ansible all -a 'ceph -v'

echo "=== 检查时间 ==="
ansible all -a date

echo "=== 检查python3版本 ==="
ansible all -a 'python3 -V'

# end

 

posted @ 2023-03-15 08:53  Varden  阅读(127)  评论(0编辑  收藏  举报