Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- JAM=`date +%H`
- MENIT=`date +%M`
- blue='\e[1;34m'
- green='\e[0;23m'
- purple='\e[1;35m'
- cyan='\e[1;36m'
- red='\e[1;31m'
- echo -e $purple
- echo -e "
- _ _____ ______ _ _ _ _ ______ ______
- | | (_____) ___ \| | | \ \ / / | ___ \ /\ | ___ \
- | | _ | | | | | | |\ \/ / | | _ | | / \ | | | |
- | | | | | | | | | | | ) ( | || || |/ /\ \| | | |
- | |_____ _| |_| | | | |___| |/ /\ \ | || || | |__| | | | |
- |_______|_____)_| |_|\______/_/ \_\ |_||_||_|______|_| |_|
- \n\n";
- echo -e $red
- echo -e "Sekarang jam" $JAM:$MENIT
- echo "++ Perangkat keras "
- CPU=`grep "model name" /proc/cpuinfo | head -n 1 | cut -f 2 -d ':'`
- RAM=`grep "MemTotal" /proc/meminfo | cut -f 2 -d ':'`
- echo " |- CPU : " $CPU
- echo " |- RAM : " $RAM
- echo "++ Sistem Operasi "
- # informasi sistem operasi
- OS=`uname -sr`
- echo " |- OS : " $OS
- echo " |- Shell : " $SHELL --version
- echo -n "Waktu system :"; date
- echo -n "Distro Info :"; lsb_release -a
- echo -n "Anda :"; whoami
- echo -n "Banyak pemakai :"; who | wc -l
- echo -e $blue
- # clear the screen
- clear
- while getopts iv name
- do
- case $name in
- i)iopt=1;;
- v)vopt=1;;
- *)echo "Invalid arg";;
- esac
- done
- echo "Hai! Hello World"
- echo "Check_system_server by PujiErmanto@Hipster_Network"
- if [[ $# -eq 0 ]]
- then
- {
- # Cek Apakah Koneksi Internet Mati atau Tidak
- ping -c 1 google.com &> /dev/null && echo -e '\E[32m'"Internet: Connected" || echo -e '\E[32m'"Internet: Disconnected"
- # cek type OS
- os=$(uname -o)
- echo -e '\E[32m'"Operating System Type :" $os
- # Cek Nama Release Version
- cat /etc/os-release | grep 'NAME\|VERSION' | grep -v 'VERSION_ID' | grep -v 'PRETTY_NAME' > /tmp/osrelease
- echo -n -e '\E[32m'"OS Name :" && cat /tmp/osrelease | grep -v "VERSION" | cut -f2 -d\"
- echo -n -e '\E[32m'"OS Version :" && cat /tmp/osrelease | grep -v "NAME" | cut -f2 -d\"
- # Cek Architecture
- architecture=$(uname -m)
- echo -e '\E[32m'"Architecture :" $architecture
- # Cek Kernel Release
- kernelrelease=$(uname -r)
- echo -e '\E[32m'"Kernel Release :" $kernelrelease
- # Cek hostname
- echo -e '\E[32m'"Hostname :" $HOSTNAME
- # Cek Internal IP
- internalip=$(hostname -I)
- echo -e '\E[32m'"Internal IP :" $internalip
- # Cek DNS
- nameservers=$(cat /etc/resolv.conf | sed '1 d' | awk '{print $2}')
- echo -e '\E[32m'"Name Servers :" $nameservers
- # Cek Logged In Users
- who>/tmp/who
- echo -e '\E[32m'"Logged In users :" && cat /tmp/who
- # Cek RAM and SWAP Usages
- free -h | grep -v + > /tmp/ramcache
- echo -e '\E[32m'"Ram Usages :"
- cat /tmp/ramcache | grep -v "Swap"
- echo -e '\E[32m'"Swap Usages :"
- cat /tmp/ramcache | grep -v "Mem"
- # Cek Disk Usages
- df -h| grep 'Filesystem\|/dev/sda*' > /tmp/diskusage
- echo -e '\E[32m'"Disk Usages :"
- cat /tmp/diskusage
- # Cek Load Average
- loadaverage=$(top -n 1 -b | grep "load average:" | awk '{print $10 $11 $12}')
- echo -e '\E[32m'"Load Average :" $loadaverage
- # Cek System Uptime
- tecuptime=$(uptime | awk '{print $3,$4}' | cut -f1 -d,)
- echo -e '\E[32m'"System Uptime Days/(HH:MM) :" $tecuptime
- # Remove Temporary Files
- rm /tmp/osrelease /tmp/who /tmp/ramcache /tmp/diskusage
- }
- fi
- shift $(($OPTIND -1))
- echo -n "Proxy-Server : "; squid -v
- while true; do
- read -p "lanjut monitoring server ?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "jawab yes atau no";;
- esac
- done
- tail -f /var/log/squid/access.log | ccze
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement