Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 1 | ############################################################################### |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 2 | # |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 3 | # EXAMPLE.conf: |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 8 | # |
| 9 | ############################################################################### |
| 10 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 11 | # AGENT BEHAVIOUR |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 12 | # |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 13 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 |
Wes Hardaker | c004636 | 1996-05-24 20:08:28 +0000 | [diff] [blame] | 18 | |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | ############################################################################### |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 22 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 23 | # SNMPv3 AUTHENTICATION |
Wes Hardaker | c2eafd1 | 1999-06-10 01:31:42 +0000 | [diff] [blame] | 24 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 25 | # Note that these particular settings don't actually belong here. |
| 26 | # They should be copied to the file /var/net-snmp/snmpd.conf |
| 27 | # and the passwords changed, before being uncommented in that file *only*. |
| 28 | # Then restart the agent |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 29 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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" |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 33 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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. |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 36 | |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 37 | |
| 38 | |
| 39 | ############################################################################### |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 40 | # |
| 41 | # ACCESS CONTROL |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 42 | # |
| 43 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 47 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 48 | # Full access from the local host |
| 49 | #rocommunity public localhost |
| 50 | # Default access to basic system info |
| 51 | rocommunity public default -V systemonly |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 52 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 58 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 64 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 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 | |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 68 | |
| 69 | |
| 70 | ############################################################################### |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 71 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 72 | # SYSTEM INFORMATION |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 73 | # |
| 74 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 75 | # Note that setting these values here, results in the corresponding MIB objects being 'read-only' |
| 76 | # See snmpd.conf(5) for more details |
| 77 | sysLocation Sitting on the Dock of the Bay |
| 78 | sysContact Me <me@example.org> |
| 79 | # Application + End-to-End layers |
| 80 | sysServices 72 |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 81 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 82 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 83 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 84 | # Process Monitoring |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 85 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 86 | # At least one 'mountd' process |
| 87 | proc mountd |
| 88 | # No more than 4 'ntalkd' processes - 0 is OK |
| 89 | proc ntalkd 4 |
| 90 | # At least one 'sendmail' process, but no more than 10 |
| 91 | proc sendmail 10 1 |
| 92 | |
| 93 | # Walk the UCD-SNMP-MIB::prTable to see the resulting output |
| 94 | # Note that this table will be empty if there are no "proc" entries in the snmpd.conf file |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 95 | |
| 96 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 97 | # |
| 98 | # Disk Monitoring |
| 99 | # |
| 100 | # 10MBs required on root disk, 5% free on /var, 10% free on all other disks |
| 101 | disk / 10000 |
| 102 | disk /var 5% |
| 103 | includeAllDisks 10% |
| 104 | |
| 105 | # Walk the UCD-SNMP-MIB::dskTable to see the resulting output |
| 106 | # Note that this table will be empty if there are no "disk" entries in the snmpd.conf file |
| 107 | |
| 108 | |
| 109 | # |
| 110 | # System Load |
| 111 | # |
| 112 | # Unacceptable 1-, 5-, and 15-minute load averages |
| 113 | load 12 10 5 |
| 114 | |
| 115 | # Walk the UCD-SNMP-MIB::laTable to see the resulting output |
| 116 | # Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file |
| 117 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 118 | |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 119 | |
| 120 | ############################################################################### |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 121 | # |
| 122 | # ACTIVE MONITORING |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 123 | # |
| 124 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 125 | # send SNMPv1 traps |
| 126 | trapsink localhost public |
| 127 | # send SNMPv2c traps |
| 128 | #trap2sink localhost public |
| 129 | # send SNMPv2c INFORMs |
| 130 | #informsink localhost public |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 131 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 132 | # Note that you typically only want *one* of these three lines |
| 133 | # Uncommenting two (or all three) will result in multiple copies of each notification. |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 134 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 135 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 136 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 137 | # Event MIB - automatically generate alerts |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 138 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 139 | # Remember to activate the 'createUser' lines above |
| 140 | iquerySecName internalUser |
| 141 | rouser internalUser |
| 142 | # generate traps on UCD error conditions |
| 143 | defaultMonitors yes |
| 144 | # generate traps on linkUp/Down |
| 145 | linkUpDownNotifications yes |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 146 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 147 | |
Wes Hardaker | f2db9ff | 1999-02-27 00:06:49 +0000 | [diff] [blame] | 148 | |
| 149 | ############################################################################### |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 150 | # |
| 151 | # EXTENDING THE AGENT |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 152 | # |
| 153 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 154 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 155 | # Arbitrary extension commands |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 156 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 157 | extend test1 /bin/echo Hello, world! |
| 158 | extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35 |
| 159 | #extend-sh test3 /bin/sh /tmp/shtest |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 160 | |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 161 | # Note that this last entry requires the script '/tmp/shtest' to be created first, |
| 162 | # containing the same three shell commands, before the line is uncommented |
| 163 | |
| 164 | # Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table |
| 165 | # and nsExtendOutput2Table) to see the resulting output |
| 166 | |
| 167 | # Note that the "extend" directive supercedes the previous "exec" and "sh" directives |
| 168 | # However, walking the UCD-SNMP-MIB::extTable should still returns the same output, |
| 169 | # as well as the fuller results in the above tables. |
| 170 | |
| 171 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 172 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 173 | # "Pass-through" MIB extension command |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 174 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 175 | #pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest |
| 176 | #pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl |
| 177 | |
| 178 | # Note that this requires one of the two 'passtest' scripts to be installed first, |
| 179 | # before the appropriate line is uncommented. |
| 180 | # These scripts can be found in the 'local' directory of the source distribution, |
| 181 | # and are not installed automatically. |
| 182 | |
| 183 | # Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output |
| 184 | |
| 185 | |
Wes Hardaker | c9b8676 | 1995-12-28 20:10:04 +0000 | [diff] [blame] | 186 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 187 | # AgentX Sub-agents |
Wes Hardaker | 781380f | 1997-02-03 09:03:10 +0000 | [diff] [blame] | 188 | # |
Dave Shield | ae84705 | 2009-06-01 13:11:07 +0000 | [diff] [blame] | 189 | # Run as an AgentX master agent |
| 190 | master agentx |
| 191 | # Listen for network connections (from localhost) |
| 192 | # rather than the default named socket /var/agentx/master |
| 193 | #agentXSocket tcp:localhost:705 |