Hello,
Voila le fichier que je met sur mes serveurs:
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
| # First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):
# sec.name source community
#com2sec paranoid default public
com2sec readss 172.30.92.0/24 MonPasswd
# Second, map the security names into group names:
# sec.model sec.name
group MyROSystem v1 paranoid
group MyROSystem v2c paranoid
group MyROSystem usm paranoid
group MySecGroup v1 readss
group MySecGroup v2c readss
group MySecGroup usm readss
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1 80
view system included .iso.org.dod.internet.mgmt.mib-2.system
view mib2 included .iso.org.dod.internet.mgmt.mib-2
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:
# context sec.model sec.level match read write notif
access MyROSystem "" any noauth exact system none none
access MySecGroup "" any noauth exact all none none
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf) |
Et après j'interroge avec
snmpwalk -c MonPasswd -v1 monserveur
mais uniquement dans le cas où le suis dans le réseau 172.30.80/24 !
Avec ça j'ai accès à la mib2. Pour les mibs propriétaires, il faut que je mette l'oid qui va bien. L'expression suivante permet de voir tout (ce qui peut être verbeux.
snmpwalk -c MonPasswd -v1 monserveur .1
Partager