net-snmpd.conf 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. ###############################################################################
  2. #
  3. # snmpd.conf:
  4. # An example configuration file for configuring the ucd-snmp snmpd agent.
  5. #
  6. ###############################################################################
  7. #
  8. # This file is intended to only be as a starting point. Many more
  9. # configuration directives exist than are mentioned in this file. For
  10. # full details, see the snmpd.conf(5) manual page.
  11. #
  12. # All lines beginning with a '#' are comments and are intended for you
  13. # to read. All other lines are configuration commands for the agent.
  14. ###############################################################################
  15. # Access Control
  16. ###############################################################################
  17. # As shipped, the snmpd demon will only respond to queries on the
  18. # system mib group until this file is replaced or modified for
  19. # security purposes. Examples are shown below about how to increase the
  20. # level of access.
  21. # By far, the most common question I get about the agent is "why won't
  22. # it work?", when really it should be "how do I configure the agent to
  23. # allow me to access it?"
  24. #
  25. # By default, the agent responds to the "public" community for read
  26. # only access, if run out of the box without any configuration file in
  27. # place. The following examples show you other ways of configuring
  28. # the agent so that you can change the community names, and give
  29. # yourself write access to the mib tree as well.
  30. #
  31. # For more information, read the FAQ as well as the snmpd.conf(5)
  32. # manual page.
  33. ####
  34. # First, map the community name "public" into a "security name"
  35. # sec.name source community
  36. com2sec notConfigUser default public
  37. ####
  38. # Second, map the security name into a group name:
  39. # groupName securityModel securityName
  40. group notConfigGroup v1 notConfigUser
  41. group notConfigGroup v2c notConfigUser
  42. ####
  43. # Third, create a view for us to let the group have rights to:
  44. # Make at least snmpwalk -v 1 localhost -c public system fast again.
  45. # name incl/excl subtree mask(optional)
  46. view systemview included .1.3.6.1.2.1.1
  47. view systemview included .1.3.6.1.2.1.25.1.1
  48. ####
  49. # Finally, grant the group read-only access to the systemview view.
  50. # group context sec.model sec.level prefix read write notif
  51. access notConfigGroup "" any noauth exact systemview none none
  52. # -----------------------------------------------------------------------------
  53. # Here is a commented out example configuration that allows less
  54. # restrictive access.
  55. # YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
  56. # KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
  57. # SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
  58. ## sec.name source community
  59. #com2sec local localhost COMMUNITY
  60. #com2sec mynetwork NETWORK/24 COMMUNITY
  61. ## group.name sec.model sec.name
  62. #group MyRWGroup any local
  63. #group MyROGroup any mynetwork
  64. #
  65. #group MyRWGroup any otherv3user
  66. #...
  67. ## incl/excl subtree mask
  68. #view all included .1 80
  69. ## -or just the mib2 tree-
  70. #view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
  71. ## context sec.model sec.level prefix read write notif
  72. #access MyROGroup "" any noauth 0 all none none
  73. #access MyRWGroup "" any noauth 0 all all all
  74. ###############################################################################
  75. # Sample configuration to make net-snmpd RFC 1213.
  76. # Unfortunately v1 and v2c don't allow any user based authentification, so
  77. # opening up the default config is not an option from a security point.
  78. #
  79. # WARNING: If you uncomment the following lines you allow write access to your
  80. # snmpd daemon from any source! To avoid this use different names for your
  81. # community or split out the write access to a different community and
  82. # restrict it to your local network.
  83. # Also remember to comment the syslocation and syscontact parameters later as
  84. # otherwise they are still read only (see FAQ for net-snmp).
  85. #
  86. # First, map the community name "public" into a "security name"
  87. # sec.name source community
  88. #com2sec notConfigUser default public
  89. # Second, map the security name into a group name:
  90. # groupName securityModel securityName
  91. #group notConfigGroup v1 notConfigUser
  92. #group notConfigGroup v2c notConfigUser
  93. # Third, create a view for us to let the group have rights to:
  94. # Open up the whole tree for ro, make the RFC 1213 required ones rw.
  95. # name incl/excl subtree mask(optional)
  96. #view roview included .1
  97. #view rwview included system.sysContact
  98. #view rwview included system.sysName
  99. #view rwview included system.sysLocation
  100. #view rwview included interfaces.ifTable.ifEntry.ifAdminStatus
  101. #view rwview included at.atTable.atEntry.atPhysAddress
  102. #view rwview included at.atTable.atEntry.atNetAddress
  103. #view rwview included ip.ipForwarding
  104. #view rwview included ip.ipDefaultTTL
  105. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteDest
  106. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex
  107. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric1
  108. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric2
  109. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric3
  110. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric4
  111. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteType
  112. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteAge
  113. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMask
  114. #view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric5
  115. #view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaIfIndex
  116. #view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress
  117. #view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaNetAddress
  118. #view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType
  119. #view rwview included tcp.tcpConnTable.tcpConnEntry.tcpConnState
  120. #view rwview included egp.egpNeighTable.egpNeighEntry.egpNeighEventTrigger
  121. #view rwview included snmp.snmpEnableAuthenTraps
  122. # Finally, grant the group read-only access to the systemview view.
  123. # group context sec.model sec.level prefix read write notif
  124. #access notConfigGroup "" any noauth exact roview rwview none
  125. ###############################################################################
  126. # System contact information
  127. #
  128. # It is also possible to set the sysContact and sysLocation system
  129. # variables through the snmpd.conf file:
  130. syslocation Unknown (edit /etc/snmp/snmpd.conf)
  131. syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
  132. # Example output of snmpwalk:
  133. # % snmpwalk -v 1 localhost -c public system
  134. # system.sysDescr.0 = "SunOS name sun4c"
  135. # system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
  136. # system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
  137. # system.sysContact.0 = "Me <me@somewhere.org>"
  138. # system.sysName.0 = "name"
  139. # system.sysLocation.0 = "Right here, right now."
  140. # system.sysServices.0 = 72
  141. ###############################################################################
  142. # Logging
  143. #
  144. # We do not want annoying "Connection from UDP: " messages in syslog.
  145. # If the following option is commented out, snmpd will print each incoming
  146. # connection, which can be useful for debugging.
  147. dontLogTCPWrappersConnects yes
  148. # -----------------------------------------------------------------------------
  149. ###############################################################################
  150. # Process checks.
  151. #
  152. # The following are examples of how to use the agent to check for
  153. # processes running on the host. The syntax looks something like:
  154. #
  155. # proc NAME [MAX=0] [MIN=0]
  156. #
  157. # NAME: the name of the process to check for. It must match
  158. # exactly (ie, http will not find httpd processes).
  159. # MAX: the maximum number allowed to be running. Defaults to 0.
  160. # MIN: the minimum number to be running. Defaults to 0.
  161. #
  162. # Examples (commented out by default):
  163. #
  164. # Make sure mountd is running
  165. #proc mountd
  166. # Make sure there are no more than 4 ntalkds running, but 0 is ok too.
  167. #proc ntalkd 4
  168. # Make sure at least one sendmail, but less than or equal to 10 are running.
  169. #proc sendmail 10 1
  170. # A snmpwalk of the process mib tree would look something like this:
  171. #
  172. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.2
  173. # enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
  174. # enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
  175. # enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
  176. # enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
  177. # enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
  178. # enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
  179. # enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
  180. # enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
  181. # enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
  182. # enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
  183. # enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
  184. # enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
  185. # enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
  186. # enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
  187. # enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
  188. # enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
  189. # enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
  190. # enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
  191. # enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
  192. # enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
  193. # enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
  194. # enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
  195. # enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
  196. # enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
  197. #
  198. # Note that the errorFlag for mountd is set to 1 because one is not
  199. # running (in this case an rpc.mountd is, but thats not good enough),
  200. # and the ErrMessage tells you what's wrong. The configuration
  201. # imposed in the snmpd.conf file is also shown.
  202. #
  203. # Special Case: When the min and max numbers are both 0, it assumes
  204. # you want a max of infinity and a min of 1.
  205. #
  206. # -----------------------------------------------------------------------------
  207. ###############################################################################
  208. # Executables/scripts
  209. #
  210. #
  211. # You can also have programs run by the agent that return a single
  212. # line of output and an exit code. Here are two examples.
  213. #
  214. # exec NAME PROGRAM [ARGS ...]
  215. #
  216. # NAME: A generic name. The name must be unique for each exec statement.
  217. # PROGRAM: The program to run. Include the path!
  218. # ARGS: optional arguments to be passed to the program
  219. # a simple hello world
  220. #exec echotest /bin/echo hello world
  221. # Run a shell script containing:
  222. #
  223. # #!/bin/sh
  224. # echo hello world
  225. # echo hi there
  226. # exit 35
  227. #
  228. # Note: this has been specifically commented out to prevent
  229. # accidental security holes due to someone else on your system writing
  230. # a /tmp/shtest before you do. Uncomment to use it.
  231. #
  232. #exec shelltest /bin/sh /tmp/shtest
  233. # Then,
  234. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.8
  235. # enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
  236. # enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
  237. # enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
  238. # enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
  239. # enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
  240. # enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
  241. # enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
  242. # enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
  243. # enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
  244. # enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
  245. # enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
  246. # enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0
  247. # Note that the second line of the /tmp/shtest shell script is cut
  248. # off. Also note that the exit status of 35 was returned.
  249. # -----------------------------------------------------------------------------
  250. ###############################################################################
  251. # disk checks
  252. #
  253. # The agent can check the amount of available disk space, and make
  254. # sure it is above a set limit.
  255. # disk PATH [MIN=100000]
  256. #
  257. # PATH: mount path to the disk in question.
  258. # MIN: Disks with space below this value will have the Mib's errorFlag set.
  259. # Default value = 100000.
  260. # Check the / partition and make sure it contains at least 10 megs.
  261. #disk / 10000
  262. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.9
  263. # enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
  264. # enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F
  265. # enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
  266. # enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
  267. # enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
  268. # enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
  269. # enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
  270. # enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
  271. # enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
  272. # enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""
  273. # -----------------------------------------------------------------------------
  274. ###############################################################################
  275. # load average checks
  276. #
  277. # load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
  278. #
  279. # 1MAX: If the 1 minute load average is above this limit at query
  280. # time, the errorFlag will be set.
  281. # 5MAX: Similar, but for 5 min average.
  282. # 15MAX: Similar, but for 15 min average.
  283. # Check for loads:
  284. #load 12 14 14
  285. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.10
  286. # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
  287. # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
  288. # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
  289. # enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
  290. # enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
  291. # enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
  292. # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
  293. # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
  294. # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
  295. # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
  296. # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
  297. # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
  298. # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
  299. # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
  300. # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
  301. # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
  302. # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
  303. # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""
  304. # -----------------------------------------------------------------------------
  305. ###############################################################################
  306. # Extensible sections.
  307. #
  308. # This alleviates the multiple line output problem found in the
  309. # previous executable mib by placing each mib in its own mib table:
  310. # Run a shell script containing:
  311. #
  312. # #!/bin/sh
  313. # echo hello world
  314. # echo hi there
  315. # exit 35
  316. #
  317. # Note: this has been specifically commented out to prevent
  318. # accidental security holes due to someone else on your system writing
  319. # a /tmp/shtest before you do. Uncomment to use it.
  320. #
  321. # exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
  322. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.50
  323. # enterprises.ucdavis.50.1.1 = 1
  324. # enterprises.ucdavis.50.2.1 = "shelltest"
  325. # enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
  326. # enterprises.ucdavis.50.100.1 = 35
  327. # enterprises.ucdavis.50.101.1 = "hello world."
  328. # enterprises.ucdavis.50.101.2 = "hi there."
  329. # enterprises.ucdavis.50.102.1 = 0
  330. # Now the Output has grown to two lines, and we can see the 'hi
  331. # there.' output as the second line from our shell script.
  332. #
  333. # Note that you must alter the mib.txt file to be correct if you want
  334. # the .50.* outputs above to change to reasonable text descriptions.
  335. # Other ideas:
  336. #
  337. # exec .1.3.6.1.4.1.2021.51 ps /bin/ps
  338. # exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
  339. # exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq
  340. # -----------------------------------------------------------------------------
  341. ###############################################################################
  342. # Pass through control.
  343. #
  344. # Usage:
  345. # pass MIBOID EXEC-COMMAND
  346. #
  347. # This will pass total control of the mib underneath the MIBOID
  348. # portion of the mib to the EXEC-COMMAND.
  349. #
  350. # Note: You'll have to change the path of the passtest script to your
  351. # source directory or install it in the given location.
  352. #
  353. # Example: (see the script for details)
  354. # (commented out here since it requires that you place the
  355. # script in the right location. (its not installed by default))
  356. # pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/local/passtest
  357. # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.255
  358. # enterprises.ucdavis.255.1 = "life the universe and everything"
  359. # enterprises.ucdavis.255.2.1 = 42
  360. # enterprises.ucdavis.255.2.2 = OID: 42.42.42
  361. # enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
  362. # enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
  363. # enterprises.ucdavis.255.5 = 42
  364. # enterprises.ucdavis.255.6 = Gauge: 42
  365. #
  366. # % snmpget -v 1 localhost public .1.3.6.1.4.1.2021.255.5
  367. # enterprises.ucdavis.255.5 = 42
  368. #
  369. # % snmpset -v 1 localhost public .1.3.6.1.4.1.2021.255.1 s "New string"
  370. # enterprises.ucdavis.255.1 = "New string"
  371. #
  372. # For specific usage information, see the man/snmpd.conf.5 manual page
  373. # as well as the local/passtest script used in the above example.
  374. ###############################################################################
  375. # Further Information
  376. #
  377. # See the snmpd.conf manual page, and the output of "snmpd -H".