Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Get basic information about Linux server script     - Linux Samba server-side structures and the use of the client (Server)

- Installation of JDK and Tomcat under Linux (CentOS) (Linux)

- Redis-- persistence articles (Database)

- How to merge two pictures in Cacti (Linux)

- Python class of operator overloading (Programming)

- socket busy poll of Linux kernel 3.11 to avoid sleep switch (Linux)

- AngularJS - Getting Started with Routing (Programming)

- Linux foreground to background process switch (Linux)

- Ubuntu under shadowsocks configuration instructions (Linux)

- in no backup ex: error: Xin Tourou ah backup child process has Singles DAT / US person / bin / in no backup ex (Database)

- AppCode developed Mac OS X application or shared library experience summary (Programming)

- Android Delete project useless resource file (Programming)

- Using IntelliJ IDEA 13 integrated development environment to build Android (Linux)

- Git Getting Started tutorial (Linux)

- Spring AOP (Programming)

- STL spatial Configurator (Programming)

- Fedora && Arch Linux - the most romantic thing to happen now (Linux)

- Linux kernel netpoll framework netconsole (Linux)

- Use UDEV SCSI Rules configured ASM on Oracle Linux 5 and 6 (Database)

- HTML5 postMessage cross-domain data exchange (Programming)

 
         
  Get basic information about Linux server script
     
  Add Date : 2018-11-21      
         
       
         
 

In order to facilitate the daily operation and maintenance of a simple piece of writing scripts for obtaining centralized Linux server operating system, CPU, memory usage, load, disk usage, network information.

script is relatively simple, do not explain, friends are interested in your own view.

# / bin / bash
#
#Name:! System_info
#Ver: 1.0
#Author: lykyl
#
#
# program Description:
# obtain basic information about the server scripts
#
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]} ' `"

     
         
       
         
  More:      
 
- Ruby and Python simple comparison (Programming)
- Let the terminal under Mac OS X as like Linux has displayed a variety of colors (Linux)
- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)
- Install Oracle JDK 8 and JVM class loading mechanism in Linux (Linux)
- Linux server data backup (Server)
- Thinking in Java study notes - initialization and cleanup (Programming)
- CentOS installation Percona Server 5.5.42 compiling problem solve one case (Linux)
- C language binary tree counts words (Programming)
- Vim useful plugin: EasyGrep (Linux)
- Loop arrays in C language is not easy to find a bug (Programming)
- Use OpenSSL carried BASE64 encoding and decoding (Linux)
- DRBD Principle and Features Overview (Server)
- Oracle Migration partition table (Database)
- To create a Linux server network security (Linux)
- ActionContext and ServletActionContext Summary (Programming)
- C language macro definition #define Usage (Programming)
- Docker: installation under Ubuntu (Server)
- CentOS 7 install Hadoop-cdh-2.5 on Mesos (Server)
- Depth understanding of C language (Programming)
- MySQL server after an unexpected power outage can not start (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.