#!/bin/sh
clear
if [[ $# -eq 0 ]]
then
#Define Variable Reset_terminal
Reset_terminal=$(tput sgr0)
#Check OS Type
OS=$(uname -o)
echo -e '\E[36m' "Operating System Type :" $Reset_terminal $OS
#Check OS Realease Version And Name
OS_name=$(cat /etc/issue | grep "Server")
echo -e '\E[36m' "Operating System Realease Version :" $Reset_terminal $OS_name
#Check Architecture
Architecture=$(uname -m)
echo -e '\E[36m' "Operating System Architecture :" $Reset_terminal $Architecture
#Check Kernel Realease
Kernel_Realease=$(uname -r)
echo -e '\E[36m' "Operating System Kernel Realease :" $Reset_terminal $Kernel_Realease
#Check Hostname
Hostname=$(hostname)
echo -e '\E[36m' "Operating System Hostname :" $Reset_terminal $Hostname
#Check Internal IP
Internal_IP=$(hostname -I)
echo -e '\E[36m' "Operating System Internal IP :" $Reset_terminal $Internal_IP
#Check External IP
External_IP=$(curl -s http://ipecho.net/plain)
echo -e '\E[36m' "Operating System External IP :" $Reset_terminal $External_IP
#Check DNS
# DNS=$(cat /etc/resolv.conf | grep "/<nameserver[ ]+"|awk '{print $NF}')
# echo -e '\E[36m' "Operating System DNS :" $Reset_terminal $DNS
#Check if connected To Internet Or Not
# ping -c2 www.baidu.com &>/dev/null && echo -e '\E[36m' "Internet : Connected" || echo '\E[36m' "Internet : Failed"
#Check Logged In Users
who > /tmp/who
echo -e '\E[36m' "Operating System Lgged In Users :" $Reset_terminal && cat /tmp/who
rm -f /tmp/who
#Check OS Memory Userages
echo -e '\E[36m' "Operating System Memory Userages :" $Reset_terminal $(cat /proc/meminfo | awk '/^MemTotal/{MemTotal=$2}/^MemFree/{MemFree=$2}END {print (MemTotal-MemFree)/1024,"M"}')
#Check App Memory Userages
echo -e '\E[36m' "App Memory Userages :" $Reset_terminal $(cat /proc/meminfo | awk '/^MemTotal/{MemTotal=$2}/^MemFree/{MemFree=$2}/^Buffers/{Buffers=$2}/^Cached/{Cached=$2}END {print (MemTotal-MemFree-Buffers-Cached)/1024,"M"}')
#Check OS Loadaverage
echo -e '\E[36m' "Operating System Loadaverage :" $Reset_terminal $(top -n1b | grep "load average" | awk '{print $(NF-2) $(NF-1) $NF}')
#Check CPU Userages
echo -e '\E[36m' "Operating System CPU Userages(us,sy,id):" $Reset_terminal $(top -b -n 1 | grep Cpu | awk -F ' ' '{print $2,$3,$5}')
#Check OS Diskaverage
echo -e '\E[36m' "Operating System Diskaverage :" $Reset_terminal $(df -hP | grep -vE "%%|tmpfs" | awk '{print $1,$5}')
#Check OS Runtime
echo -e '\E[36m' "Operating System Runtime :" $Reset_terminal $(top -n1b | grep "load average" | awk -F"[ ,]+" '{print $5}')
fi

linux系统参数统计脚本的更多相关文章

  1. 使用php作linux自动执行脚本

    使用php作linux自动执行脚本 [来源] 达内    [编辑] 达内   [时间]2013-03-21 在作社区时, 时常需要统计上线人数等数据. 一般做法是, 把这段代码放在用户 login或者 ...

  2. Linux Shell 小脚本经典收藏

    原文:http://www.cnblogs.com/Javame/p/3867686.html 1.在两个文件中找出相同的号码 diff -y xx.txt oo.txt | egrep -v &qu ...

  3. (转)如何在Linux中统计一个进程的线程数

    如何在Linux中统计一个进程的线程数 原文:http://os.51cto.com/art/201509/491728.htm 我正在运行一个程序,它在运行时会派生出多个线程.我想知道程序在运行时会 ...

  4. Linux简单Shell脚本监控MySQL、Apache Web和磁盘空间

    Linux简单Shell脚本监控MySQL.Apache Web和磁盘空间 1. 目的或任务 当MySQL数据库.Apache Web服务器停止运行时,重新启动运行,并发送邮件通知: 当服务器磁盘的空 ...

  5. Linux使用shell脚本监控

    (1)性能监控脚本 performance.sh #!/bin/bash #-------------------------------------------------------------- ...

  6. 使用C#给Linux写Shell脚本

    在这个逼格决定人格,鄙视链盛行的年头,尤其是咱们IT界,请问您今天鄙视与被鄙视的次数分别是多少?如果手中没有一点压箱的本事,那就只有看的份了.今天我们也要提升下自己的格调,学习些脑洞大开的东西,学完之 ...

  7. 详解Linux交互式shell脚本中创建对话框实例教程_linux服务器

    本教程我们通过实现来讲讲Linux交互式shell脚本中创建各种各样对话框,对话框在Linux中可以友好的提示操作者,感兴趣的朋友可以参考学习一下. 当你在终端环境下安装新的软件时,你可以经常看到信息 ...

  8. 使用C#给Linux写Shell脚本(下篇)

    在上篇的<使用C#给Linux写Shell脚本>结尾中,我们留下了一个关于C#如何调用BashShell的问题.在文章发布之后,我留意到有读者留言推荐使用“Pash”(一款类PowerSh ...

  9. linux下shell脚本执行jar文件

    最近在搞一个shell脚本启动jar文件个关闭jar文件的东东.搞得我都蛋疼了.今天晚上终于弄好了 话说,小弟的linux只是刚入门,经过各方查资料终于搞定了.话不多说,下面开始上小弟写的shell脚 ...

随机推荐

  1. Ubuntu16.04安装和卸载MySQL 5.7

    介绍: MySQL 是一种开源数据库管理系统,通常作为流行的LAMP(Linux,Apache,MySQL,PHP / Python / Perl)堆栈的一部分安装.它使用关系数据库和SQL(结构化查 ...

  2. jvm学习(重点)

    http://blog.csdn.net/yfqnihao/article/details/8271665 http://blog.csdn.net/cutesource/article/detail ...

  3. Python3.x:抢票

    Python3.x:抢票 一个妹子叫我帮她买动车票,结果竟然没买到票:好吧,不好意思说买不到票,写个抢票程序来完成吧: 1,Chromediver安装: 因为需要chrome支持页面测试,所以需要安装 ...

  4. wix toolset将 cab 打包进msi

    在***wxs中添加配置 <MediaTemplate EmbedCab="yes" /> 下面是一个简单配置:(包含写注册表) <?xml version=&q ...

  5. PHP 根据IP地址获取所在城市

    header('Content-Type:text/html;Charset=utf-8'); function GetIp(){ $realip = ''; $unknown = 'unknown' ...

  6. 爬虫之动态HTML处理(Selenium与PhantomJS )网站模拟登录

    #coding=utf-8from selenium import webdriverfrom selenium.webdriver.common.keys import Keysimport tim ...

  7. LeetCode——Find Largest Value in Each Tree Row

    Question You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 ...

  8. python 使用set对list去重,并保持list原来顺序

    list_one=re.findall(r"^\s{0}[A-Za-z]*\b", txt,re.M) #匹配一级目录 addr_to = list(set(list_one))a ...

  9. WPF圆角透明无边框窗体

    <Window x:Class="ImportData.MainWindow" xmlns="http://schemas.microsoft.com/winfx/ ...

  10. ThinkPHP开发笔记-控制器

    1.下面就是一个典型的控制器类的定义: <?php namespace Home\Controller; use Think\Controller; class IndexController ...