Advertisement
Guest User

Untitled

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