summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/hobbit-client/client/ext/hobbit-mem-myth.sh
blob: 642672f3c80b12022f896e3580293a339f210fb3 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
MBEPID=`ps -ef|grep mythbackend |grep -v runsv|grep -v grep|grep -v logger|awk '{print $2 }'`
MFEPID=`ps -ef|grep mythfrontend |grep -v runsv|grep -v grep|grep -v logger|awk '{print $2 }'`



COLOR=green      # By default, everything is OK

   # Do whatever you need to test for something
if [ ! x$MBEPID = x ]
then
VmSize=`cat /proc/$MBEPID/status|grep -i vmsize|awk '{print $2 }'`
VmPeak=`cat /proc/$MBEPID/status|grep -i vmpeak|awk '{print $2 }'`
VmRSS=`cat /proc/$MBEPID/status|grep -i vmrss |awk '{print $2 }'`
MSGMBE="
	VmSize:$VmSize
	VmPeak:$VmPeak
	VmRSS:$VmRSS
	"
#	echo $MSGMBE
 # Tell Hobbit about it
   $BB $BBDISP "data $MACHINE.memmbe $COLOR `date`

   ${MSGMBE}

   " 
fi
   


if [ ! x$MFEPID = x ]
then
VmSize=`cat /proc/$MFEPID/status|grep -i vmsize|awk '{print $2 }'`
VmPeak=`cat /proc/$MFEPID/status|grep -i vmpeak|awk '{print $2 }'`
VmRSS=`cat /proc/$MFEPID/status|grep -i vmrss |awk '{print $2 }'`
MSGMBE="
	VmSize:$VmSize
	VmPeak:$VmPeak
	VmRSS:$VmRSS
	"
#	echo $MSGMBE
 # Tell Hobbit about it
   $BB $BBDISP "data $MACHINE.memmfe $COLOR `date`

   ${MSGMBE}

   " 
fi