📄 snmpd.conf.5
字号:
The reason for the mask is, that it allows you to control access toone row in a table, in a relatively simple way. As an example, as an ISPyou might consider giving each customer access to his or her own interface:.IP.nfview cust1 included interfaces.ifTable.ifEntry.ifIndex.1 ff.a0view cust2 included interfaces.ifTable.ifEntry.ifIndex.2 ff.a0.IP(interfaces.ifTable.ifEntry.ifIndex.1 == .1.3.6.1.2.1.2.2.1.1.1,ff.a0 == 11111111.10100000. which nicely covers up and includingthe row index, but lets the user vary the field of the row).IP "VACM Examples:".nf# sec.name source communitycom2sec local localhost privatecom2sec mynet 10.10.10.0/24 publiccom2sec public default public# sec.model sec.namegroup mygroup v1 mynetgroup mygroup v2c mynetgroup mygroup usm mynetgroup local v1 localgroup local v2c localgroup local usm localgroup public v1 publicgroup public v2c publicgroup public usm public# incl/excl subtree maskview all included .1 80view system included system feview mib2 included .iso.org.dod.internet.mgmt.mib-2 fc# context sec.model sec.level prefix read write notifyaccess mygroup "" any noauth exact mib2 none noneaccess public "" any noauth exact system none noneaccess local "" any noauth exact all all all.IP "Default VACM model"The default configuration of the agent, as shipped, is functionallyequivalent to the following entries:.nfcom2sec public default publicgroup public v1 publicgroup public v2c publicgroup public usm publicview all included .1access public "" any noauth exact all none none.SH SNMPv3 CONFIGURATION.PP.IP "engineID STRING"The snmpd agent needs to be configured with an engineID to be able torespond to SNMPv3 messages. With this configuration file line, theengineID will be configured from STRING. The default value of theengineID is configured with the first IP address found for thehostname of the machine..IP "createUser username (MD5|SHA) authpassphrase [DES] [privpassphrase]"This directive should be placed into the"/var/ucd-snmp"/snmpd.conf file instead of the other normallocations. The reason is that the information is read from the fileand then the line is removed (eliminating the storage of the masterpassword for that user) and replaced with the key that is derived from it. This key is a localized key, so that if it is stolen it can notbe used to access other agents. If the password is stolen, however,it can be..IPMD5 and SHA are the authentication types to use, but you must havebuilt the package with openssl installed in order to use SHA. Theonly privacy protocol currently supported is DES. If the privacypassphrase is not specified, it is assumed to be the same as theauthentication passphrase. Note that the users created will beuseless unless they are also added to the VACM access control tablesdescribed above..IPWarning: the minimum pass phrase length is 8 characters..IPSNMPv3 users can be created at runtime using the.I snmpusmcommand..IP.SH SETTING SYSTEM INFORMATION.IP "syslocation STRING".IP "syscontact STRING".IPSets the system location and the system contact for the agent. Thisinformation is reported by the 'system' table in the mibII tree..IP "authtrapenable NUMBER"Setting authtrapenable to 1 enables generation of authentication failuretraps. The default value is 2 (disable)..IP "trapcommunity STRING"This defines the default community string to be used when sending traps.Note that this command must be used prior to any of the following threecommands that are intended use this community string..IP "trapsink HOST [COMMUNITY [PORT]]".IP "trap2sink HOST [COMMUNITY [PORT]]".IP "informsink HOST [COMMUNITY [PORT]]"These commands definethe hosts to receive traps (and/or inform notifications). Thedaemon sends a Cold Start trap when it starts up. If enabled, it also sendstraps on authentication failures. Multiple \fItrapsink\fR, \fItrap2sink\fRand \fIinformsink\fR lines may be specified to specify multiple destinations.Use \fItrap2sink\fR to send SNMPv2 traps and \fIinformsink\fR to sendinform notifications.If COMMUNITY is not specified, the string from a preceding \fItrapcommunity\fRdirective will be used. If PORT is not specified, the well known SNMP trapport (162) will be used..SH "PASS-THROUGH CONTROL".IP "pass MIBOID EXEC"Passes entire control of MIBOID to the EXEC program. The EXEC programis called in one of the following three ways:.RS.IP "EXEC -g MIBOID".IP "EXEC -n MIBOID".IPThese call lines match to SNMP get and getnext requests. It isexpected that the EXEC program will take the arguments passed to itand return the appropriate response through it's stdout. .IPThe first line of stdout should be the mib OID of the returning value.The second line should be the TYPE of value returned, where TYPE isone of the text strings:.B string, integer, unsigned, objectid, timeticks, ipaddress, counter, or.B gauge.The third line of stdout should be the VALUE corresponding with thereturned TYPE..IPFor instance, if a script was to return the value integer value "42"when a request for .1.3.6.1.4.100 was requested, the script shouldreturn the following 3 lines:.br.RS .1.3.6.1.4.100.br integer.br 42.RE.IPTo indicate that the script is unable to comply with the request dueto an end-of-mib condition or an invalid request, simple exit andreturn no output to stdout at all. A snmp error will be generatedcorresponding to the SNMP NO-SUCH-NAME response..IP "EXEC -s MIBOID TYPE VALUE".IP For SNMP set requests, the above call method is used. The TYPE passedto the EXEC program is one of the text strings:.B integer, counter, gauge, timeticks, ipaddress, objid,or .B string,indicating the type of value passed in the next argument..IPReturn nothing to stdout, and the set will assumed to have beensuccessful. Otherwise, return one of the following error strings tosignal an error:.B not-writable, or .B wrong-typeand the appropriate error response will be generated instead..RS.IP Note:By default, the only community allowed to write (ie snmpset) to yourscript will be the "private" community,or community #2 if defineddifferently by the "community" token discussed above. Whichcommunities are allowed write access are controlled by the RWRITEdefinition in the snmplib/snmp_impl.h source file..RE.RE.SH "EXAMPLE"See the EXAMPLE.CONF file in the top level source directory for a moredetailed example of how the above information is used in realexamples..SH "RE-READING snmpd.conf and snmpd.local.conf"The ucd-snmp agent can be forced to re-read its configuration files.It can be told to do so by one of two ways:.IP 1.An snmpset of integer(1) to 1.3.6.1.4.1.2021.100.VERUPDATECONFIG..IP 2.A "kill -HUP" signal sent to the snmpd agent process..SH "FILES"share/snmp/snmpd.conf.SH "SEE ALSO"snmp_config(5), snmpd(1), EXAMPLE.conf, read_config(3)..\" Local Variables:.\" mode: nroff.\" End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -