-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path10-sysinfo
33 lines (32 loc) · 1.5 KB
/
10-sysinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# 10-sysinfo - generate the system information
# Copyright (c) 2013 Nick Charlton
#
# Authors: Nick Charlton <hello@nickcharlton.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
load=`cat /proc/loadavg | awk '{print $1}'`
root_usage=`df -h / | awk '/\// {print $(NF-1)}'`
memory_usage=`free -m | awk '/Mem:/ { printf("%3.1f%%", $3/$2*100) }'`
swap_usage=`free -m | awk '/Swap:/ { printf("%3.1f%%", $3/$2*100) }'`
users=`users | wc -w`
processes=`ps aux | wc -l`
printf "*** System info as of `date +"%A, %e %B %Y, %r"` ***\n"
printf "System Load:\t%s\tMemory Usage:\t%s\tProcesses:\t%s\n" $load $memory_usage $processes
printf "Usage On /:\t%s\tSwap Usage:\t%s\tLocal Users:\t%s\n" $root_usage $swap_usage $users
/usr/lib/update-notifier/update-motd-reboot-required
/usr/lib/update-notifier/apt-check --human-readable
#