操作系统巡检脚本简介

1、OS巡检脚本运行方式

操作系统信息的收集是perl脚本,运行方式如下所示。

[root@OCPLHR lhr]# ll
total 28
-rw-r--r-- 1 oracle oinstall 25791 Jul 10 17:15 DB_OS_HC_lhr_v7.0.0.pl
[root@OCPLHR lhr]# perl DB_OS_HC_lhr_v7.0.0.pl 
[root@OCPLHR lhr]# ll
total 56
-rw-r--r-- 1 oracle oinstall 25791 Jul 10 17:15 DB_OS_HC_lhr_v7.0.0.pl
-rw-r--r-- 1 root   root     26289 Jul 10 17:19 LHR_OSCHECK_REPORT_OCPLHR_20190710171939.html
[root@OCPLHR lhr]# 
[root@OCPLHR lhr]# sh DB_OS_HC_lhr_v7.0.0.sh 
检查结果:./HostDailyCheck--20220825.txt

若运行报如下的错误:

[root@ecs-9b83 ~]# sh DB_OS_HC_lhr_v7.0.0.sh
DB_OS_HC_lhr_v7.0.0.sh: line 9: $'\r': command not found
: No such file or directorye 13: /etc/profile
[root@ecs-9b83 ~]# chmod +x DB_OS_HC_lhr_v7.0.0.sh
[root@ecs-9b83 ~]# ./DB_OS_HC_lhr_v7.0.0.sh       
-bash: ./DB_OS_HC_lhr_v7.0.0.sh: /bin/bash^M: bad interpreter: No such file or directory

则需要使用dos2unix进行格式化:

[root@ecs-9b83 ~]# dos2unix DB_OS_HC_lhr_v7.0.0.sh
dos2unix: converting file DB_OS_HC_lhr_v7.0.0.sh to Unix format ...
[root@ecs-9b83 ~]# ./DB_OS_HC_lhr_v7.0.0.sh 
检查结果:./HostDailyCheck--20220825.txt

2、html巡检结果

这里只列出部分结果,完整示例请参考: 操作系统巡检结果示例

其它的详细内容可以参考:https://share.weiyun.com/FQY9zcm0

其它不再列举。

3、所有数据库类型巡检

请参考:https://www.dbaup.com/shujukuxunjianjiaoben.html

Copyright © 小麦苗 2024 修订时间: 2024-09-11 17:18:11

results matching ""

    No results matching ""