You are not logged in.

#1 2006-12-29 01:04:44

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Simple System Monitor

OLD MSG, UPDATED WITH NEW LINKS:
Hello everyone smile 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 smile

Last edited by timtux (2007-08-14 01:03:46)


http://timtux.net/ - my personal blog about almost everything

Offline

#2 2006-12-30 00:49:40

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: Simple System Monitor

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

#3 2006-12-30 01:11:15

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: Simple System Monitor

SSM = Coded in bash, not as resource taking, no problems with xcompmgr, no icons flickering smile

Conky = To heavy and to many options smile


http://timtux.net/ - my personal blog about almost everything

Offline

#4 2006-12-30 01:35:55

kensai
Member
From: Puerto Rico
Registered: 2005-06-03
Posts: 2,484
Website

Re: Simple System Monitor

This looks interesting, will try to try it big_smile.


Follow me in: Identi.ca, Twitter, Google+

Offline

#5 2007-02-02 23:44:08

ambalex
Member
Registered: 2004-11-17
Posts: 87

Re: Simple System Monitor

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

#6 2007-02-03 11:02:20

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: Simple System Monitor

ambalex wrote:

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?

here: http://timtux.web.surftown.se/timtux/in … =code&id=3

Offline

#7 2007-02-03 23:15:04

ambalex
Member
Registered: 2004-11-17
Posts: 87

Re: Simple System Monitor

thanx!

Offline

#8 2007-05-02 02:05:14

F
Member
Registered: 2006-10-09
Posts: 322

Re: Simple System Monitor

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

#9 2007-05-07 01:48:02

mlweber
Member
Registered: 2007-05-06
Posts: 6

Re: Simple System Monitor

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

#10 2007-08-14 00:53:55

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: Simple System Monitor

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

#11 2007-08-17 18:55:58

Zoranthus
Member
From: muc
Registered: 2006-11-22
Posts: 166

Re: Simple System Monitor

Very nice.

Offline

Board footer

Powered by FluxBB