OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [autotest/] [current/] [host/] [snmpwalk.sh] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#!/bin/sh
2
 
3
if [ $# -lt 1 ]; then
4
    echo "Usage: $0 [XFAIL] target [timeout]" > /dev/stderr
5
    exit 1
6
fi
7
 
8
[ "xXFAIL" == "x$1" ] && { XFAIL="XFAIL"; shift; }
9
TARGET=$1
10
if [ "x" == "x$2" ]; then TIMEOUT=10;   else TIMEOUT=$2;  fi
11
 
12
if [ "x$XFAIL" != "xXFAIL" ]; then
13
    # first try normal size packets
14
    if ping -n -c 5 $TARGET > /dev/null ; then
15
        echo "INFO:<$$: $TARGET is up>" > /dev/stderr
16
    else
17
        echo "FAIL:<$$: $TARGET is down>" > /dev/stderr; exit 1
18
    fi
19
fi
20
 
21
export MIBS=all
22
 
23
declare -i COUNT=0
24
declare -i FAILS=0
25
 
26
# then the size we were asked to do, for the time requested
27
 
28
while [ $SECONDS -le $TIMEOUT ]; do
29
 
30
snmpwalk -OS $TARGET public
31
 
32
snmpstatus $TARGET public || { ((FAILS++)); [ "x$XFAIL" == "xXFAIL" ]; } || break
33
 
34
((COUNT++));
35
 
36
done
37
 
38
 
39
if [ "x$XFAIL" == "xXFAIL" ]; then
40
    echo "PASS:<$$: snmpwalk XFAIL, $TIMEOUT seconds $COUNT snmpwalks $FAILS failed>" > /dev/stderr
41
    exit 0
42
fi
43
 
44
if [ $FAILS -ne 0 ]; then
45
    echo "FAIL:<$$: snmpwalk $TIMEOUT seconds $COUNT snmpwalks - status failed>" > /dev/stderr
46
    exit 1
47
fi
48
 
49
echo "PASS:<$$: snmpwalk $TIMEOUT seconds $COUNT snmpwalks>" > /dev/stderr
50
 
51
# EOF

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.