» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with monitor + Unix

Monitor cpu abusers with this simple script

In preparation from a few upcoming articles I created a script called monitorCpuUsage.sh. It is meant to be called from crontab and to inform you of processes or users who maybe using excessive amounts of cpu.

Here is the help screen:

# ./monitorCpuUsage.sh -h
Usage: monitorCpuUsage.sh
-u starting uid, must be an integer greater than or equal to 0 (only used with "-w users")
-m max cpu, must be an integer greater than or equal to 0 and less than 100
-w what to watch, must be "users" or "procs"
-e must contain an email address
-d specifies debug mode in which -e, -m, and -u do not need to be specified.

Here the script in use. I used the -d option which means the script sets the “maximum cpu allowed to -1″ and prints to the screen rather than emailing.


# ./monitorCpuUsage.sh -w users -d -u 100
Mon Oct 15 03:15:54 EDT 2007
User brock is using 0% cpu.
User nfsnobody is using 0% cpu.
User USER is using 0% cpu.

Watching processes…again with -d specified.

# ./monitorCpuUsage.sh -w procs -d
Mon Oct 15 03:17:20 EDT 2007
Process aio/0 is using 0% cpu.
Process atd is using 0% cpu.
Process bash is using 0% cpu.
Process crond is using 0% cpu.
Process dhclient is using 0% cpu.
Process events/0 is using 0% cpu.
Process httpd is using 0% cpu.
Process init is using 0% cpu.
Process java is using 0% cpu.
Process jfsCommit is using 0% cpu.
Process jfsIO is using 0% cpu.
Process jfsSync is using 0% cpu.
Process kblockd/0 is using 0% cpu.
Process kcryptd/0 is using 0% cpu.
Process khelper is using 0% cpu.
Process kjournald is using 0% cpu.
Process klogd is using 0% cpu.
Process ksnapd is using 0% cpu.
Process ksoftirqd/0 is using 0% cpu.
Process kswapd0 is using 0% cpu.
Process kthreadd is using 0% cpu.
Process lockd is using 0% cpu.
Process mingetty is using 0% cpu.
Process monitorCpuUsage is using 0% cpu.
Process mysqld is using 0% cpu.
Process mysqld_safe is using 0% cpu.
Process nfsd is using 0% cpu.
Process pdflush is using 0% cpu.
Process portmap is using 0% cpu.
Process ps is using 0% cpu.
Process rpc.mountd is using 0% cpu.
Process rpc.rquotad is using 0% cpu.
Process rpc.statd is using 0% cpu.
Process rpciod/0 is using 0% cpu.
Process sendmail is using 0% cpu.
Process sshd is using 0% cpu.
Process su is using 0% cpu.
Process syslogd is using 0% cpu.
Process xfs is using 0% cpu.
Process xfsdatad/0 is using 0% cpu.
Process xfslogd/0 is using 0% cpu.

Unix: BASH Cures Cancer Blog

iftop: display bandwidth usage on an interface

iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?".

opensource: del.icio.us tag/opensource

Charles : Web Debugging Proxy | HTTP Monitor | HTTP Proxy | HTTPS/SSL Proxy | Reverse Proxy

Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching informat

opensource: del.icio.us tag/opensource

sipsak homepage

SIP swiss army knife

SIP: del.icio.us tag/SIP

Nagios - host, service and network monitoring program

Nagios® is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better.

open-source: del.icio.us tag/open-source