| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# standard V1 configuration: testcommunity1 testcommunity2 |
| 4 |
# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied |
| 5 |
# generically set up the community "testcommunity1 and testcommunity2" for various snmp |
| 6 |
# version access to the agent. |
| 7 |
|
| 8 |
if [ "x$snmp_version" = "x" ]; then |
| 9 |
snmp_version="any" |
| 10 |
fi |
| 11 |
|
| 12 |
CONFIGAGENT [snmp] persistentdir $SNMP_TMP_PERSISTENTDIR |
| 13 |
|
| 14 |
CONFIGAGENT rocommunity testrocommunity 127.0.0.1 .1.3.6.1.2.1.1.5.0 |
| 15 |
CONFIGAGENT rwcommunity testrwcommunity 127.0.0.1 .1.3.6.1.2.1.1.5.0 |
| 16 |
|
| 17 |
CONFIGAGENT com2sec testcommunitysec1 default testcommunity1 |
| 18 |
CONFIGAGENT com2sec testcommunitysec2 default testcommunity2 |
| 19 |
|
| 20 |
if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then |
| 21 |
CONFIGAGENT rocommunity6 testrocommunity ::1 .1.3.6.1.2.1.1.5.0 |
| 22 |
CONFIGAGENT rwcommunity6 testrwcommunity ::1 .1.3.6.1.2.1.1.5.0 |
| 23 |
CONFIGAGENT com2sec6 testcommunitysec1 default testcommunity1 |
| 24 |
CONFIGAGENT com2sec6 testcommunitysec2 default testcommunity2 |
| 25 |
fi |
| 26 |
|
| 27 |
if [ "$SNMP_TRANSPORT_SPEC" = "unix" ];then |
| 28 |
CONFIGAGENT com2secunix testcommunitysec1 testcommunity1 |
| 29 |
CONFIGAGENT com2secunix testcommunitysec2 testcommunity2 |
| 30 |
fi |
| 31 |
|
| 32 |
CONFIGAGENT group testcommunitygroup1 $snmp_version testcommunitysec1 |
| 33 |
CONFIGAGENT group testcommunitygroup2 $snmp_version testcommunitysec2 |
| 34 |
|
| 35 |
CONFIGAGENT view system1 included .1.3.6.1.2.1.1.1 |
| 36 |
CONFIGAGENT view system2 included .1 |
| 37 |
CONFIGAGENT view system2 excluded .1.3.6.1.2.1.1.1 |
| 38 |
CONFIGAGENT 'access testcommunitygroup1 "" any noauth exact system1 none none' |
| 39 |
CONFIGAGENT 'access testcommunitygroup2 "" any noauth exact system2 none none' |
| 40 |
|