-
Notifications
You must be signed in to change notification settings - Fork 9
/
monitor.sh
executable file
·24 lines (23 loc) · 998 Bytes
/
monitor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash
########################################################
# Author : Fouad JADOUANI <fouad.j [at] live [dot] fr>
# Usage : ./monitor.sh
# Description : script allow to have some esesntial information about OS
# Created : 11/09/2016
# Version : 1.0
# License : MIT
###############
echo "OS Type:" $(uname -o)
echo "OS Name:" $(cat /etc/os-release | grep ^VERSION= | cut -f2 -d\")
echo "OS Version:" $(cat /etc/os-release | grep ^NAME= | cut -f2 -d\")
echo "Architecture:" $(uname -m)
echo "Kernel Release:" $(uname -r)
echo "Load Average: $(cat /proc/loadavg | cut -f 1-3 -d ' ')"
echo "System Uptime:" $(uptime -p | cut -f 2- -d " ")
echo "Hostname:" $HOSTNAME
echo "Internal IP:" $(hostname -I)
echo "External IP:" $(wget http://ipinfo.io/ip -qO -)
echo "Name Servers:" $(cat /etc/resolv.conf | grep 'nameserver' | awk '{print $2}')
echo -e "Logged In users:\n$(who)"
echo -e "Memory Usages(Mo):\n$(free -m | grep -v +)"
echo -e "Disk Usages:\n$(df -h| grep 'Filesystem\|^/dev/*')"