Shell script to display general FreeBSD and Linux System information such as, Hostname, OS version, Kernel version, Processor/CPU, Total RAM, System load, network interface, total logged in users, Hard disks, Runlevel etc in neat format.
How do I use the script?
You need to download following two files for FreeBSD operating systems:
- File # 1 Save this file as /usr/local/etc/bashmonscripts
- File # 2 : Save this file as /usr/local/etc/defaults.conf
For Linux system, you need to update /usr/local/etc/defaults.conf to point out exact binary path location. /usr/local/etc/bashmonscripts is nothing but functions library used by this script. bashmonscripts works under both Linux and FreeBSD.
#!/bin/bash # Shell script to General FreeBSD and Linux System information such as: # Hostname, OS version, Kernel version, Processor/CPU, Total RAM, # System load, network interface, total logged in users, Hard disks, # Runlevel etc. I will write separate scripts for detailed system # information :D # Copyright (c) 2005 nixCraft project # This script is licensed under GNU GPL version 2.0 or above # For more info, please visit: # http://cyberciti.biz/shell_scripting/bmsinstall.php # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- SPATH="/usr/local/etc/bashmonscripts" INITBMS="$SPATH/defaults.conf" [ ! -f $INITBMS ] && exit 1 || . $INITBMS echo "Hostname:" $(getHostName) echo "OS Name:" $($UNAME) echo "OS Version:" $($UNAME -mr) echo "Processor:" $(getCpuInfo) echo "Total Physical Memory (RAM):" $(getRealRamInfo) echo "System Load:" $(getSystemLoad) echo "Date & Time:" $($DATE) echo "Network interface:" $(getNumberOfInterfaces) echo "Total logged in users:" $(getNumberOfLoggedInUsers) echo "Total running process:" $(getNumberOfRunningProcess) echo "Total SCSI/IDE disks:" $(getDiskDrives) echo "Mounted partitions:" $(getNumberOfParittions) echo "Loaded dynamic kernel modules/drivers:" $(getNumberOfKernelModules) echo "OS Rulevel:" $(getOsRunLevel)
Click here to subscribe via email.
- Download Script
- Email this to a friend
- Rss Feed
- Last Updated: 02/26/09






