You are not logged in.
Pages: 1
OLD MSG, UPDATED WITH NEW LINKS:
Hello everyone I have made an little system monitor:
Screenshot: http://timtux.net/tmp/screenie.png
Code : http://scripts.timtux.net/#ssm.sh
Enjoy, and thanks to everyone in #archlinux who helped me
Last edited by timtux (2007-08-14 01:03:46)
http://timtux.net/ - my personal blog about almost everything
Offline
Out of curiosity, would you mind listing some of the key differences between "ssm" and conky. I've always found conky to be something of a cpu hog (relatively speaking). Really, I'm mostly curious to know what you didn't like about conky and what you did to change those things in ssm.
Thanks.
Hi. I'm a sig. What are you?
Offline
SSM = Coded in bash, not as resource taking, no problems with xcompmgr, no icons flickering
Conky = To heavy and to many options
http://timtux.net/ - my personal blog about almost everything
Offline
hi!
i found this post a while ago, looked at the code and found it interesting... but i cannot find it now. could you post it again?
Offline
hi!
i found this post a while ago, looked at the code and found it interesting... but i cannot find it now. could you post it again?
Offline
thanx!
Offline
I ported this script (ssm.sh) to perl because I was bored. Have fun:
#!/usr/bin/perl -w
#
# pSSM - Perl's Simple System Monitor v0.1
# A simple system monitor rewritten from
# Tim Jansson's shell script.
# Ported to Perl by F.
#
print "--------------\n";
# --- General ---
print "dist.........: "; $dist = qx/cat \/etc\/*-release/;
print "$dist";
print "hostname.....: "; $host = qx/hostname/;
print "$host";
print "kernel.......: "; $kern = qx/uname -sr/;
print "$kern";
print "--------------\n";
# --- Memory ---
$memory = qx/free -m/;
if($memory =~ /Mem:\s+(\d+)\s+(\d+)\s+(\d+)/) {
print "total memory.: $1 MB\n";
print "used memory..: $2 MB\n";
print "free memory..: $3 MB\n";
}
print "--------------\n";
# --- Uptime ---
$uptime = qx/uptime/;
if($uptime =~ /up\s+(\d+):(\d+),\s+(\d+)\s+/) {
print "uptime.......: $1:$2 hours\n";
print "users........: $3\n";
} elsif($uptime =~ /up\s+(\d+)\s+min,\s+(\d+)/) {
print "uptime........: $1 minutes\n";
print "users.........: $2\n";
}
print "--------------\n";
# --- CPU ---
$cpuinfo = qx/cat \/proc\/cpuinfo/;
if($cpuinfo =~ /model\ name\s+:\s+(.*)/) {
print "model........: $1\n";
}
if($cpuinfo =~ /MHz\s+:\s+(\d+)/) {
print "MHz..........: $1\n";
}
$procinfo = qx/ps aux \|wc -l/;
print "processes....: $procinfo";
if($uptime =~ /average:\s+(\d+).(\d+),\s+(\d+).(\d+),\s+(\d+).(\d+)/) {
print "load average.: $1.$2, $3.$4, $5.$6\n";
}
print "--------------\n";
# --- Diskspace ---
$diskinfo = qx/df -h/;
print $diskinfo; # this information can't get any clearer
Offline
Nice. I really don't know anything about perl, but how can you make the memory line not count cached memory?
eg- your script says "total memory.: 494 MB used memory..: 485 MB free memory..: 9 MB", but free says "Mem: 506636 496472 10164 0 0 179780" and I want 496472-179780? Know what I mean?
Offline
Just updated it, if someone is still interested
you will be able to find the current version at:
http://scripts.timtux.net/#ssm.sh
Screenshot:
http://timtux.net/tmp/screenie.png
#!/bin/sh
####################################################
# SSM - Simple System Monitor v0.4 #
# A simple system monitor primarily made for myself.#
# Now enchanted with some colors #
# #
# USE: ./ssm #
# (C)Copyleft Tim Jansson #
# #
# Todo: iowait #
####################################################
# COLOR SETTINGS :)
RESTORE='\033[0m'
COLOR1='\E[32;40m'
COLOR2='\E[36;40m'
while true
do
# --- General ---
HNAME=`hostname`
KERNL=`uname -sr`
TRACK=`mpc |head -n1`
WHOAM=`whoami`
# --- Memory ---
MEMTOT=`free -m | grep Mem: | awk '{ print $2 }'`
MEMUSE=`free -m | grep buffers/cache: | awk '{ print $3 }'`
SWATOT=`free -m | grep Swap: | awk '{ print $2 }'`
SWAUSE=`free -m | grep Swap: | awk '{ print $3 }'`
# --- Uptime ---
UDAY=`uptime |awk '{ print $3 }'`
UHOU=`uptime|awk -F, '{print $2}'`
# --- CPU ---
MODEL=`cat /proc/cpuinfo |grep "model name" | cut -d' ' -f3-`
CPMHZ=`cat /proc/cpuinfo |grep "cpu MHz" | cut -d' ' -f3-`
PROCS=`ps axu |wc -l`
LOADA=`uptime |sed 's/.*://'`
ATEMP=`cat /proc/acpi/thermal_zone/THRM/temperature |awk '{ print $2 }'`"c"
# --- DISKSPACE ---
DISK1=`df -h |grep /dev/ |head -n1 |awk '{ print $1 }'`
DISK2=`df -h |grep /dev/ |head -n1 |awk '{ print $2 }'`
DISK3=`df -h |grep /dev/ |head -n1 |awk '{ print $3 }'`
DISK4=`df -h |grep /dev/ |head -n1 |awk '{ print $4 }'`
DISK5=`df -h |grep /dev/ |head -n1 |awk '{ print $5 }'`
DISK6=`df -h |grep /dev/ |head -n1 |awk '{ print $6 }'`
clear
echo -e "\
Simple System Monitor v0.4
+ General:
$COLOR1|---------------------------------------- $RESTORE
$COLOR1|$RESTORE Hostname....:$COLOR2 $HNAME $RESTORE
$COLOR1|$RESTORE Kernel......:$COLOR2 $KERNL $RESTORE
$COLOR1|$RESTORE Uptime......:$COLOR2 $UDAY days and$UHOU hours $RESTORE
$COLOR1|$RESTORE Track.......:$COLOR2 $TRACK $RESTORE
$COLOR1|$RESTORE User........:$COLOR2 $WHOAM $RESTORE
+ Memory Info:
$COLOR1|---------------------------------------- $RESTORE
$COLOR1|$RESTORE Used memory.:$COLOR2 $MEMUSE mb / $MEMTOT mb $RESTORE
$COLOR1|$RESTORE Used swap...:$COLOR2 $SWAUSE mb / $SWATOT mb $RESTORE
+ CPU Info:
$COLOR1|---------------------------------------- $RESTORE
$COLOR1|$RESTORE Clock Freq..:$COLOR2 $CPMHZ $RESTORE
$COLOR1|$RESTORE Processes...:$COLOR2 $PROCS $RESTORE
$COLOR1|$RESTORE Load Average:$COLOR2$LOADA $RESTORE
$COLOR1|$RESTORE Temperature.:$COLOR2 $ATEMP $RESTORE
+ Disk Info - $DISK1:
$COLOR1|---------------------------------------- $RESTORE
$COLOR1|$RESTORE Filesystem..:$COLOR2 $DISK1 $RESTORE
$COLOR1|$RESTORE Size........:$COLOR2 $DISK2 $RESTORE
$COLOR1|$RESTORE Used........:$COLOR2 $DISK3 \($DISK5\) $RESTORE
$COLOR1|$RESTORE Available...:$COLOR2 $DISK4 $RESTORE
$COLOR1|$RESTORE Mounted on..:$COLOR2 $DISK6 $RESTORE
"
sleep 10
done
exit 0
http://timtux.net/ - my personal blog about almost everything
Offline
Very nice.
Offline
Pages: 1