惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - lykyl的自留地

树莓派编译安装opencv3 (2019.1.6更新) centos6 安装EPEL "检索COM类工厂中 CLSID为 {00024500-0000-0000-C000-000000000046}的组件时失败,原因是出现以下错误: 80070005" 问题的解决 centos6.x 安装pylucene (20161027改) - lykyl的自留地 趣味python编程之经典俄罗斯方块 python编码规范 改进uwsgi启动脚本,使其支持多个独立配置文件 在CentOS 6.5上安装python2.7 "System.Security.Cryptography.CryptographicException: 拒绝访问" 问题的解决方法 利用SHELL脚本实现文件完整性检测程序(1.2版更新) DELPHI实现关闭指定进程,自身防杀 基于python编写的天气抓取程序 linux使用心得(持续更新) vim使用心得(持续更新) NFS服务基本配置及使用 利用shell脚本实现计划任务功能 V1.2 利用shell脚本实现计划任务功能 rsync简明手册 linux bash script简明手册(持续更新)
获取linux服务器基本信息脚本
lykyl的自留地 · 2013-12-12 · via 博客园 - lykyl的自留地

为了方便日常运维写的一段简单脚本,用于集中获取服务器操作系统、CPU、内存使用、负载、硬盘使用、网络信息。

脚本比较简单,就不解释了,有兴趣的朋友请自行查看。

#!/bin/bash
#
#Name:system_info
#Ver:1.0
#Author:lykyl
#
#
#程序说明:
#获取服务器基本信息脚本
#
echo '[OS Info]'
echo 'Host Name: '`uname -n`
echo 'OS: '`cat /etc/redhat-release`
echo 'Kernel: '`uname -r`
echo
echo '[CPU Info]'
echo 'CPU: physical '`grep "physical id" /proc/cpuinfo |uniq |wc -l`' cores'`grep "cpu cores" /proc/cpuinfo |uniq`
echo
echo '[System Info]'
echo `uptime | sed 's/^.*load/load/g'`
echo "Zombie:`ps aux |awk '{print $8,$2,$11}'|sed -n '/^Z/p'|wc -l`"
echo
echo '[Memory Info]'
echo `free -m |grep Mem|awk '{ print "total:"$2 "MB used:"$3 "MB free:"$4 "MB shared:"$5 "MB buffers:"$6 "MB cached:"$7 "MB" }'`
echo
echo '[Disk Info]'
echo -e "`df -h|sed '1d'|awk '/%/ { if ($6=="") {printf "%s\ttotal:%s\tused:%s\tUse%:%s\n",$5,$1,$2,$4 } else {printf "%s\ttotal:%s\tused:%s\tUse%:%s\n",$6,$2,$3,$5 } }'`"
echo
echo '[Net Info]'
echo 'IP: '`ifconfig |grep "inet addr:" |grep -v "127.0.0.1"|awk '{ print $2 }'|awk -F: '{print $2}'`
echo "netstat: `netstat -an|awk '/^tcp/ { ++s[$NF] } BEGIN {ORS=" "} END {for(a in s) print a,s[a]}'`"