linux inspection script

Applicable operating system:

Redhat 6、7

Cents 6、7

Applicable scene

Check the basic health and load of the operating system

How to use

Server can access external network

(Light bulb is on)Run curl   www.baidu.com to   see if you can return to Baidu 's results

  • The root user logs in to the server that needs to check the health status(caveat)

[root@puppetagent ~]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

  • Choose a suitable directory to download and execute the health check script

cd /tmp

curl https://zhihui-file-server.oss-cn-hangzhou.aliyuncs.com/script/linuxhealthcheck/healthcheck.sh|sh   

The above command will directly generate the health check result name in the current directory as health-{ {hostname}}-200929-1126.txt (caveat)

  • View health check results

Use more, cat, less and other text viewing commands to view the health check results

Server has no external network

  • Download the health check script

Execute on a server with external network

https://zhihui-file-server.oss-cn-hangzhou.aliyuncs.com/script/linuxhealthcheck/healthcheck.sh

  • Upload the downloaded h ealthcheck.sh file to the /tmp directory of the server to be checked
  • Use ftp, scp and other tools to upload to the /tmp directory of the server, or directly open the file h ealthcheck.sh and paste the content into the h ealthcheck.sh file created on the server
  • The root user logs in to the server that needs to check the health status(caveat)

[root@puppetagent ~]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

  • Choose a suitable directory to download and execute the health check script

sh /tmp/ h ealthcheck.sh   or chmod 775 /tmp/ h ealthcheck.sh  &&sh /tmp/healthcheck.sh

  • View health check results

Use more, cat, less and other text viewing commands to view the health check results

Guess you like

Origin blog.csdn.net/VoiceRoom/article/details/108870029