stop script when test done
This commit is contained in:
parent
a945f327b8
commit
c05b574e4a
1 changed files with 12 additions and 7 deletions
|
|
@ -46,15 +46,19 @@ rrdtool create memory.rrd \
|
|||
RRA:AVERAGE:0.5:288:31
|
||||
rlAssert0 "rrdtool create" $?
|
||||
|
||||
|
||||
for (( ; ; )) do
|
||||
while true; do
|
||||
echo "Run snmpwalk"
|
||||
memory=$(snmpwalk -c public -v2c 172.16.1.10 hrSWRunPerfMem | awk 'BEGIN {total_mem=0} { if ($NF == "KBytes") {total_mem=total_mem+$(NF-1)}} END {print total_mem}')
|
||||
rrdtool update memory.rrd N:${memory}
|
||||
sleep 300
|
||||
done &
|
||||
|
||||
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Stop snmp"
|
||||
break
|
||||
else
|
||||
echo "Wait for snmp"
|
||||
sleep 300
|
||||
fi
|
||||
done &
|
||||
|
||||
rrdtool graph memory.png \
|
||||
--title="Memory Usage" \
|
||||
--vertical-label="Memory Consumption (MB)" \
|
||||
|
|
@ -199,6 +203,7 @@ rrdtool graph seconds1.png \
|
|||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
STOP=1
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue