-
top -n 1 -b | grep load average查看全部
-
sages查看全部
-
55555查看全部
-
脚本优化查看全部
-
最后烦烦烦查看全部
-
烦烦烦发查看全部
-
威威威威查看全部
-
DNS查看全部
-
反反复复查看全部
-
磁盘信息查看全部
-
#!/bin/bash #系统磁盘分析脚本 clear if [[ $# -eq 0 ]] then #Define Variable reset terminal reset_terminal=$(tput sgr0) diskaveage=$(df -hP grep -vE 'Filesystem tmpfs' awk '{print $1 " " $5}') echo -e '\E[32m'"Operating System Disk Averages :" $reset_terminal $diskaveage fi查看全部
-
#!/bin/bash #系统负载分析脚本 clear if [[ $# -eq 0 ]] then #Define Variable reset terminal reset_terminal=$(tput sgr0) loadaverage=$(top -n 1 -b grep "load average:" awk '{print $10 $11 $12}') echo -e '\E[32m'"Operating System Load Averages :" $reset_terminal $loadaverage fi查看全部
-
#!/bin/bash #系统内存分析脚本 clear if [[ $# -eq 0 ]] then #Define Variable reset terminal reset_terminal=$(tput sgr0) system_mem_usages=$(awk '/MemTotal/{total=$2}/MemFree/{free=$2}END{print (total-free)/1024}' /proc/meminfo) app_mem_usages=$(awk '/MemTotal/{total=$2}/MemFree/{free=$2}/^Cached/{cached=$2}/Buffers/{buffers=$2}END{print (total-free-cached-buffers)/1024}' /proc/meminfo) echo -e '\E[32m'"Operating System Memuserages :" $reset_terminal $system_mem_usages echo -e '\E[32m'"Operating System App Memuserages :" $reset_terminal $app_mem_usages fi查看全部
-
shell典型应用之系统信息及运行状态获取 脚本:system_monitor.sh 功能:提取操作系统信息(内核、系统版本、网络地址等),分析系统的运行状态(cpu负载、内存及磁盘使用率等) 1.脚本内容: #!/bin/bash clear if [[ $# -eq 0 ]] #判断位置参数的个数是否为0 then reset_terminal=$(tput sgr0) #设置变量,每次调用它都会使屏幕的输出恢复正常 #Check OS Type os=$(uname -o) echo -e '\E[36m'"Operating System Type: " $reset_terminal $os #Check OS Release Version and Name os_name=$(cat /etc/issue) echo -e '\E[36m'"Check OS Release Version and Name: " $reset_terminal $os_name #Check Architecture architecture=$(uname -m) echo -e '\E[36m'"Check Architecture: " $reset_terminal $architecture #Check Kernel Release kernerrelease=$(uname -r) echo -e '\E[36m'"Check Kernel Release: " $reset_terminal $kernerrelease #Check Hostname hostname=$(uname -n) echo -e '\E[36m'"Check Hostname: " $reset_terminal $hostname #或者 echo $(HOSTNAME)查看全部
举报
0/150
提交
取消