Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.37 KB | None | 0 0
  1. ###############################################################################
  2. #
  3. # EXAMPLE.conf:
  4. # An example configuration file for configuring the Net-SNMP agent ('snmpd')
  5. # See the 'snmpd.conf(5)' man page for details
  6. #
  7. # Some entries are deliberately commented out, and will need to be explicitly activated
  8. #
  9. ###############################################################################
  10. #
  11. # AGENT BEHAVIOUR
  12. #
  13.  
  14. # Listen for connections from the local system only
  15. agentAddress udp:127.0.0.1:161
  16. # Listen for connections on all interfaces (both IPv4 *and* IPv6)
  17. #agentAddress udp:161,udp6:[::1]:161
  18.  
  19. ###############################################################################
  20. #
  21. # SNMPv3 AUTHENTICATION
  22. #
  23. # Note that these particular settings don't actually belong here.
  24. # They should be copied to the file /var/lib/snmp/snmpd.conf
  25. # and the passwords changed, before being uncommented in that file *only*.
  26. # Then restart the agent
  27.  
  28. # createUser authOnlyUser MD5 "remember to change this password"
  29. # createUser authPrivUser SHA "remember to change this one too" DES
  30. # createUser internalUser MD5 "this is only ever used internally, but still change the password"
  31.  
  32. # If you also change the usernames (which might be sensible),
  33. # then remember to update the other occurances in this example config file to match.
  34.  
  35.  
  36.  
  37. ###############################################################################
  38. #
  39. # ACCESS CONTROL
  40. #
  41.  
  42. # system + hrSystem groups only
  43. view systemonly included .1.3.6.1.2.1.1
  44. view systemonly included .1.3.6.1.2.1.25.1
  45.  
  46. # Full access from the local host
  47. #rocommunity public localhost
  48. # Default access to basic system info
  49. rocommunity public default -V systemonly
  50. # rocommunity6 is for IPv6
  51. rocommunity6 public default -V systemonly
  52.  
  53. # Full access from an example network
  54. # Adjust this network address to match your local
  55. # settings, change the community string,
  56. # and check the 'agentAddress' setting above
  57. #rocommunity secret 10.0.0.0/16
  58.  
  59. rouser authOnlyUser
  60. # Full write access for encrypted requests
  61. # Remember to activate the 'createUser' lines above
  62. #rwuser authPrivUser priv
  63.  
  64. # It's no longer typically necessary to use the full 'com2sec/group/access' configuration
  65. # r[ow]user and r[ow]community, together with suitable views, should cover most requirements
  66.  
  67.  
  68.  
  69. ###############################################################################
  70. #
  71. # SYSTEM INFORMATION
  72. #
  73.  
  74. # Note that setting these values here, results in the corresponding MIB objects being 'read-only'
  75. # See snmpd.conf(5) for more details
  76. sysLocation Sitting on the Dock of the Bay
  77. sysContact Me <me@example.org>
  78. # Application + End-to-End layers
  79. sysServices 72
  80.  
  81.  
  82. #
  83. # Process Monitoring
  84. #
  85. # At least one 'mountd' process
  86. proc mountd
  87. # No more than 4 'ntalkd' processes - 0 is OK
  88. # At least one 'sendmail' process, but no more than 10
  89. proc sendmail 10 1
  90.  
  91. # Walk the UCD-SNMP-MIB::prTable to see the resulting output
  92. # Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
  93.  
  94.  
  95. #
  96. # Disk Monitoring
  97. #
  98. # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
  99. disk / 10000
  100. disk /var 5%
  101. includeAllDisks 10%
  102.  
  103. # Walk the UCD-SNMP-MIB::dskTable to see the resulting output
  104. # Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
  105.  
  106.  
  107. #
  108. # System Load
  109. #
  110. # Unacceptable 1-, 5-, and 15-minute load averages
  111. load 12 10 5
  112.  
  113. # Walk the UCD-SNMP-MIB::laTable to see the resulting output
  114. # Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
  115.  
  116.  
  117.  
  118. ###############################################################################
  119. #
  120. # ACTIVE MONITORING
  121. #
  122.  
  123. # send SNMPv1 traps
  124. trapsink localhost public
  125. # send SNMPv2c traps
  126. #trap2sink localhost public
  127. # send SNMPv2c INFORMs
  128. #informsink localhost public
  129.  
  130. # Note that you typically only want *one* of these three lines
  131. # Uncommenting two (or all three) will result in multiple copies of each notification.
  132.  
  133.  
  134. #
  135. # Event MIB - automatically generate alerts
  136. #
  137. # Remember to activate the 'createUser' lines above
  138. iquerySecName internalUser
  139. rouser internalUser
  140. # generate traps on UCD error conditions
  141. defaultMonitors yes
  142. # generate traps on linkUp/Down
  143. linkUpDownNotifications yes
  144.  
  145.  
  146. ###############################################################################
  147. #
  148. # EXTENDING THE AGENT
  149. #
  150.  
  151. #
  152. # Arbitrary extension commands
  153. #
  154. extend test1 /bin/echo Hello, world!
  155. extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
  156. #extend-sh test3 /bin/sh /tmp/shtest
  157.  
  158. # Note that this last entry requires the script '/tmp/shtest' to be created first,
  159. # containing the same three shell commands, before the line is uncommented
  160.  
  161. # Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
  162. # and nsExtendOutput2Table) to see the resulting output
  163.  
  164. # Note that the "extend" directive supercedes the previous "exec" and "sh" directives
  165. # However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
  166. # as well as the fuller results in the above tables.
  167.  
  168.  
  169. #
  170. # "Pass-through" MIB extension command
  171. #
  172. #pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
  173. #pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
  174.  
  175. # Note that this requires one of the two 'passtest' scripts to be installed first,
  176. #
  177. # "Pass-through" MIB extension command
  178. #
  179. #pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
  180. #pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
  181.  
  182. # Note that this requires one of the two 'passtest' scripts to be installed first,
  183. # before the appropriate line is uncommented.
  184. # These scripts can be found in the 'local' directory of the source distribution,
  185. # and are not installed automatically.
  186.  
  187. # Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
  188.  
  189.  
  190. #
  191. # AgentX Sub-agents
  192. #
  193. # Run as an AgentX master agent
  194. master agentx
  195. # Listen for network connections (from localhost)
  196. # rather than the default named socket /var/agentx/master
  197. #agentXSocket tcp:localhost:705
  198. recommunity public
  199. syslocation "Your Location"
  200. syscontact jonas181100@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement