summaryrefslogtreecommitdiff
path: root/agent/mibgroup/Rmon/test_hist.sh
blob: 52bdd884c4784822eccd3211ca7152cb59fee32a (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
:
# Rmon History testing script
# $Log$
# Revision 5.0  2002/04/20 07:30:01  hardaker
# cvs file version number change
#
# Revision 1.1  2001/05/09 19:36:13  slif
# Include Alex Rozin's Rmon.
#
#

#Only parameter: number of interface (ifIndex) to be tested.
#Default: 1

TSTIF=1
COMPAR="-m ALL localhost public"

if [ "X"${1} = "X" ] ; then
    echo got default parameter : $TSTIF
else
    TSTIF=$1
fi

echo interface ifIndex.$TSTIF will be tested

echo " "
echo 1. create control entry
snmpset $COMPAR historyControlBucketsRequested.4 i 4 historyControlInterval.4 i 3 \
historyControlDataSource.4 o interfaces.ifTable.ifEntry.ifIndex.$TSTIF \
historyControlStatus.4 i 2

snmpwalk $COMPAR historyControlTable
echo " "
echo 2. validate it
snmpset $COMPAR historyControlStatus.4 i 1
snmpwalk $COMPAR historyControlTable
echo "Sleep 3, take it chance to get something"
sleep 3
snmpwalk $COMPAR etherHistoryTable
echo "Sleep 6, take it chance to advance"
sleep 6
snmpwalk $COMPAR etherHistoryTable


echo " "
echo 3. change requested number of buckets
snmpset $COMPAR historyControlBucketsRequested.4 i 2
echo "Sleep 9, take it chance to get something"
sleep 9
snmpwalk $COMPAR etherHistoryTable

echo " "
echo 4. invalidate it
snmpset $COMPAR historyControlStatus.4 i 4
snmpwalk $COMPAR history


echo " "
echo 5. create and validate 2 control entries
snmpset $COMPAR historyControlBucketsRequested.4 i 3 historyControlInterval.4 i 2 \
historyControlDataSource.4 o interfaces.ifTable.ifEntry.ifIndex.$TSTIF \
historyControlStatus.4 i 1
snmpset $COMPAR historyControlBucketsRequested.2 i 2 historyControlInterval.2 i 4 \
historyControlStatus.2 i 1
snmptable $COMPAR historyControlTable
echo "Sleep 12, take them chance to get something"
sleep 12
snmpwalk $COMPAR etherHistoryTable

echo " "
echo 6. create entry and let it to be aged
snmpset $COMPAR historyControlStatus.3 i 2
snmptable $COMPAR historyControlTable
echo "Sleep 61, take it chance to be aged"
sleep 61
snmptable $COMPAR historyControlTable

echo " "
echo 7. clean everything
snmpset $COMPAR historyControlStatus.2 i 4
snmpset $COMPAR historyControlStatus.4 i 4
snmpwalk $COMPAR history


echo " "
echo "Goodbye, I'm a gonner"
echo " "