/[webpac]/trunk/tools/mon_webpac
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/tools/mon_webpac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 210 - (show annotations)
Sun Feb 1 20:37:33 2004 UTC (15 years, 10 months ago) by dpavlin
File size: 727 byte(s)
more verbose output

1 #!/bin/sh
2
3 # this script will monitor webpac and store results into
4 # /tmp/webpac.$$
5
6 echo "trying to find webpac (all2xml.pl) pid... press ctrl+c to abort"
7 pid=""
8 while [ -z "$pid" ] ; do
9 pid=`ps -o pid --no-header -C all2xml.pl | sed 's/ //g'`
10 if [ -z "$pid" ] ; then
11 sleep 1;
12 echo -n "."
13 else
14 echo
15 fi
16 done
17
18 log=/tmp/webpac.$pid
19 if [ -f "$log" ] ; then
20 echo -n "appending to $log... "
21 else
22 echo "creating $log..."
23 fi
24 echo "press ctrl+c to abort"
25
26 sec=1
27 while [ -d "/proc/$pid" ] ; do
28 # line=`ps --no-header v -p $pid`
29 echo -n "$sec " >> $log
30 line=`cat /proc/$pid/statm /proc/loadavg | tr '\n' ' '`
31 echo "$sec $line" >> $log
32 echo "[$sec] $line"
33 sec=`expr $sec + 1`
34 sleep 1
35 done
36
37 echo "log left in file $log"

Properties

Name Value
cvs2svn:cvs-rev 1.2
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26