• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

agent/H03-May-2022-338,175215,600

apps/H14-Aug-2020-25,95319,986

ci/H14-Aug-2020-744646

configure.d/H14-Aug-2020-7,6756,725

dist/H14-Aug-2020-4,7623,478

doc/rfc/H14-Aug-2020-186110

include/H14-Aug-2020-23,64813,510

local/H14-Aug-2020-32,90326,731

m4/H14-Aug-2020-9,4378,528

man/H03-May-2022-11,81810,829

mibs/H03-May-2022-1,5981,324

ov/H14-Aug-2020-385350

perl/H14-Aug-2020-25,17317,764

python/H14-Aug-2020-4,2222,996

snmplib/H03-May-2022-92,81465,459

testing/H14-Aug-2020-14,5909,207

win32/H20-Aug-2020-12,2868,445

.appveyor.ymlH A D14-Aug-2020460 2922

.cirrus.ymlH A D14-Aug-2020252 1310

.gitignoreH A D14-Aug-20202.1 KiB125124

.travis.ymlH A D14-Aug-20204.9 KiB218209

CHANGESH A D14-Aug-2020140.3 KiB2,8042,611

COPYINGH A D14-Aug-202021.5 KiB447347

ChangeLogH A D14-Aug-20205.9 MiB213,911133,958

CodingStyleH A D14-Aug-20204.1 KiB7051

EXAMPLE.conf.defH A D14-Aug-20206.8 KiB194146

FAQH A D14-Aug-2020167.6 KiB4,0572,923

INSTALLH A D14-Aug-202010.9 KiB280212

Makefile.amH A D14-Aug-202024 21

Makefile.inH A D03-May-202213.6 KiB469328

Makefile.rulesH A D14-Aug-202015.3 KiB498401

Makefile.topH A D14-Aug-20203.7 KiB12475

NEWSH A D14-Aug-202069.6 KiB1,7701,479

PORTINGH A D14-Aug-20203.5 KiB10579

READMEH A D14-Aug-20208.9 KiB253183

README.agent-mibsH A D14-Aug-202020.2 KiB463393

README.agentxH A D14-Aug-20202 KiB4835

README.aixH A D14-Aug-20202.6 KiB7952

README.hpux11H A D14-Aug-20201,012 2317

README.irixH A D14-Aug-20201.8 KiB5738

README.krb5H A D14-Aug-20206.2 KiB166116

README.osXH A D14-Aug-20202.3 KiB6242

README.snmpv3H A D14-Aug-20204 KiB10676

README.solarisH A D14-Aug-202042.8 KiB1,312912

README.sqlH A D14-Aug-2020740 3019

README.systemdH A D14-Aug-20201.9 KiB4134

README.threadH A D14-Aug-202013.5 KiB344273

README.tru64H A D14-Aug-20201.5 KiB5837

README.win32H A D14-Aug-202043.3 KiB1,164837

TODOH A D14-Aug-20201.4 KiB6153

aclocal.m4H A D14-Aug-20201 KiB2722

config.guessH A D14-Aug-202044 KiB1,5061,295

config.subH A D14-Aug-202034.2 KiB1,7401,591

configureH A D03-May-2022959.1 KiB34,56928,498

configure.acH A D14-Aug-20205.3 KiB158142

dotgdbinitH A D14-Aug-20203 KiB139126

doxygen.confH A D14-Aug-202032.5 KiB839123

install-shH A D14-Aug-202013.5 KiB525348

ltmain.shH A D14-Aug-2020316.5 KiB11,1487,979

maketargetH A D14-Aug-20201.1 KiB6457

mkinstalldirsH A D14-Aug-2020671 4123

net-snmp-config.inH A D14-Aug-202020.8 KiB765664

net-snmp-create-v3-user.inH A D14-Aug-20203 KiB145129

netsnmp-agent.pc.inH A D14-Aug-2020419 1311

netsnmp.pc.inH A D14-Aug-2020370 1311

sedscript.inH A D14-Aug-20203.4 KiB11096

stamp-hH A D20-Aug-202010 21

stamp-h.inH A D20-Aug-202010 21

README

1	       README file for net-snmp Version: 5.9
2
3DISCLAIMER
4
5  The Authors assume no responsibility for damage or loss of system
6  performance as a direct or indirect result of the use of this
7  software.  This software is provided "as is" without express or
8  implied warranty.
9
10TABLE OF CONTENTS
11
12  Disclaimer
13  Table Of Contents
14  Introduction
15* Supported Architectures
16  Availability
17  Web Page
18* Installation
19  Copying And Copyrights
20* Frequently Asked Questions
21  Helping Out
22* Code Update Announcements
23* Mailing Lists
24  Agent Extensibility
25  Example Agent Configuration and Usage
26  Configuration
27  Submitting Bug Reports
28  Closing
29  Thanks
30
31  * = Required Reading.
32
33INTRODUCTION
34
35  This package was originally based on the CMU 2.1.2.1 snmp code.  It
36  has been greatly modified, restructured, enhanced and fixed.  It
37  hardly looks the same as anything that CMU has ever released.  It
38  was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from
39  ucd-snmp to net-snmp in November 2000.
40
41  This README file serves as a starting place to learn about the
42  package, but very little of the documentation is contained within
43  this file.  The FAQ is an excellent place to start as well.
44  Additionally, there are a bunch of README files for specific
45  architectures and specific features.  You might wish to look at some
46  of these other files as well.
47
48SUPPORTED ARCHITECTURES
49
50  Please see the FAQ for this information.
51
52  Please let us know if you compile it on other OS versions and it
53  works for you so we can add them to the above list.
54
55  Porting:  Please! read the PORTING file.
56
57  Also note that many architecture have architecture specific README
58  files, so you should check to see if there is one appropriate to
59  your platform.
60
61AVAILABILITY
62
63  Download:
64    - http://www.net-snmp.org/download/
65  Web page:
66    - http://www.net-snmp.org/
67  Project Wiki:
68    - http://www.net-snmp.org/wiki/
69  Sourceforge Project page:
70    - http://sourceforge.net/projects/net-snmp
71
72  The old ucd-snmp.ucdavis.edu web site and ftp server is now
73  offline and should not be accessed any longer.
74
75WEB PAGES
76
77  http://www.net-snmp.org/
78  http://sourceforge.net/projects/net-snmp
79  http://www.net-snmp.org/wiki/
80
81INSTALLATION
82
83  See the INSTALL file distributed with this package.
84
85COPYING AND COPYRIGHTS
86
87  See the COPYING file distributed with this package.
88
89FREQUENTLY ASKED QUESTIONS
90
91  See the FAQ file distributed with this package.
92  This is also available on the project Wiki at
93
94     http://www.net-snmp.org/wiki/index.php/FAQ
95
96  so that the wider Net-SNMP community can help maintain it!
97
98HELPING OUT
99
100  This is a project worked on by people around the net.  We'd love
101  your help, but please read the PORTING file first.  Also, subscribe
102  to the net-snmp-coders list described below and mention what you're
103  going to work on to make sure no one else is already doing so!
104  You'll also need to keep up to date with the latest code snap shot,
105  which can be obtained from CVS using the information found at
106  http://www.net-snmp.org/cvs/.
107
108  Contributions to the Net-SNMP source code in any form are greatly
109  appreciated.  We expect the parties providing such contributions to
110  have the right to contribute them to the Net-SNMP project or that
111  the parties that do have the right have directed the person
112  submitting the contribution to do so.  In addition, all contributors
113  need to be aware that if the contribution is accepted and
114  incorporated into the Net-SNMP project, it will be redistributed
115  under the terms of the license agreement used for the entire body of
116  work that comprises the Net-SNMP project (see the COPYING file for
117  details).  If this license agreement ever changes the contribution
118  will continue to be released under any new licenses as well.  Thank
119  you, in advance, for your gracious contributions.
120
121CODE UPDATE ANNOUNCEMENTS
122
123  See the NEWS file and the ChangeLog file for details on what has
124  changed between releases.
125
126  We hate broadcasting announce messages to other mailing lists and
127  newsgroups, so there is a mailing list set up to handle release
128  announcements.  Any time we put new software out for ftp, we'll mail
129  this fact to net-snmp-announce@lists.sourceforge.net.  See the
130  MAILING LISTS section described below to sign up for these
131  announcements.
132
133  We will post new announcements on a very infrequent basis to the
134  other channels (the other snmp mailing lists and newsgroups like
135  comp.protocols.snmp), but only for major code revisions and not for
136  bug-fix patches or small feature upgrades.
137
138MAILING LISTS
139
140  The lists:
141
142    A number of mailing lists have been created for support of the project:
143    The main ones are:
144
145      net-snmp-announce@lists.sourceforge.net  -- For official announcements
146      net-snmp-users@lists.sourceforge.net     -- For usage discussions
147      net-snmp-coders@lists.sourceforge.net    -- For development discussions
148
149    The -coders list is intended for discussion on development of code
150    that will be shipped as part of the package.  The -users list is
151    for general discussion on configuring and using the package,
152    including issues with coding user-developed applications (clients,
153    managers, MIB modules, etc).
154
155    Please do *NOT* send messages to both -users and -coders lists.
156    This is completely unnecessary, and simply serves to further
157    overload (and annoy) the core development team.   If in doubt,
158    just use the -users list.
159
160
161    The other lists of possible interest are:
162
163      net-snmp-cvs@lists.sourceforge.net       -- For cvs update announcements
164      net-snmp-bugs@lists.sourceforge.net      -- For Bug database update announcements
165      net-snmp-patches@lists.sourceforge.net   -- For Patch database update announcements
166
167    Please do NOT post messages to these lists (or to the announce list above).
168    Bug reports and Patches should be submitted via the Source Forge tracker
169    system.  See the main project web pages for details.
170
171    To subscribe to any of these lists, please see:
172
173      http://www.net-snmp.org/lists/
174
175
176  Archives:
177    The archives for these mailing lists can be found by following links at
178
179      http://www.net-snmp.org/lists/
180
181AGENT EXTENSIBILITY
182
183  The agent that comes with this package is extensible through use of
184  shell scripts and other methods.  See the configuration manual pages
185  (like snmpd.conf) and run the snmpconf perl script for further details.
186
187  You can also extend the agent by writing C code directly.  The agent
188  is extremely modular in nature and you need only create new files,
189  re-run configure and re-compile (or link against its libraries).  No
190  modification of the distributed source files are necessary.  See the
191  following files for details on how to go about this:
192  http://www.net-snmp.org/tutorial-5/toolkit/,
193  agent/mibgroup/examples/*.c
194
195  Also, see the local/mib2c program and its README file for help in
196  turning a textual mib description into a C code template.
197
198  We now support AgentX for subagent extensibility.  The net-snmp
199  agent can run as both a master agent and a subagent.  Additionally,
200  a toolkit is provided that enables users of it to easily embed a
201  agentx client into external applications.  See the tutorial at
202  http://www.net-snmp.org/tutorial-5/toolkit/ for an example of how
203  go about doing this.
204
205CONFIGURATION
206
207  See the man/snmp.conf.5 manual page.
208
209  For the agent, additionally see the man/snmpd.conf.5 manual page.
210
211  For the snmptrapd, see the man/snmptrapd.conf.5 manual page.
212
213  You can also run the snmpconf perl script to help you create some of
214  these files.
215
216SUBMITTING BUG REPORTS
217
218  Important: *Please* include what version of the net-snmp (or
219  ucd-snmp) package you are using and what architecture(s) you're
220  using, as well as detailed information about exactly what is wrong.
221
222  To submit a bug report, please use the web interface at
223  http://www.net-snmp.org/bugs/.  It is a full-fledged
224  bug-tracking system that will allow you to search for already
225  existing bug reports as well as track the status of your report as
226  it is processed by the core developers.
227
228  If you intend to submit a patch as well, please read the PORTING
229  file before you do so and then submit it to
230  http://www.net-snmp.org/patches/.
231
232CLOSING
233
234  We love patches.  Send some to us!  But before you do, please see
235  the 'PORTING' file for information on helping us out with the
236  process of integrating your patches (regardless of whether its a new
237  feature implementation or a new port).
238
239  Also, We're interested if anyone actually uses/likes/hates/whatever
240  this package...  Mail us a note and let us know what you think of it!
241
242  Have fun and may it make your life easier,
243
244    The net-snmp developers
245
246THANKS
247
248  This project has been graciously supported by a long list of people
249  (too long to keep roperly up to date).  To them we owe our deepest
250  thanks (and you do too!).  Please see the git log or ChangeLog file,
251  where the core developers are careful to have (hopefully always)
252  pointed out where patches have come from.
253

README.agent-mibs

1The following is a list of SNMP MIB tables and object, and their
2implementation status for Net-SNMP.
3
4Note that simply adding a MIB file does not allow the agent to return values
5for the MIB. See the FAQ question here for details:
6
7   http://www.net-snmp.org/FAQ.html#How_do_I_add_a_MIB_to_the_agent_
8
9
10This table was generated by inspecting the source, so it may be incorrect,
11especially with regards to OS platform support. If an object/table is listed
12for your OS but doesn't work (or vice-cersa), let us know.
13
14The Rel column indicates the first release that an object/table was
15available. That does not imply that  all platforms indicated in the OS
16column were supported for that release. There is no breakdown of feature
17introduction by platform. Note that the earliest CVS information I could
18find was for sometime around ucd-snmp 3.2.
19
20The OS platform is probably the least reliable of the columns, as most are
21marked as 'unix?', indicating that most unix-based platforms should
22support the table.
23
24An '=' in a file path indicates that the table/object name should be
25substituted in place of the '=' in the path. All paths are relative to
26the agent/mibgroup directory.
27
28X.*.0 indicates all scalars under node X.
29X.?.0 indicates all scalars execept as noted.
30.Y.0 indicates that Y is an exception to the previous scalar group.
31
32
33Table Style
34----------------------------
35  O  old (ucd) style helper
36  D  table data helper
37  I  table iterator
38  A  iterate_access
39  S  scalar helper
40  G  scalar group helper
41  W  watched scalar
42  M  mfd
43  C  container table
44
45Platform Keys
46------------------
47A All systems
48U unix based
49   L Linux
50   S Solaris
51   H HP-UX
52   B BSD Based
53     F FreeBSD
54     O OpenBSD
55     N NetBSD
56     X MacOSX
57W Win32 based
58  $ Microsoft
59  C cygwi---
60  M MingW
61
62A number after a platform indicates notes at the bottom of the file.
63
64 table/object group           OS       Rel   Styl File
65==============================================================================
66SNMPv2-MIB
67 system.?.0                   A         5.5     W mibII/system_mib.c
68 .sysORLastChange.0           A         5.5     W mibII/sysORTable.c
69 sysORTable                   A         5.5     C mibII/sysORTable.c
70 snmp.*.0                     A         5.5     G mibII/snmp_mib.c
71 setSerialNo.0                A         5.0     W mibII/setSerialNo.c
72
73------------------------------------------------------------------------------
74SNMP-FRAMEWORK-MIB
75 snmpEngine.*.0               A         ~4.0?   O snmpv3/snmpEngine.c
76
77------------------------------------------------------------------------------
78SNMP-MPD-MIB
79 snmpMPDStats.*.0             A         ~4.0?   G snmpv3/snmpMPDStats.c
80
81------------------------------------------------------------------------------
82SNMP-TARGET-MIB
83 snmpTargetSpinLock.0         A         3.6     O target/snmpTargetAddrEntry.c
84 snmpTargetAddrTable          A         3.6     O target/snmpTargetAddrEntry.c
85 snmpTargetParamsTable        A         3.6     O target/snmpTargetParamsEntry.c
86 snmpUnavailableContexts.0    A         5.5     G target/target_counters.c
87 snmpUnknownContexts.0        A         5.5     G target/target_counters.c
88
89------------------------------------------------------------------------------
90SNMP-NOTIFICATION-MIB
91 snmpNotifyTable              A         4.2     O notification/=
92 snmpNotifyFilterProfileTable A         4.2     O notification/=
93 snmpNotifyFilterTable        A         4.2     O notification/=
94 nlmConfig.*.0                ---
95 nlmStats.*.0                 ---
96
97------------------------------------------------------------------------------
98NOTIFICATION-LOG-MIB
99 *                            ---
100
101------------------------------------------------------------------------------
102SNMP-PROXY-MIB
103 snmpProxyTable               ---
104
105------------------------------------------------------------------------------
106SNMP-USER-BASED-SM-MIB
107 usmStats.*.0                 A         ~4.0    O --- deleted ---
108 usmStats.*.0                 A         5.5     G snmpv3/usmStats.c
109 usmUserTable                 A         ~4.0?   O snmpv3/usmUser.c
110
111------------------------------------------------------------------------------
112SNMP-VIEW-BASED-ACM-MIB
113 vacmContextTable             A         ~3.5    I mibII/vacm_context.c
114 vacmSecurityToGroupTable     A         ~3.5    O
115 vacmAccessContextTable       A         ~3.5    O mibII/vacm_vars.c
116 vacmViewSpinLock.0           A         ~3.5    O
117 vacmViewTreeFamilyTable      A         ~3.5    O
118
119------------------------------------------------------------------------------
120SNMP-USM-DH-OBJECTS-MIB
121 usmDHPublicObjects.*.0       A         5.2     S snmp-usm-dh-objects-mib/=/*
122 usmDHUserKeyTable            A         5.2     M snmp-usm-dh-objects-mib/=/*
123 usmDHKickstartTable          ---
124
125------------------------------------------------------------------------------
126SNMP-COMMUNITY-MIB
127 snmpCommunityMIBObjects.*.0  ---
128 snmpCommunityTable           ---
129 snmpTargetAddrExtTable       ---
130
131------------------------------------------------------------------------------
132IF-MIB
133 ifNumber.0                   U $2      ~3.2    O mibII/interfaces.c
134 ifTableLastChange.0          ---
135 ifTable (old)                U $2      ~3.5    O mibII/interfaces.c
136 ifTable (new)                L         5.2     M if-mib/ifTable/*
137 ifTable (new)                 FOS      5.4     M if-mib/ifTable/*
138 ifXTable                     L         5.2     M if-mib/ifXTable/*
139 ifXTable                      FOS      5.4     M if-mib/ifXTable/*
140 ifStackLastChange.0          ---
141 ifStackTable                 ---
142 ifTestTable                  ---
143 ifRcvAddressTable            ---
144
145------------------------------------------------------------------------------
146RFC1213-MIB
147 atTable (D)                  U $2      ~3.5    O mibII/at.c
148 egp.*.0                      ---
149 egpNeighTable                ---
150
151------------------------------------------------------------------------------
152IP-MIB
153 ip.*.0                       U $2      ~3.2    G mibII/ip.c
154 icmp.*.0                     U $2      ~3.2    G mibII/icmp.c
155
156 ipSystemStatsTable           L         5.2     M ip-mib/=/*
157 ipSystemStatsTable            S        5.5     M ip-mib/=/*
158 ipIfStatsTableLastChange.0   ---
159 ipIfStatsTable               L--       5.5     M ip-mib/=/*
160
161 ipAddrTable (D)              U $2      4.2     O mibII/ipAddr.c
162 ipAddressSpinLock.0          A         5.5     O mibII/ipAddr.c
163 ipAddressTable               L         5.2     M ip-mib/=/*
164 ipAddressTable                S        5.5     M ip-mib/=/*
165 ipAddressPrefixTable         L         5.3     M ip-mib/=/*
166
167 ipRouteTable (D)             U $2      ~3.5    O mibII/*route*.c
168 ipNetToMediaTable (D)        U $2      ~3.5    O mibII/at.c
169 ipNetToPhysicalTable         (implemented as inetNetToMediaTable)
170 inetNetToMediaTable          L         5.2     M ip-mib/=/*
171 ipDefaultRouterTable         L         5.5     M ip-mib/=/*
172
173 icmpStatsTable               ---
174 icmpMsgStatsTable            ---
175
176 ipv4InterfaceTableLastChange ---
177 ipv4InterfaceTable           L          5.3    M ip-mib/=/*
178
179 ipv6InterfaceTableLastChange ---
180 ipv6InterfaceTable           L          5.3    M ip-mib/=/*
181 ipv6RouterAdvertTable        ---
182 ipv6IpForwarding.0           L          5.3    S ip-mib/ip_scalars.c
183 ipv6IpDefaultHopLimit.0      L          5.3    S ip-mib/ip_scalars.c
184 ipv6RouterAdvertSpinLock.0   ---
185 ipv6ScopeZoneIndexTable      ---
186
187 ipForwarding.0               L          5.4    S ip-mib/ip_scalars.c
188 ipDefaultTTL.0               L          5.4    S ip-mib/ip_scalars.c
189
190------------------------------------------------------------------------------
191IPV6-MIB
192 ipv6MIBObjects.?.0           U         4.1     O mibII/ipv6.c
193 .ipv6IfTableLastChange.0     ---
194 .ipv6RouteNumber.0           ---
195 .ipv6DiscardedRoutes.0       ---
196 ipv6Interfaces               U1        4.1     O mibII/ipv6.c
197 ipv6IfTable                  U1        4.1     O mibII/ipv6.c
198 ipv6IfStatsTable             U1        4.1     O mibII/ipv6.c
199 ipv6AddrPrefixTable          ---
200 ipv6AddrTable                ---
201 ipv6RouteTable               ---
202 ipv6NetToMediaTable          ---
203
204------------------------------------------------------------------------------
205IPV6-TCP-MIB
206 ipv6TcpConnTable             U1        4.1     O mibII/ipv6.c
207
208------------------------------------------------------------------------------
209IPV6-UDP-MIB
210 ipv6UdpTable                 U1        4.1     O mibII/ipv6.c
211
212------------------------------------------------------------------------------
213IPV6-ICMP-MIB
214 ipv6IfIcmpTable              U1        4.1     O mibII/ipv6.c
215
216------------------------------------------------------------------------------
217IP-FORWARD-MIB
218 ipForward.*.0                ---
219 ipForwardTable (D)           ---
220 ipCidrRouteTable (D)(new)    L         5.2     A mibII/=
221 ipCidrRouteTable (D)(newer)  L         5.2     M ip-forward-mib/=/*
222 inetCidrRouteTable           L         5.2     M ip-forward-mib/=/*
223
224------------------------------------------------------------------------------
225TCP-MIB
226 tcp.*.0                      U $2      ~3.2    G mibII/tcp.c
227 tcpConnTable (D)             U $2      4.2     I mibII/tcpTable.c
228 tcpConnectionTable           L         5.3     M tcp-mib/=/*
229 tcpConnectionTable            S        5.4     M tcp-mib/=/*
230 tcpListenerTable             L         5.3     M tcp-mib/=/*
231 tcpListenerTable              S        5.4     M tcp-mib/=/*
232
233------------------------------------------------------------------------------
234UDP-MIB
235 udpEndpointTable             L         5.3     M udp-mib/=/*
236 udpEndpointTable              S        5.4     M udp-mib/=/*
237 udp.*.0                      U $2      ~3.2    G mibII/udp.c
238 udpTable (D)                 U $2      4.2     I mibII/udpTable.c
239
240------------------------------------------------------------------------------
241IF-INVERTED-STACK-MIB
242 *                           ---
243
244------------------------------------------------------------------------------
245RMON-MIB
246 etherStatsTable              U         5.0     O Rmon/statistics.c
247 .etherStatsJabbers           L3        5.5     M rmon-mib/=/*
248 etherHistoryControlTable     U         5.0     O Rmon/history.c
249 etherHistoryTable            U         5.0     O Rmon/history.c
250 alarmTable                   U         3.2     O Rmon/alarm.c
251 eventTable                   U         3.2     O Rmon/event.c
252 logTable                     U         5.0     O Rmon/event.c
253 hostControlTable             ---
254 hostTable                    ---
255 hostTimeTable                ---
256 hostTopNControlTable         ---
257 hostTopNTable                ---
258 matrixControlTable           ---
259 matrixSDTable                ---
260 matrixDSTable                ---
261 filterTable                  ---
262 channelTable                 ---
263 bufferControlTable           ---
264 captureBufferTable           ---
265
266------------------------------------------------------------------------------
267HOST-RESOURCES-MIB
268 hrSystem.*.0                 U         ~3.3    O host/hr_system.c
269 hrMemorySize                 U         ~3.3    O host/hr_storage.c
270 hrStorageTable               U         ~3.3    O host/hr_storage.c
271 hrDeviceTable                U         ~3.3    O host/hr_device.c
272 hrProcessorTable             U         ~3.3    O host/hr_proc.c
273 hrNetworkTable               U         ~3.3    O host/hr_network.c
274 hrPrinterTable               U         ~3.3    O host/hr_print.c
275 hrDiskStorageTable           U         ~3.3    O host/hr_disk.c
276 hrPartitionTable             U         ~3.3    O host/hr_partition.c
277 hrFSTable                    U         ~3.3    O host/hr_filesys.c
278 hrSWOSIndex.0                ---       ~3.3    O host/hr_swrun.c
279 hrSWRunTable                 U         ~3.3    O host/hr_swrun.c
280 hrSWRunPerfTable             U         ~3.3    O host/hr_swrun.c
281 hrSWInstalled.*.0            U         ~3.3    O host/hr_swinst.c
282 hrSWInstalledTable           U         ~3.3    O host/hr_swinst.c
283
284------------------------------------------------------------------------------
285DISMAN-EVENT-MIB
286 mteTriggerTable              A         5.0     O disman/=
287 mteTriggerFailures.0         ---
288 mteTriggerDeltaTable         A         5.0     O disman/=
289 mteTriggerExistenceTable     A         5.0     O disman/=
290 mteTriggerBooleanTable       A         5.0     O disman/=
291 mteTriggerThresholdTable     A         5.0     O disman/=
292 mteObjectsTable              A         5.0     O disman/=
293 mteEventTable                A         5.0.7   D disman/=
294 mteEventFailures.0           ---
295 mteEventNotificationTable    A         5.0.7   D disman/=
296 mteResource.*.0              ---
297 mteEventSetTabel             ---
298
299------------------------------------------------------------------------------
300DISMAN-SCHEDULE-MIB
301 schedLocalTime.0             A         5.3     D disman/schedule/=
302 schedTable                   A         5.3     D disman/schedule/=
303
304------------------------------------------------------------------------------
305DISMAN-EXPRESSION-MIB (expired ID)
306 expErrorTable                U         5.2     O disman/expression/=
307 expExpressionTable           U         5.2     O disman/expression/=
308 expObjectTable               U         5.2     O disman/expression/=
309 expValueTable                U         5.2     O disman/expression/=
310
311------------------------------------------------------------------------------
312DISMAN-PING-MIB (draft-ietf-disman-remops-mib-v2*)
313 pingCtlTable                 U         5.2     O disman/ping/=
314 pingProbeHistoryTable        U         5.2     O disman/ping/=
315 pingResultsTable             U         5.2     O disman/ping/=
316
317------------------------------------------------------------------------------
318DISMAN-TRACEROUTE-MIB (draft-ietf-disman-remops-mib-v2*)
319 traceRouteCtlTable           U         5.2     O disman/traceroute/=
320 traceRouteHopsTable          U         5.2     O disman/traceroute/=
321 traceRouteProbeHistory       U         5.2     O disman/traceroute/=
322 traceRouteResultsTable       U         5.2     O disman/traceroute/=
323
324------------------------------------------------------------------------------
325DISMAN-NSLOOKUP-MIB (draft-ietf-disman-remops-mib-v2*)
326 lookupCtlTable               U         5.2     O disman/nslookup/=
327 lookupResultsTable           U         5.2     O disman/nslookup/=
328
329------------------------------------------------------------------------------
330DISMAN-SCRIPT-MIB
331 *                            ---
332
333------------------------------------------------------------------------------
334EtherLike-MIB
335 dot3StatsTable               L        5.5      M etherlike-mib/=
336
337------------------------------------------------------------------------------
338AGENTX-MIB
339 *                            ---
340
341------------------------------------------------------------------------------
342LM-SENSORS-MIB
343 lmTempSensorsTable           LS        5.0     O ucd-snmp/lmSensors.c
344 lmFanSensorsTable            LS        5.0     O ucd-snmp/lmSensors.c
345 lmVoltSensorsTable           LS        5.0     O ucd-snmp/lmSensors.c
346 lmMiscSensorsTable           LS        5.0     O ucd-snmp/lmSensors.c
347
348------------------------------------------------------------------------------
349UCD-SNMP-MIB
350 prTable                      U $       ~3.2    O ucd-snmp/proc.c
351 memory.*.0                   U         ~3.2    O ucd-snmp/memory*.c
352 extTable                     U $       ~3.2    D ucd-snmp/extensible.c
353 dskTable                     U         3.2     O ucd-snmp/disk.c
354 fileTable                    A         3.6     O ucd-snmp/file.c
355 laTable                      U $       ~3.2    O ucd-snmp/loadave.c
356 systemStats.*.0              U         3.4     O ucd-snmp/vmstat*.c
357 ipFwAccTable                 U         3.5     O misc/ipfwacc.c
358 dlModTable                   U         4.2     O ucd-snmp/dlmod.c
359 diskIOTable                  U         4.1     O ucd-snmp/diskio.c
360 ucdDemoMIBObjects            A         ~3.5    O examples/ucdDemoPublic.c
361 logMatch                     U         ~3.5    O ucd-snmp/logmatch.c
362 version.*.0                  A         ~3.2    O ucd-snmp/versioninfo.c
363 snmperrs.*.0                 A         ~3.5    O ucd-snmp/errormib.c
364 mrTable (D)                  ---
365
366------------------------------------------------------------------------------
367NET-SNMP-EXTEND-MIB
368 nsExtendConfigTable          U         ~3.5    D agent/extend.c
369 nsExtendOutput1Table         U         ~3.5    D agent/extend.c
370 nsExtentOutput2Table         U         ~3.5    D agent/extend.c
371
372------------------------------------------------------------------------------
373NET-SNMP-AGENT-MIB
374 nsModuleTable                A         5.0     I agent/nsModuleTable.c
375 nsCacheTable                 A         5.0     I agent/nsCache.c
376 nsConfigDebug.*.0            A         5.0     I agent/nsDebug.c
377 nsDebugTokenTable            A         5.0     O
378 nsConfigLogging              A         5.0     I agent/nsLogging.c
379 nsLoggingTable               A         5.0     O
380 nsTransactionTable           A         5.0     I agent/nsTransactionTable.c
381 netSnmpExampleScalars        A         5.0     O
382 netSnmpIETFWGTable           A         5.0     D examples/data_set.c
383 netSnmpHostsTable            A         5.0     A examples/=*
384 nstAgentModules              A         5.0     O
385
386------------------------------------------------------------------------------
387NET-SNMP-VACM-MIB
388 nsVacmAccessTable            A         5.4     I agent/nsVacmAccessTable.c
389
390------------------------------------------------------------------------------
391MTA-MIB
392 mtaTable                     U         4.2     O mibII/mta_sendmail.c
393 mtaGroupTable                U         4.2     O mibII/mta_sendmail.c
394
395------------------------------------------------------------------------------
396SMUX-MIB
397 smuxPeerTable                ---
398 smuxTreeTable                ---
399
400------------------------------------------------------------------------------
401BGP4-MIB (draft-ietf-idr-bgp4-mib)
402 bgpPeerTable                 A         3.5     O smux/snmp_bgp.c
403
404------------------------------------------------------------------------------
405OSPF-MIB (draft-ietf-ospf-mib-update)
406 *                            A         3.5     O smux/snmp_ospf.c
407
408------------------------------------------------------------------------------
409RIPv2-MIB
410 *                            A         3.5     O smux/snmp_rip2.c
411
412------------------------------------------------------------------------------
413TUNNEL-MIB
414 tunnelIfTable                L         4.2     O tunnel/tunnel.c
415 tunnelConfigTable            L         4.2     O tunnel/tunnel.c
416 tunnelInetConfigTable        ---
417
418------------------------------------------------------------------------------
419SCTP-MIB
420 sctpStats                    L         5.5     S sctp-mib/sctpScalars*
421 sctpParameters               L         5.5     S sctp-mib/sctpScalars*
422 sctpAssocTable               L         5.5     C sctp-mib/=
423 sctpAssocLocalAddrTable      L         5.5     C sctp-mib/=
424 sctpAssocRemAddrTable        L         5.5     C sctp-mib/=
425 sctpLookupLocalPortTable     L         5.5     C sctp-mib/=
426 sctpLookupRemPortTable       L         5.5     C sctp-mib/=
427 sctpLookupRemHostNameTable   L         5.5     C sctp-mib/=
428 sctpLookupRemPrimIPAddrTable L         5.5     C sctp-mib/=
429 sctpLookupRemIPAddrTable     L         5.5     C sctp-mib/=
430
431------------------------------------------------------------------------------
432SNMP-TSM-MIB
433 snmpTsmStats                 A         5.6     D tsm-mib/snmpTsmStats/=
434 snmpConfiguration            A         5.6     W tsm-mib/=
435
436------------------------------------------------------------------------------
437TLSTM-MIB
438 snmpTlstmSession             A         5.6     W tlstm-mib/=/*
439 tlstmCertificateMapping.*    A         5.6     w tlstm-mib/=
440 tlstmCertToTSNTable          A         5.6     D tlstm-mib/=/*
441 tlstmParamsTable             A         5.6     D tlstm-mib/=/*
442 tlstmAddrTable               A         5.6     D tlstm-mib/=/*
443
444==============================================================================
445
446Misc notes
447----------
448 1: available for systems using KAME ipv6
449 2: with platform SDK. See README.win32
450 3: works only with Intel and Broadcom network cards and must run as root only
451
452Other feature info
453------------------
454 smux                                     3.2
455 AgentX                                   4.0
456 proxy support                            4.2
457 override token                           5.0
458 proper context support                   5.2
459 DISMAN-EVENT-MIB implementation rewrite  5.3
460 AgentX, host, disman/event by default    5.3
461 SSH Transport module                     5.5
462 (D)TLS Transport module                  5.6
463

README.agentx

1  Net-SNMP contains a reasonably full implementation of the AgentX agent
2extensibility protocol (RFC 2741) in as much as it supports all
3the protocol operations described in this document.  The core
4functionality has received a reasonable amount of exposure, and
5is believed to be more or less stable in normal use.   It will
6also handle the non-graceful termination of subagents - returning
7a 'genErr' error for three successive requests before unregistering
8the unresponsive subagent.
9
10  A subagent will attempts to re-establish contact with a dead and
11resurrected master based on the agentxPingInterval setting. The default
12for this configuration variable is 15 seconds. It can be changed by
13putting the following line in your APPLICATION.conf file:
14
15                agentxPingInterval 60
16
17will make the subagent try to ping the master every 60 seconds, and if
18the connection is deemed broken it'll try and reconnect to the master
19agent after that point (once every 60 seconds).
20
21  Similarly, a subagent will not be able to re-register in place of a
22defunct colleague until the master agent has received three requests
23for the dead connection (and hence unregistered it).
24
25  Some of the less frequently used features (index allocation,
26range registration, etc), have received less thorough testing,
27and may well not be fully functional.   Some of the omissions
28of the earlier release (use of GetBulk, the AgentX MIB)
29are still missing from this version.
30
31  AgentX support is now included in the agent by default, but needs
32to be explicitly enabled before use.  Activate it using by putting a line
33
34		master	agentx
35
36in the snmpd.conf file.  This support is also enabled automatically
37when the '-x' flag is given (to specify a different master AgentX socket),
38or when the agent is invoked as an AgentX subagent (i.e. via the name
39'agentxd' or with the '-X' flag).
40
41  See the main project web page for an examples of a simple stand-alone
42subagent.  (http://www.net-snmp.org/tutorial/tutorial-5/toolkit/)
43
44
45  Please report any problems experienced to the net-snmp-coders list.
46
47Dave
48

README.aix

1Some notes for the AIX port
2===========================
3
41. Known problems
5-----------------
6
7There are the following known problems on AIX:
8
91) Shared libraries / embedded perl
10
11Up to (and including) net-snmp 5.4, configure forced a static build
12on AIX which caused embedded Perl to be disabled as well.
13
14Starting with net-snmp 5.4.1, we build shared libraries by default on AIX
15(like on any other platform) using run-time linking. configure forces the
16use of the required "-brtl" linker flag.
17
18With net-snmp 5.5 the shared library build is broken again but the there is
19no forced static build - use --disable-shared when building.
20
212) "grep: capacity exceeded" or "sed: Command line is too long" during configure
22
23The version of "grep" shipped with AIX versions up to (and including) 5.1
24has a known limitation of only supporting a maximum of 2048 characters per line.
25This may cause a significant number of "grep: capacity exceeded" errors during
26configure which breaks the build. See bug 1367794 for details. The fix is to
27either install GNU grep (and have it in PATH before the AIX grep) or to upgrade
28to AIX 5.2 or later.
29
30There's a similar issue with AIX /usr/bin/sed up to at least AIX 5.3 that
31causes a significant number of "sed: Command line is too long." errors during
32configure. The fix is to install GNU sed.
33
343) nlist errors with 64-bit kernels
35
36Accessing certain MIB objects on AIX 5.x machines running a 64-bit kernel will
37trigger nlist/klookup errors. Starting from net-snmp 5.4, you can avoid those
38by using
39
40   ./configure --without-kmem-usage ...
41
42
434) IPv6
44
45Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
46on AIX 5.x:
47
48   ./configure --enable-ipv6
49
50There's no support for the IPv6 MIBs, though.
51
525) Compiler for Perl
53
54In general, Perl modules need to be compiled with the same compiler and
55compiler options as Perl itself. configure detects some mismatches (gcc vs.
56vendor compiler), but treats different incarnations of the same compiler type
57as similar. If your version of Perl (e.g. the one supplied by IBM for AIX 5.x)
58has been compiled with cc_r on AIX, please make sure you also use CC=cc_r when
59building net-snmp. Building with xlc in this case is known to fail (see bug
60#1600099).
61
62
632. Patches
64----------
65
66You may want to have a look for existing AIX patches in our patches tracker
67(http://www.net-snmp.org/patches/). If you can offer patches yourself to
68improve the AIX support, please submit them there.
69
70
713. Feedback
72-----------
73
74Please also see README and PORTING.
75
76If you have questions, additional insights or (even better) patches regarding
77net-snmp on AIX, please refer to the net-snmp mailing lists (see
78http://www.net-snmp.org/lists).
79

README.hpux11

1Some notes for the HP-UX 11.0/11i port
2======================================
3
41. Starting the net-snmp daemon via rc script
5---------------------------------------------
6
7When starting the net-snmp daemon via rc script you have to trap some signals
8because otherwise the daemon will die the moment the rc script ends. I trap
9the signals 1, 2 and 3 via "trap '' 1 2 3" immediately before starting the
10daemon. I didn't check whether all these signals need to be trapped, probably
11SIGHUP will suffice. BTW this applies to the HP-UX 10.x version as well. It
12would be a good idea to ignore or handle these signals in the daemon...
13
142. Author, credits, comments
15----------------------------
16
17The HP-UX 11.0 port was done by Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
18
19If you have questions or problems please feel free to contact me via the
20above mentioned e-mail address. Please send a copy of your e-mail to the
21net-snmp-coders mailing list - probably someone else can answer your
22question earlier than me;-)
23

README.irix

1Some notes for the IRIX port
2============================
3
41. Compiling
5------------
6
7net-snmp 5.3.1 and later have been compiled successfully on IRIX 6.5 using the
8MIPSpro C compiler 7.4.4m in C99 mode:
9
10	CC=c99 ./configure && make && make install
11
12Please note that the "host" module doesn't compile on IRIX, so you *cannot*
13configure with "--with-mib-modules=host".
14
15Compiling with gcc may be possible, but is unsupported at this point in time
16due to difficulties with the IRIX system headers. Brent Bice has reported
17a successful build of net-snmp 5.4 with gcc 3.4.6 on a IP30 machine using:
18
19	CFLAGS="-D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -DIP30 -DR10000 -DMP \
20	        -DCELL_PREPARE -DBHV_PREPARE" ./configure ...
21
22See http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0620/bks/\
23SGI_Developer/books/DevDriver_PG/sgi_html/ch10.html and
24/var/sysgen/Makefile.kernio .
25
262. CPU stats
27------------
28
29net-snmp 5.4.1 and later reports CPU statistics on IRIX 6.x by default using
30the hardware/cpu/cpu_sysinfo module. There's also an alternative implementation:
31hardware/cpu/cpu_pcp. For full discussion and build instructions for cpu_pcp
32see Patch #1675869:
33
34  http://sf.net/support/tracker.php?aid=1675869
35
36
373. Known Issues
38---------------
39
40Accessing certain MIB objects on IRIX64 machines (i.e. when running a 64-bit
41kernel will trigger nlist/klookup errors. The agent will not return proper
42values for the affected MIB objects (e.g. tcpConnTable, udpTable).
43Starting from net-snmp 5.4, you can avoid nlist altogether (recommended for
44IRIX64) by using
45
46   ./configure --without-kmem-usage ...
47
48
493. Feedback
50-----------
51
52Please also see README and PORTING.
53
54If you have questions, additional insights or (even better) patches regarding
55net-snmp on IRIX, please refer to the net-snmp mailing lists (see
56http://www.net-snmp.org/lists).
57

README.krb5

1This version of net-snmp supports an experimental SNMPv3 security model
2using Kerberos 5 for authentication.  The protocol is described in an
3up-and-coming IETF Internet-Draft.
4
5This document describes a brief overview of the Kerberos Security Model
6and how to use it.
7
8DESCRIPTION:
9
10The Kerberos Security Model does not use USM; it is completely seperate
11and is not tied to USM in any way.  It works by placing the following
12ASN.1 sequence inside of the SNMPv3 msgSecurityParameters:
13
14ksmSecurityParameters ::= SEQUENCE {
15-- The Kerberos 5 checksum type used to checksum this message
16    ksmChecksumType		INTEGER(0..2147483647),
17-- The actual keyed checksum data returned by Kerberos
18    ksmChecksum			OCTET STRING,
19-- The Kerberos 5 message (either an AP_REQ or AP_REP)
20    ksmKerberosMsg		OCTET STRING,
21-- The cached ticket identifier
22    ksmCachedTicket		INTEGER(0..2147483647)
23}
24
25Note that the whole SEQUENCE is BER encoded as an OCTET STRING.
26
27ksmChecksumType is an integer which corresponded to the checksum algorithm
28used to secure this message as defined by Kerberos (see section 8.3 of
29RFC1510).
30
31ksmChecksum is the output of the checksum algoritm defined by ksmChecksumtype
32(with all NULs in the space for the checksum).
33
34ksmKerberosMsg is a Kerberos 5 AP_REQ or AP_REP message, depending on
35whether or not it is a request or a response (AP_REQ for requests, AP_REP
36for responses).
37
38ksmCachedTicket is a integer which uniquely identifies a ticked already
39cached on the agent to save the overhead of transferring a whole AP_REQ/AP_REP.
40If there is no such cached ticket, it is left at zero.
41
42An agent, upon receiving a message using the KSM, will decode the AP_REQ
43contained within the security parameters and thus validate the client's
44identity.  Using the subkey contained within the AP_REQ, the agent will
45validate the checksum (after first clearing the checksum bytes to zero),
46and issue a response, encoding the appropriate AP_REP message in the
47ksmSecurityParameters.
48
49If the securityLevel of the message is set to AuthPriv, the scopedPdu
50payload will be encrypted using the encryption key and algorithm of the
51AP_REQ subkey.  Note that in this case, the msgData will be a BER-encoded
52OCTET STRING corresponding to the "cipher" element of the EncryptedData
53sequence defined in RFC 1510, section 6.1.
54
55Since this security model is experimental, the number assigned to this
56security model is taken from the recommendations of RFC 2271, section 5,
57which specify enterprise-specific Security Models of the form:
58
59	SnmpSecurityModel = enterpriseID * 256 + security model number
60						 in that enterprise ID;
61
62In the case of KSM this gives us:
63
64	SnmpSecurityModel = 8072 * 256 + 0 = 2066432
65
66
67USAGE:
68
69To actually USE the Kerberos Security Model, do the following:
70
710) Install Kerberos
72
73   Let it be stated up front - Installing Kerberos completely "cold", without
74   any Kerberos experience at all, can be daunting (to say the least).  If you
75   already have a Kerberos infrastructure at your site, then all of the hard
76   work has been done.  If you do NOT, but you still want to tackle it,
77   you might be interested in the Kerberos FAQ, which can be found at:
78
79   http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html
80
81   Currently the code in net-snmp only supports using MIT Kerberos
82   libraries to link against (you should be able to use any kind of Kerberos
83   server, however).
84
851) Compile net-snmp with Kerberos.
86
87   This assumes that you already have Kerberos libraries in place.
88
89   Configure net-snmp to include the Kerberos Security Model (ksm) and
90   use --with-cflags and --with-ldflags to specify the location and names
91   of Kerberos header files and libraries.  For example, on my system I
92   run:
93
94   ./configure --with-cflags='-I/usr/krb5/include' \
95      --with-ldflags='-L/usr/krb5/lib -lkrb5 -lcrypto -lcom_err -R/usr/krb5/lib'
96
97   Note that this is on Solaris, and that -R is required to set the correct
98   shared library path.  If you have a newer version of Kerberos, you might
99   instead have to use:
100
101   -lkrb5 -lk5crypto -lcom_err
102
103   as the libraries to link against.  If you get errors (for example, you
104   get a message that says the compiler isn't working) you can check
105   config.log for the output of the compiler.
106
1072) Configure Kerberos and SNMP
108
109   Currently, net-snmp uses the "host" principal assigned to a host.  This
110   may change in the future.  You will want to create host principals of
111   the form:
112
113   host/f.q.d.n@YOUR.REALM
114
115   For example:
116
117   host/mydesktop.example.org@EXAMPLE.ORG
118
119   and place the encryption keys for these principals on every machine you
120   wish to run a SNMP agent (you place each key on it's corresponding machine).
121   Your Kerberos documentation should explain how to do this (in the case
122   of MIT Kerberos, you want to look at the "ktadd" command inside of
123   kadmin).
124
125   If you have a Kerberos infrastructure, you likely already have these
126   principals in place on your systems.
127
128   If you're installing Kerberos for the first time as well, you also
129   need to create client principals corresponding to your userid.  See
130   your Kerberos documentation.
131
132   On the SNMP _agent_ side, you'll want to place in your snmpd.conf file
133   (the one that lives in /usr/local/share/snmp/snmpd.conf, or whereever
134   you have configured on your system):
135
136   rwuser -s ksm userid@YOUR.REALM
137
138   to allow the Kerberos principal 'userid@YOUR.REALM' read/write access to
139   the MIB tree.
140
1413) Run the agent and client applications
142
143   Note that before you do any of this, you will have to have valid Kerberos
144   credentials (generally acquired with the "kinit" program).
145
146   The agent should run without any additional flags.
147
148   You should run the client apps with the following flags:
149
150   -Y defSecurityModel=ksm
151   -v 3
152   -u username
153   -l authNoPriv
154
155   for example:
156
157   snmpget -v 3 -Y defSecurityModel=ksm -u myname -l authNoPriv testhost \
158						system.sysDescr.0
159
160   If you wish to encrypt the payload, change the -l argument to "authPriv".
161
162   If you run into problems, you can add the -Dksm flag to both the manager
163   applications and the agent to get more detailed Kerberos error messages.
164   Note that this setup assumes a working Kerberos infrastructure; if you
165   run into problems, check to make sure Kerberos is working for you.
166

README.osX

1README.osX
2$Id$
3
4This is what I had to do to get it to work for me. Your mileage may vary.
5If this doesn't work for you, or you have fixes for any problems listed,
6please post to <net-snmp-coders@lists.sourceforge.net>. Thanks!
7
8  - ALL
9
10    - nlist doesn't support icmpstat
11
12       - disable the icmp module during configure by specifying
13         "--with-out-mib-modules=mibII/icmp", or at startup by adding
14         "-I -icmp" to the snmpd command line.
15
16
17  - 10.4.7 (Universal) and Leopard with 5.4 sources:
18        [Supplied by Chris Jalbert]
19
20       - build using gcc 4.0 (see below) and configure using:
21                        --with-persistent-directory=/var/db/net-snmp \
22                        --with-defaults \
23                        --without-rpm \
24                        --with-mib-modules="host ucd-snmp/diskio" \
25                        --with-out-mib-modules="mibII/icmp host/hr_swrun" \
26                        --without-kmem-usage
27
28       The first line sets up persistent storage in the OS X standard location.
29
30       The third line is necessary because RPM is not properly disabled.
31
32       The fourth line includes those modules appear to build properly and
33       mostly work. The next line is necessary because those sub-modules
34       do not build.
35
36       The final line is necessary because /dev/kmem was removed in
37       the Intel / Universal builds of the OS, and I believe the APIs will
38       be removed in Leopard.
39         This line is the most critical for proper building on OS X.
40
41
42  - 10.3.x and earlier
43
44     - Some older versions of Apple's cpp doesn't like configure.
45
46        - run 'gcc_select' to see what version you are using, and
47          'gcc_select -l' to list available versions. I've had success with
48          3.3, selected by running (as root) 'gcc_select 3.3'. (Note: this was
49          on Panther, 10.3.2)
50
51     - Some older versions of net-snmp as installed by Apple contains
52       bad flags in net-snmp-config.
53
54       - build your own version, and install over Apple's version. The
55         configure flags you need for the same configuration:
56
57         configure --prefix=/usr --mandir=/usr/share/man
58                   --infodir=/usr/share/info --with-libwrap --with-defaults
59                   --prefix=/usr --with-persistent-directory=/var/db/ucd-snmp
60                   --with-mib-modules=host
61
62

README.snmpv3

1README.snmpv3
2-------------
3How to setup SNMPv3, a very brief document for Dave to elaborate and
4do a better job on since I suck at writing documentation and he
5doesn't ;-) --Wes:
6
7Note: SHA authentication and DES/AES encryption support is only available
8if you have OpenSSL installed or if you've compiled using
9--with-openssl=internal.  If you use --with-openssl=internal please
10read the documentation in snmplib/openssl/README for important details.
11
12Note: encryption support now *is* enabled in the binary releases downloadable
13from the net-snmp web site.
14
15Note: this description assumes you're using the software compiled from
16source, and so installed using the default prefix location (/usr/local).
17If you're working with a vendor-provided system, or have configured
18things with a different prefix, you'll need to adjust locations accordingly.
19
20CREATING THE FIRST USER:
21------------------------
22  First, you need to create a new snmpv3 user and give them rights to
23  do things:
24
25    net-snmp-config --create-snmpv3-user -a "my_password" myuser
26
27  WARNING: SNMPv3 pass phrases must be at least 8 characters long!
28
29  The above line creates the user "myuser" with a password of
30  "my_password" (and uses MD5 and DES for protection).  (Note that
31  encryption support isn't enabled in the binary releases downloadable
32  from the net-snmp web site.)  net-snmp-config will also add a line
33  to your snmpd.conf file to let that user have read/write access to
34  your agent.  You may want to change this in your snmpd.conf file
35  (see the snmpd.conf manual page).  Run net-snmp-config --help for
36  more information about it.
37
38  Start the agent and test your setup:
39    /usr/local/sbin/snmpd
40       [...wait a few seconds...  It will run in the background and
41        return you to your shell immediately.]
42
43    snmpget -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost sysUpTime.0
44       [ this should return information about how long your agent has been up]
45
46    snmpget -v 3 -u myuser -l authPriv   -a MD5 -A my_password
47                                         -x DES -X my_password localhost sysUpTime.0
48       [ this should return similar information, but encrypts the transmission ]
49
50CREATING A SECOND USER:
51-----------------------
52  Start the agent (if you didn't do so above).
53
54  You can create as many users as you like using the above method, but
55  this details another way of doing it while the agent is running by
56  modifying the user database using the snmp protocol itself:
57
58  Now, lets create a second user using the first user (just for fun)
59  for both authentication purposes and as a template (or "cloning
60  source"):
61
62    snmpusm -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost create wes myuser
63
64  The above should have created the user "wes" with the same password as
65  the "myuser" user.  So then, you need to change his password using:
66
67    snmpusm -v 3 -u wes -l authNoPriv -a MD5 -A my_password localhost passwd my_password new_passphrase
68
69  See, wasn't that easy?  You can now create users.  Wheeee....
70
71  But, you'll have to add a configuration line that allows them access
72  to do things.  Do this with another "rwuser" line in your
73  /usr/local/share/snmp/snmpd.conf file (you'll need to stop and start
74  the agent again, or send the agent a SIGHUP signal):
75
76    rwuser wes
77
78  Or, optional use the "rouser" token instead of the "rwuser" token to
79  only grant them read-only access.
80
81  Now, test your new user:
82
83    snmpget -v 3 -u wes -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
84
85
86FURTHER STUDIES:
87---------------
88
89Tired of all those command line authentication options?
90----------------------------------------
91put something like this in your $HOME/.snmp/snmp.conf file (make it
92readable only by you!!!):
93
94  defSecurityName wes
95  defContext ""
96  defAuthType MD5
97  defSecurityLevel authNoPriv
98  defAuthPassphrase new_passphrase
99  defVersion 3
100
101And this is in place the last of the above example lines boils down to:
102
103  snmpget localhost sysUpTime.0
104
105Which is about as simple as I can make it for ya ;-)
106

README.solaris

1README.solaris
2$Id$
3
4This document describes issues relating to compiling,
5installing and using net-snmp on Solaris.
6
70.  Introduction
81.  Things you will need
92.  Disabling Sun's SNMP daemons
103.  Compiling net-snmp
114.  Obtaining and installing binaries
125.  Creating snmpd.conf and testing
136.  Creating your own binaries
147.  Using Sun's SNMP daemon and net-snmp together
158.  Monitoring disks, processes and execs (DISMAN-EVENT-MIB)
169.  Monitoring CPU temp, fan and power supply sensors (LM-SENSORS-MIB)
1710.  MIB rewrites for IF-MIB, TCP-MIB and UDP-MIB
18
19Additional compilation issues:
20
2111.  Files descriptors and fopen
2212.  Perl
2313.  sed
2414.  OpenSSL and crle
2515.  IPv6
2616.  Wish list
27
28Other issues:
29
3017.  Known Bugs!!
3118.  Discussion and further information
32
33------------------------------------------------------------
34
350.  Introduction
36
37This document is a compilation of information relating to
38running net-snmp (www.net-snmp.org) on Sun SPARC and Ultra
39hardware under the Solaris operating system.
40
41This can be done either in conjunction with or as a
42replacement for Sun's SNMP daemons.
43
44This is discussed in detail in the sections below.  Since
45this is the work of several authors, credit is given.
46Discussion, however, should take place on the net-snmp-users
47or net-snmp-coders mailing lists so everybody can
48benefit.  See http://sourceforge.net/mail/?group_id=12694 .
49Use "net-snmp-users" for general usage questions and "net-snmp-coders" for
50discussion of net-snmp source code.
51
52No warranty is implied by this document.
53This document is copyright but usage allowed under the same
54licensing as net-snmp in general.  See http://www.net-snmp.org/COPYING.txt.
55
56------------------------------------------------------------
57
581.  Things you will need
59
60A.  Root access
61
62Root access is required to follow pretty much any of
63the steps below.  At a bare minimum, you will need
64to be able to start and stop daemons, which requires root
65(at least for the default ports).
66
67B.  Determine existing SNMP functionality
68
69SNMP uses ports 161 and 162 by default.  Only one application
70can use them at a time.  If there is an existing SNMP
71application (eg. Sun's snmpdx daemon) you need to either
72turn this off or work around it.   You may also have
73a previous version of net-snmp, the older ucd-snmp, or
74something completely different.  The following commands:
75
76   ps -ef | grep snm
77   ps -ef | grep mibi
78
79will give you a fairly good idea what is going on.
80
81If you see something like:
82
83  root 643 1 0 Jan 16 ? 5:49 /usr/local/sbin/snmpd
84
85that's probably a version of net-snmp.  The instructions in various
86sections below should give you clues on what to do next.
87
88If you see something like:
89
90  root 16178 1 0 13:16:04 pts/2 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
91
92and/or
93
94  root 21371 1 0 Feb 07 ? 0:52 mibiisa -r -p 41178
95
96then Sun's SNMP daemons are running.
97
98If you need this, for example if you use the Solstice Enterprise
99Agent, you may wish to run net-snmp as a sub-agent (see section 7).
100Otherwise, you will need to disable Sun's daemons (see section 2).
101
102Regardless you may wish to compile net-snmp from source
103and install it (see sections 3, 5 and 6) or install
104binaries (see sections 4 and 5).
105
106If some other SNMP daemon is running, you will need to determine
107where it came from and what it's being used for.  You get clues by
108typing "snmpd -v" or "snmpd --help".  In some cases it may be
109a subagent or agent from another application, such as ORACLE.  If
110you disable its agent, you will need to re-create this functionality
111under net-snmp (eg. by running it as a sub-agent).  ORACLE's SNMP
112functionality is turned on by default and may be unnecessary if
113you aren't using ORACLE's Enterprise Manager.  Refer to ORACLE's
114documentation on how to disable it.
115
116
117If you have decided to compile your own net-snmp, you will need ...
118
119C.  A compilation environment
120
121-a compiler (gcc or Sun's Forte cc) or the gcc libraries
122   (note, the cc in /usr/ucb is NOT a full-blown compiler)
123-OpenSSL (sunfreeware.com or source www.openssl.org)
124-zlib (sunfreeware.com or source www.gzip.org/zlib/)
125-an SNMP community string ("public" is deprecated)
126
127If you are installing on a development machine, it may be best
128to compile OpenSSL and zlib from source, otherwise
129obtain the appropriate zlib for your platform from sunfreeware
130and install (it goes to /usr/local automatically).
131Obtain the appropriate OpenSSL for your platform from sunfreeware
132and install (it goes to /usr/local), you may need the gcc libraries.
133These libraries should not need to be installed if you are using
134binaries, but your mileage may vary.  Note the library problem
135with libcrypto noted below (section 14).
136
137There are two choices for compilers.  Sun has a Forte development
138suite that includes a standalone C compiler.  If you have it, it
139is likely installed in /opt/SUNWspro/bin.
140
141The more common choice is gcc (2.95.3 or better have been tested)
142available from sunfreeware.com.  If you install gcc, you do not
143need the gcc libraries.  3.3.2 or later is recommended.
144
145Given that net-snmp is developed to work on a wide variety of
146platforms, but especially for linux, there's a better chance of
147it working using gcc at any given time. We also do regular test
148builds with Sun cc, though.
149
150 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
151 -- Thomas Anders <tanders@users.sourceforge.net>
152
153------------------------------------------------------------
154
1552.  Disabling Sun's SNMP daemons
156
157Note:  Sun has started to include net-snmp (version 5.0.9 plus their
158patches) with Solaris 10 and later.  These instructions are written
159with Solaris 9 and previous in mind.
160
161Out of the box, Sun runs four SNMP daemons: mibiisa, idmispd,
162snmpXdmid and snmpdx.
163
164These must be disabled before running net-snmp unless you are planning
165on running them together (see Section 7 below).  Here is the procedure:
166
167   cd /etc/rc3.d
168   ./S76snmpdx stop
169   ./S77dmi stop
170   mv S76snmpdx s76snmpdx
171   mv S77dmi s77dmi
172
173If you are using Solstice Disksuite, you may also be running
174mdlogd.  Leave this alone.
175
176You will need to create a new script to start net-snmp.
177See dist/snmpd-init.d and dist/snmptrapd-init.d for templates.
178
179 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
180
181------------------------------------------------------------
182
1833.  Compiling net-snmp
184
185It is strongly recommended that you compile net-snmp from source.
186That way you are guaranteed a working version for your specific
187configuration of operating system, applications and libraries.
188
189If, for some reason, you cannot compile on a specific machine,
190there are binaries available for download (see section 4).
191In addition, you may create your own binaries (see section 6).
192
193You need to set your $PATH.  This is extremely important
194because otherwise there may be conflicts between the various
195components of the development environment.
196
197If you are using FORTE:
198
199PATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/local/bin:
200
201If you are using gcc (installed in /usr/local/bin):
202
203PATH=/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/bin
204
205Obtain a current version of net-snmp (which, if you're reading this,
206presumably you have - don't you love recursion?) www.net-snmp.org/download/
207
208Uncompress it and untar it in a working directory eg. /usr/local/src/net-snmp
209
210In order to save a lot of typing, you should create a "configure"
211script eg. bcc.sh in the directory below eg. /usr/local/src.
212
213   ./configure --with-mib-modules="ucd-snmp/lmSensors ucd-snmp/diskio \
214      smux mibII/mta_sendmail" --with-cc=gcc
215
216(note, see the long discussion about Perl below)
217(note, substitute "cc" for "gcc" as appropriate)
218(note, for LM-SENSORS-MIB support, see discussion below)
219
220then call this script from the net-snmp directory ie ../bcc.sh
221
222and answer the appropriate questions (usually with the default).
223
224When it completes, you should see something like:
225
226---------------------------------------------------------
227            Net-SNMP configuration summary:
228---------------------------------------------------------
229
230  Net-SNMP Version:           5.4
231  Building for:               solaris2
232  Network transport support:  Callback Unix TCP UDP
233  SNMPv3 Security Modules:    usm
234  Agent MIB code:             mibII ucd_snmp snmpv3mibs notification target
235  \agent_mibs agentx agent_mibs utilities host disman/event-mib
236  \ucd-snmp/diskio smux agentx mibII/mta_sendmail
237  SNMP Perl modules:          disabled
238  Embedded perl support:      disabled
239  Authentication support:     MD5 SHA1
240  Encryption support:         DES
241
242Type:
243
244   make
245
246and watch for compile errors.
247
248You will receive numerous warnings.  This is normal,
249a side effect of supporting a variety of development environments.
250
251Now type:
252
253   make test
254
255and watch for failures.  Also watch for the special tests for Solaris.
256
257If you are satisfied with the tests, stop any snmpd daemons
258that may be running (see section 2) and type:
259
260   make install
261
262When complete, go on to section 5 below.
263
264 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
265
266------------------------------------------------------------
267
2684.  Obtaining and installing binaries
269
270It is strongly recommended that you compile net-snmp from source.
271That way you are guaranteed a working version for your specific
272configuration of operating system, applications and libraries.
273
274Binaries for Solaris may be found in two locations.
275
276www.sunfreeware.com - this installs as a package.
277It does not have Perl support.
278
279Therefore, I recommend:
280
281   http://net-snmp.sourceforge.net/download/  (you will be redirected)
282
283This is the official repository for binaries.
284
285To determine which binary you need, you will need several pieces of
286information.
287
288-operating system version,
289-hardware platform
290-net-snmp version desired
291
292The first two may be obtained by typing:
293
294   uname -a
295
296It will return something like:
297
298SunOS foo 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-4
299
3005.8 means Solaris 8
3015.7 means Solaris 7  etc.
302
303"sun4u" is the Ultra hardware platform
304"sun4m" is SuperSPARC  eg. Sparc 5 or Sparc 10
305"sun4d" is older SPARC boxes.
306
307You can then decode the binary version by its name eg.:
308
309net-snmp_5.0.9-SunOS_5.8_sun4u.tar.gz
310
311means "net-snmp version 5.0.9 for Solaris 8 running on Ultra
312hardware".
313
314Once you have found the appropriate version, download it to a
315distribution directory (making one if necessary) eg. /usr/local/dist
316
317Type the following: (using the sample above)
318
319   cd /
320   tar -xvf /usr/local/dist/net-snmp-5.0.9-SunOS_5.8_sun4u.tar
321
322The binaries, libraries, etc. will be installed in /usr/local.
323
324Remove the tar file to save space.  Create an snmpd.conf (see below)
325or use an existing one from another machine.
326It installs in /usr/local/share/snmp.
327
328Install a startup script (see section 1).
329
330For further information, see README.solaris.binaries.x that ships
331with the binaries.
332
333--Bruce Shaw <Bruce.Shaw at shaw.ca>
334
335------------------------------------------------------------
336
3375.  Creating snmpd.conf and testing
338
339When everything is installed, run:
340
341   snmpconf -g basic_setup
342
343and answer the questions appropriately.  If you are using
344the defaults, place the resulting snmpd.conf file in:
345
346/usr/local/share/snmp/snmpd.conf
347
348A security note - use of the "public" community is deprecated.
349This example uses "whatever" as a community.
350
351When you have the daemon running either with the script above or running:
352
353   /usr/local/sbin/snmpd
354
355test the daemon's functionality by typing:
356
357   snmpget -v 1 -c whatever localhost sysUpTime.0
358   snmpwalk -v 2c -c whatever -m ALL localhost .1.3 | more
359
360and paging through the results.
361
362If you have problems, you can examine diagnostic messages
363by running:
364
365   /usr/local/sbin/snmpd -f -Le
366
367or use gdb (available from www.sunsolve.com) as follows:
368
369   cd /usr/local/sbin
370   gdb snmpd
371   run -f -Le
372
373and when it blows up:
374
375   bt
376
377to get the backtrace.
378
379You can use:
380
381   run -f -Le -D <modulename>
382
383to display debug messages.
384
385To display all debug messages type:
386
387   run -f -Le -D ALL
388
389but this will be extremely verbose.
390
391 -- Bruce Shaw <Bruce.Shaw at shaw.ca> with suggestions by Thushara Wickram
392
393------------------------------------------------------------
394
3956.  Creating your own binaries
396
397Pick an appropriate name for a tarfile
398eg. net-snmp-5.4.custom-SunOS_5.8_sun4u.tar (see above)
399(this particular one means "a customized version of
400net-snmp 5.4 that works under Solaris 8 running on Ultra hardware")
401
402Create an empty directory such as /usr/local/dist, then do the following
403from the source directory (using the example above):
404
405   make install prefix=/usr/local/dist/usr/local \
406        exec_prefix=/usr/local/dist/usr/local
407   cd /usr/local/dist
408   tar -cvf net-snmp-5.4.custom-SunOS_5.8_sun4u.tar usr
409
410Transfer this file to the machine where you want to install from binary.
411Place it in a distribution directory eg. /usr/local/dist
412Type the following (using the example above):
413
414   cd /
415   tar -xvf /usr/local/dist/net-snmp-5.4.custom-SunOS_5.8_sun4u.tar
416
417Remove the tar file to save space.  Create an snmpd.conf (see above)
418or use an existing one from another machine.  If you are using
419the defaults, it installs in /usr/local/share/snmp.  Install
420a startup script (see section 2).
421
422Note that if you create a binary with Perl support (see below) an
423identically configured Perl needs to be installed as well.
424
425 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
426
427------------------------------------------------------------
428
4297.  Using Sun's SNMP daemon and net-snmp together
430
431Net-SNMP may be used as a subagent in conjunction with Sun's snmpdx daemon.
432
433To do this, you will need to modify several files,
434all located in /etc/snmp/conf.
435
436First, do the following:
437
438   /etc/rc3.d/S76snmpdx stop (assuming you haven't done so already, and...)
439   /etc/rc3.d/S77dmi stop    (...assuming you haven't renamed them)
440
441   cd /etc/snmp/conf
442   cp snmpd.conf snmpd.conf.orig
443   cp snmpdx.acl snmpdx.acl.orig
444   cp snmpdx.reg snmpdx.reg.orig
445   cp snmpdx.rsrc snmpdx.rsrc.orig
446   cp mibiisa.reg mibiisa.reg.orig
447   cp mibiisa.rsrc mibiisa.rsrc.orig
448
449modify snmpd.conf with the correct:
450
451   sysdescr
452   syscontact
453   sysLocation
454   system-group-read-community
455   read-community (in my example below I will use community "whatever")
456   trap
457   trap-community
458   managers (leave blank for all)
459
460modify snmpdx.acl with the correct:
461
462   trap-community
463   trap-recipients
464   communities
465   access
466
467Make sure that in snmpdx.reg the port is 161.
468
469You will now need to add two files - net-snmp.reg and net-snmp.rsrc
470
471In this example, "subtrees" is set for HOST-RESOURCES-MIB, and UCD-SNMP-MIB.
472Do not use net-snmp's MIB-2 information as this is already provided by
473Sun's mib and may cause a conflict.
474
475::::: net-snmp.reg ::::::
476
477# net-snmp.reg
478# mib-2 is already provided by the mibiisa process
479# that is a default sub agent of snmpdx
480# we are specifying only hostmib and ucd
481##########
482# agents #
483##########
484
485# The following 3 macros are predefined:
486#
487#       mib-2      =    1.3.6.1.2.1
488#       enterprise =    1.3.6.1.4.1
489#       sun        =    1.3.6.1.4.1.42
490#
491# You can define your own macros, so that you can
492# manipulate strings instead of OIDs in defining the agent.
493# See the "agent" section below.
494
495macros =
496{
497        host = mib-2.25
498        ucd  = enterprise.2021
499}
500
501agents =
502{
503        {
504                 name = "net-snmp"
505                 subtrees = { host,ucd }
506                 timeout = 2000000
507                 watch-dog-time = 86400
508        }
509}
510
511::::::::::::::::::
512
513::::: net-snmp.rsrc ::::::
514
515# /etc/snmp/conf/net-snmp.rsrc
516
517resource =
518{
519        {
520                registration_file = "/etc/snmp/conf/net-snmp.reg"
521                policy = "spawn"
522                type = "legacy"
523                command = "/usr/local/sbin/snmpd $PORT"
524      }
525
526}
527
528::::::::::::::::::
529
530Stop any net-snmp processes that may be running.
531
532Start Sun's daemons by typing:
533
534   /etc/rc3.d/S76snmpdx start (assuming you haven't renamed it)
535   /etc/rc3.d/S77dmi start    (assuming you haven't renamed it)
536
537Wait a moment for everything to stabilize, then try these two queries:
538
539   snmpget -v 1 -c whatever localhost sysDescr.0
540   snmpget -v 1 -c whatever localhost hrSystemUptime.0
541
542You should see something like:
543
544   SNMPv2-MIB::sysDescr.0 = STRING: SunOS foo 5.6 Generic_105181-30 sun4u
545
546which is Sun's daemon talking, and:
547
548   HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (78540910) 9 days, 2:10:09.10
549
550which is net-snmp talking.  It is acting as a sub-agent through Sun's daemon.
551
552If Sun's daemons fail, you will need to shut down the snmpd daemons by typing:
553
554   pkill snmpd
555
556Then do the following:
557
558   /etc/rc3.d/S76snmpdx stop  (assuming you haven't renamed it)
559   /etc/rc3.d/S77dmi stop     (assuming you haven't renamed it)
560   /etc/rc3.d/S76snmpdx start (assuming you haven't renamed it)
561   /etc/rc3.d/S77dmi start    (assuming you haven't renamed it)
562
563rather than trying to individually clobber all the various Sun daemons.
564
565This configuration appears to deal properly with snmpgets
566and handle mistakes gracefully.
567
568Beyond this, your mileage may vary.
569
570You may wish to modify the subtrees in net-snmp.reg as you find things
571that do and don't work.  Remember to keep backup copies of working
572configurations.
573
574 -- Bruce Shaw <Bruce.Shaw at shaw.ca> from notes by Stefan Radman and C Wells
575
576------------------------------------------------------------
577
5788.  Monitoring disks, processes and execs (DISMAN-EVENT-MIB)
579
580Important note: this section only applies to the old DISMAN-EVENT-MIB
581implementation called "disman/event-mib", *not* the current "disman/event"
582mib module which is active by default since net-snmp 5.3 and later.
583
584For a full explanation of using DISMAN-EVENT-MIB, see:
585
586http://www.net-snmp.org/man/snmpd.conf.html
587
588To use this component, net-snmp must be compiled with the option..
589
590--with-mib-modules="disman/event-mib"
591
592This discussion concerns the use of DISMAN-EVENT-MIB with Solaris.
593
594There is a bug preventing the use of some of its functionality.  This
595discussion will document what is known to work and how to use it.
596
597The problem revolves around the use of monitors.  The...
598
599defaultMonitors yes
600
601token will NOT work for reasons discussed below.  I suspect that the
602notificationEvent tokens will not work for the same reason but this
603has not been tested.  Your mileage may vary.  Same with includeAllDisks.
604
605The documentation suggests using...
606
607monitor -o prNames -o prErrMessage "process table" prErrorFlag != 0
608
609to monitor all processes.  This will fail with ambiguous results.
610
611To monitor processes, put a separate monitor line for each process.
612
613For example:
614######
615proc smail
616proc mdlogd
617
618monitor -r 30 -i -o prNames.1 -o prErrMessage.1 "Process smail" prErrorFlag.1 !=0
619monitor -r 30 -i -o prNames.2 -o prErrMessage.2 "Process Solstice Disksuite SNMP trap" prErrorFlag.2 !=0
620
621To monitor disks, do the same.  An example:
622
623########
624# This example sends a trap if root has less than 10% available and /usr6 less t
625han 90%
626#
627disk / 10%
628disk /usr6 90%
629
630monitor -i -r 30 -o dskPath.1 -o dskErrorMsg.1 "root file system" dskErrorFlag.1 !=0
631monitor -i -r 30 -o dskPath.2 -o dskErrorMsg.2 "ORACLE file system" dskErrorFlag.2 != 0
632#########
633
634To implement an external program then monitor its results you need to set up your script.
635
636Here is a sample script.
637
638#!//usr/bin/ksh
639xstatus=0
640
641if [ $xstatus -eq 0 ];then
642echo success: $0
643else
644echo FAILURE: $0
645fi
646
647exit $xstatus
648###end of script tester##
649
650Place this script in /usr/local/src and make it executable.  Make copies called
651tester1, tester2 etc.
652and make them executable.
653
654Here is a sample snmpd.conf snippet that makes use of the exec feature:
655##############
656
657exec tester1 /usr/local/src/tester1
658exec tester2 /usr/local/src/tester2
659exec tester3 /usr/local/src/tester3
660exec tester4 /usr/local/src/tester4
661exec tester5 /usr/local/src/tester5
662
663monitor -i -r 60 -o extNames.1 -o extOutput.1 "status table 1" extResult.1 != 0
664monitor -i -r 60 -o extNames.2 -o extOutput.2 "status table 2" extResult.2 != 0
665monitor -i -r 60 -o extNames.3 -o extOutput.3 "status table 3" extResult.3 != 0
666monitor -i -r 60 -o extNames.4 -o extOutput.4 "status table 4" extResult.4 != 0
667monitor -i -r 60 -o extNames.5 -o extOutput.5 "status table 5" extResult.5 != 0
668##############
669
670While snmpd is running, go to /usr/local/src and modify one of the tester programs eg. tester1
671
672xstatus=1
673
674and save the file.  Sometime in the next 60 seconds, a trap will be generated.
675Change the value back to 0, then modify another file.
676
677If you are unsure of the correct row number within a specific table, do an snmpwalk eg.
678
679snmpwalk -v 2c -c public -m ALL localhost prNames
680
681The same methodology can presumably be used for fileName and laNames.  Your mileage may vary.
682
683
684 -- Bruce Shaw <Bruce.Shaw at shaw.ca>  with Allan McIntosh and Wes Hardaker
685
686------------------------------------------------------------
687
6889.  Monitoring CPU temp, fan and power supply sensors (LM-SENSORS-MIB)
689
690Note: This module (ucd-snmp/lmSensors) works in "read only" mode to examine
691sensors.  It cannot change switch or fan settings.
692
693It has been tested at least on the following platforms:
694
695Enterprise 450
696V880
697280R
698
699If you have information about other platforms this is desperately needed.  For
700example, the only "state" that I'm aware of for an i2c is "OK".  The more
701information we have, the richer the components.
702
703Please report any performance statistics, bugs or omissions to the users list.
704Please report any code suggestions to the coders list.  See links below.
705
706
707This component delivers information that you would normally see by typing:
708
709/usr/platform/`uname -m`/sbin/prtdiag -v
710
711At present this is only supported on the Ultra (sun4u) platform.
712
713To display this information, net-snmp must be compiled with the option:
714
715--with-mib-modules="ucd-snmp/lmSensors"
716
717Early Ultra servers such as the Ultra 1 or Ultra 2 did not report
718any sensor information at all.  Later servers, such as the Enterprise 450
719reported this information using kstat.  Sun's latest servers make use
720of the picld daemon to control system resources and report fan information.
721This module reads in the information from picld.  It cannot modify settings.
722
723You can see this information by typing:
724
725prtpicl -v | more
726
727The following is typical output from net-snmp:
728
729E450# snmpwalk -v 2c -c public -m ALL localhost lmSensors
730LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
731LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
732LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 2
733LM-SENSORS-MIB::lmTempSensorsIndex.4 = INTEGER: 3
734LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: Ambient
735LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU1
736LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: CPU2
737LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: CPU3
738LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 22
739LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 45
740LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 46
741LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 49
742LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
743LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
744LM-SENSORS-MIB::lmFanSensorsIndex.3 = INTEGER: 2
745LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: fan type CPU number 0
746LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: fan type PWR number 0
747LM-SENSORS-MIB::lmFanSensorsDevice.3 = STRING: fan type AFB number 0
748LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 33
749LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 31
750LM-SENSORS-MIB::lmFanSensorsValue.3 = Gauge32: 63
751LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 0
752LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 1
753LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 2
754LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: power supply 0
755LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: power supply 1
756LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: power supply 2
757LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 38
758LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 39
759LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 39
760LM-SENSORS-MIB::lmMiscSensorsIndex.1 = INTEGER: 0
761LM-SENSORS-MIB::lmMiscSensorsIndex.2 = INTEGER: 1
762LM-SENSORS-MIB::lmMiscSensorsIndex.3 = INTEGER: 2
763LM-SENSORS-MIB::lmMiscSensorsDevice.1 = STRING: FSP
764LM-SENSORS-MIB::lmMiscSensorsDevice.2 = STRING: Backplane4
765LM-SENSORS-MIB::lmMiscSensorsDevice.3 = STRING: Backplane8
766LM-SENSORS-MIB::lmMiscSensorsValue.1 = Gauge32: 192
767LM-SENSORS-MIB::lmMiscSensorsValue.2 = Gauge32: 0
768LM-SENSORS-MIB::lmMiscSensorsValue.3 = Gauge32: 0
769
770V880# snmpwalk -v 2c -c public -m ALL localhost lmSensors
771LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
772LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
773LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 2
774LM-SENSORS-MIB::lmTempSensorsIndex.4 = INTEGER: 3
775LM-SENSORS-MIB::lmTempSensorsIndex.5 = INTEGER: 4
776LM-SENSORS-MIB::lmTempSensorsIndex.6 = INTEGER: 5
777LM-SENSORS-MIB::lmTempSensorsIndex.7 = INTEGER: 6
778LM-SENSORS-MIB::lmTempSensorsIndex.8 = INTEGER: 7
779LM-SENSORS-MIB::lmTempSensorsIndex.9 = INTEGER: 8
780LM-SENSORS-MIB::lmTempSensorsIndex.10 = INTEGER: 9
781LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: CPU0_DIE_TEMPERATURE_SENSOR
782LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU2_DIE_TEMPERATURE_SENSOR
783LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: CPU1_DIE_TEMPERATURE_SENSOR
784LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: CPU3_DIE_TEMPERATURE_SENSOR
785LM-SENSORS-MIB::lmTempSensorsDevice.5 = STRING: CPU4_DIE_TEMPERATURE_SENSOR
786LM-SENSORS-MIB::lmTempSensorsDevice.6 = STRING: CPU6_DIE_TEMPERATURE_SENSOR
787LM-SENSORS-MIB::lmTempSensorsDevice.7 = STRING: MB_AMB_TEMPERATURE_SENSOR
788LM-SENSORS-MIB::lmTempSensorsDevice.8 = STRING: IOB_AMB_TEMPERATURE_SENSOR
789LM-SENSORS-MIB::lmTempSensorsDevice.9 = STRING: DBP0_AMB_TEMPERATURE_SENSOR
790LM-SENSORS-MIB::lmTempSensorsDevice.10 = STRING: DBP1_AMB_TEMPERATURE_SENSOR
791LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 71
792LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 60
793LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 66
794LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 59
795LM-SENSORS-MIB::lmTempSensorsValue.5 = Gauge32: 65
796LM-SENSORS-MIB::lmTempSensorsValue.6 = Gauge32: 69
797LM-SENSORS-MIB::lmTempSensorsValue.7 = Gauge32: 28
798LM-SENSORS-MIB::lmTempSensorsValue.8 = Gauge32: 25
799LM-SENSORS-MIB::lmTempSensorsValue.9 = Gauge32: 25
800LM-SENSORS-MIB::lmTempSensorsValue.10 = Gauge32: 24
801LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
802LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
803LM-SENSORS-MIB::lmFanSensorsIndex.3 = INTEGER: 2
804LM-SENSORS-MIB::lmFanSensorsIndex.4 = INTEGER: 3
805LM-SENSORS-MIB::lmFanSensorsIndex.5 = INTEGER: 4
806LM-SENSORS-MIB::lmFanSensorsIndex.6 = INTEGER: 5
807LM-SENSORS-MIB::lmFanSensorsIndex.7 = INTEGER: 6
808LM-SENSORS-MIB::lmFanSensorsIndex.8 = INTEGER: 7
809LM-SENSORS-MIB::lmFanSensorsIndex.9 = INTEGER: 8
810LM-SENSORS-MIB::lmFanSensorsIndex.10 = INTEGER: 9
811LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: CPU0_PFAN_TACH
812LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: CPU1_PFAN_TACH
813LM-SENSORS-MIB::lmFanSensorsDevice.3 = STRING: CPU0_SFAN_TACH
814LM-SENSORS-MIB::lmFanSensorsDevice.4 = STRING: CPU1_SFAN_TACH
815LM-SENSORS-MIB::lmFanSensorsDevice.5 = STRING: IO_BRIDGE_PFAN_TACH
816LM-SENSORS-MIB::lmFanSensorsDevice.6 = STRING: IO_BRIDGE_SFAN_TACH
817LM-SENSORS-MIB::lmFanSensorsDevice.7 = STRING: IO0_PFAN_TACH
818LM-SENSORS-MIB::lmFanSensorsDevice.8 = STRING: IO1_PFAN_TACH
819LM-SENSORS-MIB::lmFanSensorsDevice.9 = STRING: IO0_SFAN_TACH
820LM-SENSORS-MIB::lmFanSensorsDevice.10 = STRING: IO1_SFAN_TACH
821LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 2439
822LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 2586
823LM-SENSORS-MIB::lmFanSensorsValue.3 = Gauge32: 2459
824LM-SENSORS-MIB::lmFanSensorsValue.4 = Gauge32: 2564
825LM-SENSORS-MIB::lmFanSensorsValue.5 = Gauge32: 3409
826LM-SENSORS-MIB::lmFanSensorsValue.6 = Gauge32: 0
827LM-SENSORS-MIB::lmFanSensorsValue.7 = Gauge32: 3947
828LM-SENSORS-MIB::lmFanSensorsValue.8 = Gauge32: 3896
829LM-SENSORS-MIB::lmFanSensorsValue.9 = Gauge32: 4000
830LM-SENSORS-MIB::lmFanSensorsValue.10 = Gauge32: 3896
831LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 0
832LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 1
833LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 2
834LM-SENSORS-MIB::lmVoltSensorsIndex.4 = INTEGER: 3
835LM-SENSORS-MIB::lmVoltSensorsIndex.5 = INTEGER: 4
836LM-SENSORS-MIB::lmVoltSensorsIndex.6 = INTEGER: 5
837LM-SENSORS-MIB::lmVoltSensorsIndex.7 = INTEGER: 6
838LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 7
839LM-SENSORS-MIB::lmVoltSensorsIndex.9 = INTEGER: 8
840LM-SENSORS-MIB::lmVoltSensorsIndex.10 = INTEGER: 9
841LM-SENSORS-MIB::lmVoltSensorsIndex.11 = INTEGER: 10
842LM-SENSORS-MIB::lmVoltSensorsIndex.12 = INTEGER: 11
843LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: PS0_3_3V_I_SENSOR
844LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: PS0_5V_I_SENSOR
845LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: PS0_12V_I_SENSOR
846LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: PS0_48V_I_SENSOR
847LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: PS1_3_3V_I_SENSOR
848LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: PS1_5V_I_SENSOR
849LM-SENSORS-MIB::lmVoltSensorsDevice.7 = STRING: PS1_12V_I_SENSOR
850LM-SENSORS-MIB::lmVoltSensorsDevice.8 = STRING: PS1_48V_I_SENSOR
851LM-SENSORS-MIB::lmVoltSensorsDevice.9 = STRING: PS2_3_3V_I_SENSOR
852LM-SENSORS-MIB::lmVoltSensorsDevice.10 = STRING: PS2_5V_I_SENSOR
853LM-SENSORS-MIB::lmVoltSensorsDevice.11 = STRING: PS2_12V_I_SENSOR
854LM-SENSORS-MIB::lmVoltSensorsDevice.12 = STRING: PS2_48V_I_SENSOR
855LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 6
856LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 4
857LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 3
858LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 4
859LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 6
860LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 4
861LM-SENSORS-MIB::lmVoltSensorsValue.7 = Gauge32: 3
862LM-SENSORS-MIB::lmVoltSensorsValue.8 = Gauge32: 4
863LM-SENSORS-MIB::lmVoltSensorsValue.9 = Gauge32: 6
864LM-SENSORS-MIB::lmVoltSensorsValue.10 = Gauge32: 4
865LM-SENSORS-MIB::lmVoltSensorsValue.11 = Gauge32: 3
866LM-SENSORS-MIB::lmVoltSensorsValue.12 = Gauge32: 4
867
868This component also reports information for switches, LEDs
869and i2c's (devices accessing the i2c bus).
870Because the MIB only allows us to display numeric
871information a certain amount of translation has been done.
872
873Switches:
874
8750 = OFF
8761 = ON
8772 = NORMAL
8783 = LOCKED
8794 = UNKNOWN
8805 = DIAG
8816 = SECURE
88299 = other
883
884LEDs:
885
8860 = OFF
8871 = ON
8882 = BLINK (this may not exist)
88999 = other
890
891i2c's:
8920 = OK
89399 = other
894
895In order to prevent inordinant consumption of machine resources,
896some sensor information is cached.  Currently, information
897retrieved from picld is cached for six seconds.
898
899 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
900
901------------------------------------------------------------
902
90310.  MIB rewrites for IF-MIB, TCP-MIB and UDP-MIB
904
905net-snmp 5.4 has started to include rewrites for the IF-MIB, TCP-MIB and
906UDP-MIB implementations. They need to be explicitely enabled, though:
907
908  ./configure --enable-mfd-rewrites ...
909
910See the Net-SNMP Wiki (http://www.net-snmp.org/wiki/index.php/IF-MIB_rewrite)
911for further details.
912
913Thanks to Sun for the excellent patches.
914
915
916 -- Thomas Anders <tanders@users.sourceforge.net>
917
918------------------------------------------------------------
919
92011.  Files descriptors and fopen
921
922Solaris has a limitation on the number of file descriptors (255)
923available in stdio, so that fopen() fails if more than
924255 file descriptors (sockets) are open. This prevents mibs from
925being loaded after 250 sockets are open, since parse.c uses stdio.
926
927SEan <burke_sp@pacbell.net> investigated this problem, and had this
928report on using the SFIO package to solve this problem.
929
930 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
931
932The SFIO package ( http://www.research.att.com/sw/tools/sfio/ )
933is a buffered streams IO package that is much more more sophisticated
934than stdio, but it does support stdio API's for backward compatibility,
935and that's the aspect that is important here.
936
937To compile with SFIO, we simply add -I/usr/local/sfio/include to the
938$CPPFLAGS before compiling net-snmp. This causes SFIO's stdio.h to
939preempt Solaris stdio, mapping calls like fopen() and fprintf() to
940the SFIO implementations. This produces a libnetsnmp that does not
941have the fopen() limitation. Any application that links to this
942libnetsnmp must also be linked to libsfio.
943
944Here are the two caveats:
945
946A. libsfio exports the functions 'getc' and 'putc', for reasons that
947are not clear. These are the only symbols it exports that conflict
948with stdio. While getc and putc are traditionally macros, Solaris
949makes them functions in multithreaded code (compiled with -mt,
950-pthread, or -D_REENTRANT). If your native stdio code links to the
951libsfio versions, a crash will result.
952
953There are two solutions to this problem. You may remove getc and putc
954from libsfio, since SFIO defines getc and putc as macros, by doing:
955
956	ar d libsfio.a getc.o
957	ar d libsfio.a putc.o
958
959or link to SFIO's stdio compatibility library, libstdio, ahead of
960libsfio. This library wraps all of the native stdio calls with
961versions that are safe for native or sfio streams, in case you
962need to share streams between SFIO and native stdio codes.
963
964B. libsfio provides 64-bit offsets in fseek(), ftell(). This is
965a good thing, since SFIO is intended to avoid needless limitations,
966but it means that SFIO's stdio.h defines off_t to be a 64-bit offset.
967Net-SNMP uses readdir(), which returns a struct dirent containing
968a 32-bit off_t, so the code compiled for SFIO doesn't access
969struct dirent's correctly.
970
971There are two solutions to this problem, as well. The first is to
972include <dirent.h> at the start of SFIO's stdio.h. Since SFIO
973defines a macro substitution for off_t, this leaves struct dirent's
974definition unchanged.
975
976An alternative, which I haven't verified, is to define _FILE_OFFSET_BITS
977to be 64 when compiling libnetsnmp. According to what I see in Solaris's
978/usr/include/sys/feature_tests.h, you can select a 64-bit off_t at
979compile time with this setting, which should make readdir()'s off_t
980compatible with SFIO's ftell(), fseek().
981 [[ We have received reports that this approach does not in fact work
982(see Perl discussion below)]]
983
984Finally, thanks to Phong Vo and AT&T Labs for a fast, robust and
985portable package that solves this headache very neatly.
986
987-SEan <burke_sp@pacbell.net>
988
989------------------------------------------------------------
990
99112.  Perl
992
993Net-SNMP may be compiled with Perl support by configuring like:
994
995   ./configure -enable-embedded-perl ...
996
997This should only be done if you are sure you really need Perl,
998for the following reasons:
999
1000Solaris 8 and later ship with a version of Perl compiled using Sun's cc.
1001
1002This causes a problem when attempting to compile net-snmp
1003with Perl functionality ie.:
1004
1005   ./configure --with-mib-modules="ucd-snmp/lmSensors ucd-snmp/diskio \
1006      smux mibII/mta_sendmail" --enable-embedded-perl
1007
1008because during the Perl section of the compile, it attempts to do so
1009using the methodology used to compile the original Perl, not
1010what you're currently using.  This can be discovered by typing:
1011
1012   perl -V
1013
1014and it says (among other things)
1015
1016  Compiler:
1017    cc='cc'
1018
1019and you don't have the full version of Sun's C compiler on your
1020system, it's going to break.
1021
1022In addition if it was compiled with:
1023
1024   LFS_CFLAGS      -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1025
1026net-snmp will not compile correctly.
1027
1028Given that the Perl provided with Solaris 8 (5.005_03) and Solaris 9
1029(5.005_03 and 5.6.1) is somewhat stale, upgrading may be to your advantage.
1030
1031Perl did not ship with Solaris before version 8.  If you installed a
1032version from www.sunfreeware.com, it is compiled with some extra flags
1033that cause the net-snmp compile to break.
1034
1035In either case, you will need to compile and install Perl.
1036
1037There are, however, some issues.
1038
1039A.  Some applications (eg. /usr/bin/kstat) require this exact version
1040of Perl because of libraries.  These instructions below install Perl
1041in /usr/local/bin (and optionally /usr/bin/).  The original is left
1042intact in /usr/perl5/bin/perl where, in fact, the kstat script looks
1043for it.  If you have version specific scripts, you will need to do
1044the same either by invoking /usr/perl5/bin/perl or putting:
1045
1046#!/usr/perl/bin/perl -w
1047
1048as the first line of your script and making it executable
1049(see the /usr/bin/kstat source as an example).
1050
1051B.  The instructions below disable large file support.
1052
1053This means that Perl would be unable to deal
1054successfully with files larger than 2 Gb.
1055Again, using /usr/perl5/bin/perl or a version compiled
1056with this functionality would solve this.
1057
1058Hence the ideal solution is a net-snmp specific Perl in its own directory.
1059
1060The following instructions will install a working Perl in /usr/local/net-snmp.
1061
1062Install gcc version 3.3.2 (or later) from www.sunfreeware.com.
1063
1064Download the current stable release of Perl
1065
1066   http://www.cpan.org/src/stable.tar.gz
1067
1068and gunzip and untar.  (This document assumes Perl 5.8.3 or later)
1069
1070cd to the source directory and type the following:
1071
1072  sh Configure -Dcc=gcc -Dprefix=/usr/local/net-snmp -Uinstallusrbinperl \
1073               -Duseshrplib -Dcf_email=your_email@your_domain \
1074               -Dperladmin=your_email@your_domain -Uuselargefiles -de
1075
1076Replace your_email@your_domain by your real email address. If you intend
1077to compile Net-SNMP with Sun cc later on, replace gcc with cc above.
1078
1079When it is finished, do:
1080
1081   grep cppsymbols config.sh
1082
1083and make sure "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" does NOT appear.
1084
1085Then do:
1086
1087   make
1088   make test  (optional)
1089   make install
1090   /usr/local/net-snmp/bin/perl -V
1091
1092if everything looks all right, compile net-snmp (see above) with the
1093following differences:
1094
1095env PERLPROG=/usr/local/net-snmp/bin/perl ./configure --enable-embedded-perl \
1096 --with-mib-modules=ucd-snmp/lmSensors,ucd-snmp/diskio,smux,mibII/mta_sendmail \
1097 --with-cc=gcc && make && make test && make install
1098
1099Make sure you specify the correct path to your self-compiled Perl binary
1100and use the same compiler like the one you used when building Perl above.
1101Feel free to add other configure options, of course.
1102
1103"make test" includes some tests for the Net-SNMP Perl functionalities.
1104
1105Once you have compiled and installed net-snmp you can test the Perl
1106capabilities of the final installation by doing the following:
1107
1108Copy the perl_module.pl script found at
1109
1110http://www.net-snmp.org/tutorial-5/toolkit/perl/index.html
1111
1112to /usr/local/net-snmp
1113
1114and modify your /usr/local/share/snmp/snmpd.conf file to contain the entry:
1115
1116perl do "/usr/local/net-snmp/perl_module.pl";
1117
1118then do:
1119
1120/usr/local/bin/snmpwalk -v 2c -c whatever localhost .1.3.6.1.4.1.8072.999
1121
1122It should return the following:
1123
1124NET-SNMP-MIB::netSnmp.999.1.2.1 = STRING: "hello world"
1125
1126WARNING!!  If you are planning on creating binary versions of net-snmp with
1127Perl capability, you will also need to ship the Perl which you created in
1128/usr/local/net-snmp.
1129
1130 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
1131 -- Thomas Anders <tanders@users.sourceforge.net>
1132
1133------------------------------------------------------------
1134
113513.  sed
1136
1137Various sed versions in older Solaris releases (Solaris 8 and earlier
1138at least) have serious limitations that may affect ./configure
1139when building net-snmp. All these issues *should* have been addressed
1140in net-snmp 5.4 and later. If you still have problems, please let us know
1141and consider:
1142
1143- installing GNU sed and putting it in front of your PATH
1144- installing the available Sun patches for the various sed versions
1145  (/usr/bin/sed, /usr/xpg4/bin/sed, /usr/ucb/sed)
1146- try the suggestions below
1147
1148The version of sed in /usr/ucb on Solaris 2.5.1 and 2.6 can't
1149cope with the size of the substitution strings used in config.status.
1150
1151Putting /usr/bin ahead of /usr/ucb in the search path fixes this.
1152
1153/usr/xpg4/bin/sed is seen to segfault under Solaris 8 when running configure.
1154Putting /usr/bin ahead of /usr/xpg4/bin fixes this.
1155
1156
1157 -- Thomas Anders <tanders@users.sourceforge.net>
1158 -- zach dot metzinger at microtune dot com
1159
1160------------------------------------------------------------
1161
116214.  OpenSSL and crle
1163
1164If compiling with OpenSSL (e.g. from sunsolve), it's possible that
1165the agent won't successfully load the crypto library (typically
1166in /usr/local/ssl/lib) when it is in use and will return a
1167cannot find library error message of some sort.
1168
1169To rectify this, you will need to use the /usr/bin/crle command, which
1170did NOT ship with some versions of Solaris, but came as part of later
1171patches.  You should make sure the following patches are up to date:
1172
1173107733 (Solaris 2.6)
1174106950 (Solaris 2.7)
1175109147 (Solaris 8)
1176115833 (Trusted Solaris 8)
1177112693 (Solaris 9)
1178
1179Then type the following:
1180
1181/usr/bin/crle
1182
1183It will return something like:
1184
1185Default configuration file (/var/ld/ld.config) not found
1186  Default Library Path (ELF):  /usr/lib (system default)
1187  Trusted Directories (ELF):   /usr/lib/secure (system default)
1188
1189Find the location of the libcrypto libraries by typing:
1190
1191find /usr -name "libcrypto*" -print
1192
1193which will probably display:
1194
1195/usr/local/ssl/lib/libcrypto.a
1196/usr/local/ssl/lib/libcrypto.so
1197/usr/local/ssl/lib/libcrypto.so.0
1198/usr/local/ssl/lib/libcrypto.so.0.9.7
1199
1200which is the default installation for OpenSSL.
1201
1202To include this in the loader search path, type:
1203
1204/usr/bin/crle -u -l /usr/local/ssl/lib
1205
1206/usr/bin/crle will now display:
1207
1208Configuration file [3]: /var/ld/ld.config
1209  Default Library Path (ELF):   /usr/lib:/usr/local/ssl/lib
1210  Trusted Directories (ELF):    /usr/lib/secure  (system default)
1211
1212Command line:
1213  crle -c /var/ld/ld.config -l /usr/lib:/usr/local/ssl/lib
1214
1215If this fails, usually by displaying:
1216
1217crle: /var/ld/ld.config: open failed: No such file or directory
1218
1219you will need to create this directory by hand by doing the following:
1220
1221mkdir /var/ld
1222cd /var/ld
1223ln -s . 32
1224mkdir sparcv9
1225chgrp bin sparcv9
1226ln -s sparcv9 64
1227touch ld.config
1228
1229then do:
1230
1231crle -c /var/ld/ld.config -l /usr/lib:/usr/local/ssl/lib
1232
1233Thanks to Dave Shield and Johannes Schmidt-Fischer
1234
1235 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
1236
1237------------------------------------------------------------
1238
123915. IPv6
1240
1241Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6
1242transports on Solaris:
1243
1244   ./configure --enable-ipv6
1245
1246There's no support for the mibII/ipv6 mib module, though.
1247
1248
1249 -- Thomas Anders <tanders@users.sourceforge.net>
1250
1251------------------------------------------------------------
1252
125316. Wish list
1254
1255A.  Code cleanup
1256
1257There may be opportunities for shared code between UCD-SNMP
1258and HOST-RESOURCES-MIB.
1259
1260There may be opportunities to optimize caching perhaps
1261using the new auto-caching code.
1262
1263B.  LM-SENSORS-MIB
1264
1265We need a complete list of sensors from various platforms so
1266they can be displayed properly.
1267
1268C.  ORACLE
1269
1270How to get ORACLE's SNMP functionality to work as a sub-agent.
1271
1272D. Largefile support
1273
1274Rework the host mib module to work even if net-snmp is built with
1275largefile support. This would eliminate the most important problems
1276with Perl (see section 12).
1277
1278 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
1279 -- Thomas Anders <tanders@users.sourceforge.net>
1280
1281------------------------------------------------------------
1282
128317.  Known Bugs!!
1284
1285A.  hrDeviceTable (HOST-RESOURCES-MIB)
1286
1287This section of code is only aware of disk controllers 0 through 7.
1288Hence, anything on controller c8 and above will be invisible.
1289
1290B.  hrPartitionTable (HOST-RESOURCES-MIB)
1291
1292At present, hrPartitionSize data only works for regular ufs
1293partitions eg. /dev/dsk/c0t0d0s0 that are mounted.  They
1294are displayed in partition order rather than the order
1295they are mounted.  Partitions mounted as mirrors, metastate
1296database replicas, swap or members of a RAID display size 0.
1297
1298As a workaround, put entries for disks you are
1299interested in in snmpd.conf and examine
1300using UCD-SNMP-MIB.
1301
1302
1303 -- Bruce Shaw <Bruce.Shaw at shaw.ca>
1304
1305------------------------------------------------------------
1306
130718.  Discussion and further information
1308
1309For discussion or further information contact the coders and users
1310lists at http://sourceforge.net/mail/?group_id=12694 .
1311
1312

README.sql

README.systemd

1README.systemd
2--------------
3Net-SNMP provides two daemons, which support systemd system manager.
4See http://www.freedesktop.org/wiki/Software/systemd to learn how
5systemd works. Both socket activation and notification is supported by these
6daemons.
7
8To enable systemd support, the sources must be compiled with
9--with-systemd configure option.
10
11snmpd - The SNMP agent
12----------------------
13Socket activation od snmpd daemon is implemented, but it's discouraged.
14The reason is simple - snmpd not only listens and processes SNMP requests
15from network, but also gathers system statistics counters, sends traps and
16communicates with subagents. It even opens few netlink sockets.
17
18In other words, snmpd should run from system start to properly work.
19This can be done in two ways:
201) either as snmpd service unit with 'Type=notification' and without a socket
21   unit
222) or as snmpd service unit with 'Type=simple', appropriate socket socket unit
23   and the snmpd service enabled. This way systemd creates the snmpd listening
24   socket early during boot and passes the sockets to snmpd slightly later
25   (but still during machine boot). This way systemd can paralelize start of
26   services, which depend on snmpd. Admins must adjust the socket file manually,
27   depending if the snmpd support AgentX, IPv6, SMUX etc.
28
29snmpd should be started with '-f' command line parameter to disable forking -
30systemd does that for us automatically.
31
32
33snmptrapd - The trap processing daemon
34--------------------------------------
35snmptrapd supports full socket activation and also notification (if needed).
36Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services
37will work. Again, '-f' parameter should be provided on snmptrapd command line.
38
39If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should
40start during boot and not after first SNMP trap arrives. Same rules as for snmpd
41applies then.

README.thread

1Improved Error Reporting and Thread-Safe Use of the SNMP Library
2
3There is a need in some environments to support multiple threads
4in a single application.  The SNMP Library provides the Single Session
5functions which support thread-safe operation when certain precautions
6are taken.  This document describes the operation of the SNMP Library
7with a focus on its session management functions.  The Traditional API
8and the Single API functions are compared and contrasted.
9A working understanding of the CMU or UCD SNMP Library
10API is recommended to fully appreciate the concepts discussed.
11The document ends with a list of restrictions for using the Single API
12in a multi-threaded application.
13
14Unfortunately, the SNMPv3 support was added about the same time as
15the thread support and since they occurred in parallel the SNMPv3
16support was never checked for multi-threading correctness.  It is
17most likely that it is not thread-safe at this time.
18
19  ***** IMPORTANT ANNOUNCEMENT *****
20  To the point, no resource locks are applied within the SNMP Library.
21  The APDU encoding and some session management functions can be used
22  in thread-safe manners. The MIB file parsing is not thread-safe.
23  The Single Session API was made available in November 1998.
24  Existing applications use the Traditional API, which is not thread-safe.
25  The thread-safe considerations are discussed throughout this document.
26
27The research and development of the Single Session API that I've completed
28was wholly funded by my employer, Internet Security Systems, Inc.
29and is distributed freely to the Internet community.
30
31-Mike Slifcak, 23 April 1999
32
3309 July 1999 Removed references to snmp_synch_setup and snmp_synch_reset
34
35
36Availability
37
38The Single Session API is integrated into the currently available
39versions of the CMU SNMP library and the UC-Davis SNMP package.
40
41 ftp://ftp.net.cmu.edu/pub/snmp/cmu-snmp-V1.13.tar.gz and later
42  Read : snmp_sess_api.3, Changes.SingleSession
43
44 ftp://ucd-snmp.ucdavis.edu/ucd-snmp-3.6.tar.gz and later
45  Read : snmp_sess_api.3, README.thread (after version 3.6.1)
46
47Both libraries work equally well in Windows NT and various
48UNIX platforms.  Please read this document and refer to
49the snmp_sess_api section 3 manual page.
50
51Glossary of Terms
52
53APDU    Application Protocol Data Unit
54API     Application Programming Interface
55CMU     Carnegie-Mellon University, Pittsburgh, PA.
56Library The SNMP library; Both CMU and UCD versions are applicable.
57Session Concept embodying the management of transacting SNMP APDUS.
58SNMP    Simple Network Management Protocol
59UCD     University of California at Davis, CA.
60
61Introduction
62
63The Library extends the UNIX file concept (open, close, read, write) to a Session.
64Opening a Session binds a local socket to a well-known port and creates internal
65structures to help with controlling the transaction of SNMP APDUs.  Closing a
66Session releases the memory and system resources used for these purposes.
67
68Since the mid-1980s, many SNMP applications have used the Traditional Session
69API to transact SNMP APDUs between the local host and SNMP-enabled devices.
70
71  The Traditional Session API does not support multi-threaded applications:
72
73  1)  There are no resource locks to prevent exposing the Library's
74      global data resources to corruption in a multi-threaded application;
75
76  2)  The Traditional API functions that receive SNMP APDUs
77      do not provide an interface for one of many sessions;
78
79  3)  Errors discovered by the Library are communicated through global
80      data structures and are not associated with the session
81      in which the error occurred.
82
83  The Single Session API provides these capabilities:
84
85  1)  Manage a single SNMP session safely, in multi-threaded or
86      non-threaded applications, by avoiding access to data structures
87      that the Traditional Session API may share between Sessions;
88
89  2)  Associate errors with the session context for threaded
90      and non-threaded applications.
91
92
93Contrasting and Comparing Traditional API and Single API
94
95The Traditional API uses the struct snmp_session pointer returned
96from snmp_open() to identify one SNMP session.  The Single API uses
97the opaque pointer returned from snmp_sess_open() to identify one
98SNMP session.
99
100   Helpful Hint : The Library copies the contents of the
101   structure which is input to snmp_open() and snmp_sess_open().
102   Once copied, changing that input structure's data
103   has no effect on the opened SNMP Session.
104
105The Traditional API uses the snmp_error() function to identify any
106library and system errors that occurred during the processing for
107one SNMP session.   The Single API uses snmp_sess_error() for the
108same purpose.
109
110The Traditional API manages the private Sessions list structure;
111adding to the list during snmp_open(), removing during snmp_close.
112
113With few exceptions, the Traditional API calls the Single API
114for each session that appears on the Sessions list.
115
116The Traditional API reads from all Sessions on the Sessions list;
117The Single API does not use the Sessions list.
118The Single API can read from only one Session.
119
120   Helpful Hint :
121   This is the basis for thread-safe-ness of the Library.
122   There are no resource locks applied.
123
124
125Using the Single API
126
127A multi-threaded application that deploys the SNMP Library should
128should complete all MIB file parsing before additional threads
129are activated.  Drawing from the parsed contents of the MIB does
130not incur any data corruption exposure once the internal MIB structures
131are initialised.
132
133The application may create threads such that a single thread may manage
134a single SNMP session.  The thread should call snmp_sess_init()
135to prepare a struct snmp_session structure.  The thread can adjust
136session parameters such as the remote UDP port or the local UDP port,
137which must be set prior to invoking snmp_sess_open().
138
139The first call to snmp_sess_init() initialises the SNMP Library,
140including the MIB parse trees, before any SNMP sessions are created.
141Applications that call snmp_sess_init() do not need to read MIBs
142nor setup environment variables to utilize the Library.
143
144After the struct snmp_session is setup, the thread must call
145snmp_sess_open() to create an SNMP session.  If at any time
146the thread must change the Session configuration,
147snmp_sess_session() returns the pointer to the internal configuration
148structure (a struct snmp_session, copied from snmp_sess_open).
149The thread can adjust parameters such as the session timeout
150or the community string with this returned struct snmp_session pointer.
151Changes to the remote or local port values have no effect on an opened Session.
152
153The thread can build PDUs and bind variables to PDUs, as it performs its duties.
154The thread then calls snmp_sess_send() or snmp_sess_async_send() to build and send
155an SNMP APDU to the remote device. If a Get-Response-PDU is expected, the thread
156should call snmp_sess_synch_response() instead.
157
158When the thread is finished using the session, it must free the resources
159that the Library used to manage the session.
160Finally, the thread must call snmp_sess_close() to end the Session.
161
162Snmp_sess_init(), snmp_open(), and snmp_sess_open()
163must use the same calling parameter for a given Session.
164Other methods should use only the returned parameter from
165snmp_open() and snmp_sess_open() to access the opened SNMP Session.
166
167
168Error Processing
169
170Two calls were added : snmp_error() and snmp_sess_error() return the
171"errno" and "snmp_errno" values from the per session data, and a string
172that describes the errors that they represent.  The string must be freed
173by the caller.
174
175Use snmp_error() to process failures after Traditional API calls,
176or snmp_sess_error() to process failure after Single API calls.
177In the case where an SNMP session could not be opened,
178call snmp_error() using the struct snmp_session supplied to either snmp_open()
179or snmp_sess_open().
180
181
182The following variables and functions are obsolete and may create problems
183in a multi-threaded application :
184
185  int    snmp_errno
186  char * snmp_detail
187  snmp_set_detail()
188  snmp_api_errstring()
189
190
191Function Summary
192
193The functions in the following table are functionally equivalent,
194with the exception of these behaviors:
195- The Traditional API manages many sessions
196- The Traditional API passes a struct snmp_session pointer,
197       and touches the Sessions list
198- The Single API manages only one session
199- The Single API passes an opaque pointer, and does not use Sessions list
200
201  Traditional        Single                    Comment
202  ===========        ==============            =======
203  snmp_sess_init     snmp_sess_init            Call before either open
204  snmp_open          snmp_sess_open            Single not on Sessions list
205                     snmp_sess_session         Exposes snmp_session pointer
206  snmp_send          snmp_sess_send            Send one APDU
207  snmp_async_send    snmp_sess_async_send      Send one APDU with callback
208  snmp_select_info   snmp_sess_select_info     Which session(s) have input
209  snmp_read          snmp_sess_read            Read APDUs
210  snmp_timeout       snmp_sess_timeout         Check for timeout
211  snmp_close         snmp_sess_close           Single not on Sessions list
212 snmp_synch_response snmp_sess_synch_response  Send/receive one APDU
213  snmp_error         snmp_sess_error           Get library,system errno
214
215
216Example 1 : Traditional API use.
217
218    #include "snmp_api.h"
219      ...
220      int liberr, syserr;
221      char *errstr;
222      struct snmp_session Session, *sptr;
223      ...
224      snmp_sess_init(&Session);
225      Session.peername = "foo.bar.net";
226      sptr = snmp_open(&Session);
227      if (sptr == NULL) {
228          /* Error codes found in open calling argument */
229          snmp_error(&Session, &liberr, &syserr, &errstr);
230          printf("SNMP create error %s.\n", errstr);
231          free(errstr);
232          return 0;
233      }
234      /* Pass sptr to snmp_error from here forward */
235      ...
236      /* Change the community name */
237      free(sptr->community);
238      sptr->community = strdup("public");
239      sptr->community_len = strlen("public");
240      ...
241      if (0 == snmp_send(sptr, pdu)) {
242          snmp_error(sptr, &liberr, &syserr, &errstr);
243          printf("SNMP write error %s.\n", errstr);
244          free(errstr);
245          return 0;
246      }
247      snmp_close(sptr);
248
249
250Example 2 : Single API use.
251
252    #include "snmp_api.h"
253      ...
254      int liberr, syserr;
255      char *errstr;
256      void *sessp;  /* <-- an opaque pointer, not a struct pointer */
257      struct snmp_session Session, *sptr;
258      ...
259      snmp_sess_init(&Session);
260      Session.peername = "foo.bar.net";
261      sessp = snmp_sess_open(&Session);
262      if (sessp == NULL) {
263          /* Error codes found in open calling argument */
264          snmp_error(&Session, &liberr, &syserr, &errstr);
265          printf("SNMP create error %s.\n", errstr);
266          free(errstr);
267          return 0;
268      }
269      sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
270
271      /* Pass sptr to snmp_sess_error from here forward */
272      ...
273      /* Change the community name */
274      free(sptr->community);
275      sptr->community = strdup("public");
276      sptr->community_len = strlen("public");
277      ...
278      if (0 == snmp_sess_send(sessp, pdu)) {
279          snmp_sess_error(sessp, &liberr, &syserr, &errstr);
280          printf("SNMP write error %s.\n", errstr);
281          free(errstr);
282          return 0;
283      }
284      snmp_sess_close(sessp);
285
286Example 3. Differences Between Traditional API and Single API Usage
2875a6
288>       void *sessp;  /* <-- an opaque pointer, not a struct pointer */
28911,13c12,14
290<       sptr = snmp_open(&Session);
291<       if (sptr == NULL) {
292---
293>       sessp = snmp_sess_open(&Session);
294>       if (sessp == NULL) {
29519c20,22
296<       /* Pass sptr to snmp_error from here forward */
297---
298>       sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
299>
300>       /* Pass sptr to snmp_sess_error from here forward */
30126,27c29,30
302<       if (0 == snmp_send(sptr, pdu)) {
303<           snmp_error(sptr, &liberr, &syserr, &errstr);
304---
305>       if (0 == snmp_sess_send(sessp, pdu)) {
306>           snmp_sess_error(sessp, &liberr, &syserr, &errstr);
30733c36
308<       snmp_close(sptr);
309---
310>       snmp_sess_close(sessp);
311
312
313Restrictions on Multi-threaded Use of the SNMP Library
314
315  1. Invoke SOCK_STARTUP or SOCK_CLEANUP from the main thread only.
316
317  2. The MIB parsing functions use global shared data and are not
318     multi-thread safe when the MIB tree is under construction.
319     Once the tree is built, the data can be safely referenced from
320     any thread.  There is no provision for freeing the MIB tree.
321     Suggestion: Read the MIB files before an SNMP session is created.
322     This can be accomplished by invoking snmp_sess_init from the main
323     thread and discarding the buffer which is initialised.
324
325  3. Invoke the SNMPv2p initialisation before an SNMP session is created,
326     for reasons similar to reading the MIB file.
327     The SNMPv2p structures should be available to all SNMP sessions.
328     CAUTION: These structures have not been tested in a multi-threaded
329     application.
330
331  4. Sessions created using the Single API do not interact with other
332     SNMP sessions.  If you choose to use Traditional API calls, call
333     them from a single thread.  The Library cannot reference an SNMP
334     session using both Traditional and Single API calls.
335
336  5. Using the callback mechanism for asynchronous response PDUs
337     requires additional caution in a multi-threaded application.
338     This means a callback function probably should probably not use
339     Single API calls to further process the session.
340
341  6. Each call to snmp_sess_open() creates an IDS.  Only a call to
342     snmp_sess_close() releases the resources used by the IDS.
343
344

README.tru64

1Some notes for the Tru64 Unix 5.x port
2======================================
3
41. Compiling
5------------
6
7The following procedure has been proven to successfully compile net-snmp
8version 5.2.2 and later on Tru64 Unix 5.1B (Alpha EV5.6) using the Compaq C 6.5
9compiler:
10
11	./configure --disable-embedded-perl
12	make
13	su -
14	make install
15
16A recent GNU C compiler (gcc) will probably work, too.
17
18Please note that the "host" module doesn't compile on Tru64, so you *cannot*
19run configure with "--with-mib-modules=host".
20
212. Embedded Perl
22----------------
23
24The Perl package (5.00503) shipped with Tru64 Unix 5.1 isn't complete enough
25to allow to build net-snmp with embedded Perl support. If you need embedded
26Perl support, do your own Perl installation first.
27
283. IPv6
29-------
30
31Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
32on Tru64 Unix 5.1:
33
34   ./configure --enable-ipv6
35
36There's no support for the IPv6 MIBs, though.
37
38
394. Known problems
40-----------------
41
42"make test" is known to report the following failure:
43
44  59: testing full snmpwalk (SNMPv2c) against agent (may take time)... FAIL
45
46so it's obvious that there are still problems with some MIB modules on Tru64.
47If you have ideas how to fix them, please let us know!
48
49
505. Feedback
51-----------
52
53Please also see README and PORTING.
54
55If you have questions, additional insights or (even better) patches regarding
56net-snmp on Tru64 Unix, please refer to the net-snmp mailing lists (see
57http://www.net-snmp.org/lists).
58

README.win32

1***************************************************************************
2*
3* README.win32
4*
5***************************************************************************
6
7This guide describes how to build Net-SNMP with Microsoft Visual Studio,
8Cygwin, MinGW or Mingw-w64.  As developers build with other Win32
9environments, their notes will be included here.
10
11The sections in this guide are:
12
13Current Status for Win32 platforms
14Interactions with Other Vendor's Products
15Running Net-SNMP as a replacement for the Microsoft SNMP service
16Co-existence with Microsoft SNMP services
17Microsoft Visual C++ - Overview
18Microsoft Visual C++ - Configure / nmake - Building
19Microsoft Visual C++ - Workspace - Building
20Microsoft Visual C++ - Workspace - Building the DLL
21Microsoft Visual C++ - Workspace - Building the Perl SNMP modules
22Microsoft Visual C++ - Workspace - Installing
23Microsoft Visual C++ - Building with OpenSSL
24Microsoft Visual C++ - Building with IPv6
25Microsoft Visual C++ - Building your own applications with snmplib
26Microsoft Visual C++ - Extending the Agent
27GCC on Windows
28Cygwin - Building
29MinGW - Building
30MinGW - Building with OpenSSL
31Configuring Net-SNMP
32How to Register the Net-SNMP Agent and Trap Daemon as Windows services
33Notes on SET support for WIN32 ports
34Notes on preprocessor defines for Microsoft Visual Studio, MinGW and Cygwin
35Acknowledgements
36
37
38***************************************************************************
39*
40* Net-SNMP status for Win32 platforms
41*
42***************************************************************************
43
44All applications build with Microsoft Studio, Cygwin, MinGW and Mingw-w64.
45
46  -  All of the applications work (snmpwalk, snmpget, snmpset, snmptrap, ...).
47  -  The system, snmp, ip, tcp, udp and icmp MIB-groups work.
48  -  The Net-SNMP agent runs as an AgentX master agent or as subagent.
49  -  smux is working.
50  -  The target, notification, disman/mte groups compile but are not tested.
51  -  The TCP/IPv6 and UDP/IPv6 transports compile but are not tested.
52  -  Extending the agent to support enterprise-specific MIBs works.
53  -  Running the agent on a non-standard UDP or TCP port works.
54  -  Snmpd can be registered as a Windows service.
55  -  Snmptrapd can be registered as a Windows service.
56  -  Some build environments allow long pathnames that contain
57     embedded spaces.  As this is not true for Cygwin "configure",
58     the documented example scripts will refer to "c:/usr"
59     as the base directory for installed Net-SNMP software.
60  -  When using the winExtDLL extension agent, the Net-SNMP agent will
61     load the Windows SNMP Service extension DLLs.
62
63The next subsection relates to items that are built using Visual Studio
64
65  -  All Debug and Release targets linked with libsnmp project targets
66     build without errors, and are fully functional.
67
68  -  With Visual Studio 2005 and later, the Net-SNMP source code can be
69     compiled into either 32-bit or 64-bit executables (the amd64/x64
70     architecture). Previous Visual Studio versions support 32-bit executables
71     only.
72
73
74***************************************************************************
75*
76* Interactions with Other Vendor's Products
77*
78***************************************************************************
79
80  -  Install scripts etc are written assuming Windows NT / 2000 or higher
81
82  -  Running the Net-SNMP Agent or trap receiver on Windows 95 or Win3.1
83     is not supported.
84
85  -  Running the Net-SNMP Agent or trap receiver as a service on Windows 95
86     or Windows 98 is not supported.
87
88  -  The Net-SNMP agent and trap receiver will fail to start if either
89     cannot bind to their connect port (161 for agent, 162 for trap receiver).
90     Check the Services panel to be sure no other SNMP program conflicts. See
91     the section titled 'Co-existence with Microsoft SNMP services' below.
92
93  -  The Net-SNMP agent can be used instead of the MS supplied one while
94     retaining all functionality and with slightly better SNMP conformance.
95     See the section titled 'Co-existence with Microsoft SNMP services' below.
96
97  -  The Net-SNMP agent does not use the MS SNMP.dll, therefore it cannot
98     run as an extensible part of the MS agent.  It is possible to use a third
99     party proxy agent for the MS agent to 'proxy' requests to the Net-SNMP
100     agent listening on a different UDP port on the same machine.
101
102  -  Snmptrapd does not "share" nor multiplex traps with SNMPTRAP.EXE,
103     a program that is available from Microsoft or ACE#COMM.
104
105
106***************************************************************************
107*
108* Running Net-SNMP as a replacement for the Microsoft SNMP service
109*
110***************************************************************************
111
112As of Net-SNMP 5.4, the Net-SNMP agent is able to load the Windows SNMP
113service extension DLLs by using the Net-SNMP winExtDLL extension.
114
115The Windows SNMP service must be installed, but the service must be disabled.
116This is required so that the extension DLLs are available for loading, and
117also because this extension and the existing Windows extensions use the
118Windows SNMP API from snmpapi.dll.
119
120An alternative to winExtDLL is to proxy requests from Net-SNMP to the Windows
121SNMP service.  See the section 'Co-existence with Microsoft SNMP services'.
122
123
124Limitations
125-----------
126
127- When using HP Insight Agents, some parts of the enterprises.232 tree are not
128  accessible.  The cause of this is not known.
129
130- When using winExtDLL, there is an offset of up to one second between the
131  value of the sysUpTime varbind included in the traps generated by SNMP
132  extension DLLs (e.g. linkUp and linkDown) and the value of the sysUpTime
133  varbind included in traps generated by Net-SNMP itself (e.g. coldStart).
134
135- When using winExtDLL, hrSystemUptime.0 reports the system uptime in thousands
136  of a second instead of hundreds of a second. This is well known behavior of
137  the Microsoft DLL that implements this MIB object. For more information,
138  see also https://connect.microsoft.com/onecare/feedback/ViewFeedback.aspx?FeedbackID=504908.
139
140
141Enabling the Windows SNMP extension agents
142------------------------------------------
143
144When installing Net-SNMP using the binary available from the web site, select
145'With Windows Extension DLL support' for the 'Net-SNMP Agent Service'.
146
147The recommended way to start snmpd is with the following command line:
148
149 snmpd.exe -I-udp,udpTable,tcp,tcpTable,icmp,ip,interfaces,system_mib,sysORTable
150
151The above command will exclude all the Net-SNMP extensions that overlap with
152the default Windows (2003) extensions included with Windows.  Other Net-SNMP
153modules take precedence over the modules loaded by winExtDLL.
154
155The binary install of Net-SNMP includes shortcuts in the Start menu for
156registering and unregistering snmpd and snmptrapd as a service with the
157correct command line options.
158
159A simple test to see if winExtDLL is working is to get the sysDescr string.
160
161 snmpget -v 1 -c public localhost sysDescr.0
162
163If you see something similar to:
164
165 Hardware: x86 Family 15 Model 12 Stepping 0 AT/AT COMPATIBLE - Software:
166 Windows 2000 Version 5.0 (Build 2195 Uniprocessor Free)
167
168instead of the usual Net-SNMP:
169
170 Windows host1 5.0.2195 Service Pack 4 2000 Server x86 Family 15 Model 12
171 Stepping 0
172
173then it's using the Windows DLLs.  You may also notice that your floppy
174drive is accessed when starting the service.  This is from one of the
175Windows extensions.
176
177To see what Windows modules are being loaded, you can shut down the
178service and then run snmpd.exe from the command line with winExtDLL
179debugging enabled using (all on one line):
180
181 snmpd.exe -Lo -I-udp,udpTable,tcp,tcpTable,icmp,ip,interfaces,system_mib,
182 sysORTable -DwinExtDLL
183
184The Windows DLL snmpmib.dll (SNMPMIB) contains SNMP traffic statistics
185(.1.3.6.1.2.1.11).  As we are using Net-SNMP and not the Windows SNMP Service,
186no values will be returned from the Windows extension.  To allow SNMP
187statistics to be received, the Net-SNMP module snmp_mib is permitted to load
188by not excluding it in the above command line.  As stated above, this module
189will take precedence over the Windows module.
190
191
192Registry Information
193--------------------
194
195Warning:  Improper use of the registry editor can damage to your operating
196          system and should only be used by experienced users.
197
198The following registry keys are used by the Windows SNMP Service to determine
199what extension DLLs to load:
200
201HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents
202
203Each REG_SZ value contains the registry path to an extension agent which
204contains the path to the DLL.  For example:
205
206Name    Type    Value
2071       REG_SZ  SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion
208
209To prevent winExtDLL from loading the above extension, change the registry
210path to an invalid path such as:
211
212Name    Type    Value
2131       REG_SZ  SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion!!!
214
215
216Service dependencies
217--------------------
218
219Services that depend on the SNMP Service will have to be modified to depend on
220Net-SNMP instead of SNMP by modifying the registry.  See Microsoft article
221193888 for more information.
222
223
224Compiling Net-SNMP with the winExtDLL extension
225-----------------------------------------------
226
227To build Net-SNMP with the winExtDLL extension, add --with-winextdll to the
228configure command line.
229
230
231***************************************************************************
232*
233* Co-existence with Microsoft SNMP services
234*
235***************************************************************************
236
237If the Microsoft SNMP agent service (SNMP Service) is running, the Net-SNMP
238agent (snmpd) will fail to start as it will not be able to bind to the default
239TCP/IP port of 161.
240
241If the Microsoft SNMP Trap Receiver service is running, the Net-SNMP trap
242receiver (snmptrapd) will fail to start as it will not be able to bind to the
243default TCP/IP port of 162.
244
245It is not a requirement to install the Net-SNMP agent (snmpd) or trap receiver
246(snmptrapd).  All the command line utilities such as snmpget.exe, snmpset.exe
247and the Perl modules will work without the Net-SNMP services.  All the
248utilities will work against any SNMP agent.
249
250The main benefit of running the Microsoft SNMP agent instead of the Net-SNMP
251agent is that many Windows applications such as Microsoft SQL Server,
252Microsoft Exchange etc, extend the Microsoft agent.  Net-SNMP is NOT a drop
253in replacement for the Microsoft agent unless the winExtDLL Net-SNMP extension
254is used (see the section 'Running Net-SNMP as a replacement for the Microsoft
255SNMP service').  Running Net-SNMP in place of the Microsoft agent (without
256winExtDLL) will prevent the other applications from working with SNMP.  Also,
257the Net-SNMP agent does not contain as many MIBs as the Microsoft agent.  For
258example, as of August 2005, the HOST-RESOURCES (host) MIB is not yet
259implemented in Net-SNMP.
260
261There are many benefits of running the Net-SNMP agent instead of the Microsoft
262such as you can extend the agent using various features found in snmpd.conf
263such as pass and pass_persist (support for others are being added), you can
264use SNMP v3, and there is more granular access control.
265
266To allow both the Microsoft and Net-SNMP agent / trap receiver to run at the
267same time, the default TCP/IP port must be changed on either the Microsoft or
268Net-SNMP version of the application.
269
270The Net-SNMP ports for snmpd and snmptrapd can be modified via snmpd.conf and
271snmptrapd.conf or by using a command line option with each program.  See the
272Net-SNMP Help file for instructions on changing the port number.
273
274The Microsoft services use the 'snmp' and 'snmptrap' entries in the SERVICES
275file (%SystemRoot%\system32\drivers\etc\services) to determine the port to bind
276the service to when the service starts.  Simply modify the entries and restart
277the affected services.
278
279Note:  Changing the default port the service listens on will prevent it from
280       accepting requests or receiving traps from standard SNMP devices and
281       management stations unless they have also been reconfigured to use the
282       new port numbers.
283
284It is possible to configure Net-SNMP agent to listen on the default UDP port
285(161), have the Microsoft agent listen on another port such as 1161, and have
286Net-SNMP proxy (forward) requests to the Microsoft agent.  This will allow you
287to use the advanced features of Net-SNMP while still being able to query
288the Microsoft agent and subagents.  To this, follow these steps:
289
290 1.  Change the port that the Microsoft agent listens on.
291
292 2.  Configure the Microsoft agent to only accept requests from localhost.
293     This can be set in the Security tab for the SNMP service in Windows 2000+.
294     This is recommended to prevent users from querying the Microsoft agent
295     directly.
296
297 3.  Add a r/c community string to the Microsoft agent.  This can be set in
298     the Security tab for the SNMP service in Windows 2000+.  This will give
299     Net-SNMP full SNMP access.  User access can be restricted by Net-SNMP
300     as explained below.
301
302 4.  Restart the Microsoft SNMP service.
303
304 5.  Configure Net-SNMP to proxy requests to the Microsoft agent.  To have it
305     forward ALL requests to the Microsoft agent, add the following line to
306     snmpd.conf:
307
308       proxy  -v 1 -c public localhost:1161 .1.3
309
310     To only forward a section of the MIB tree such as the host section, use:
311
312       proxy  -v 1 -c public localhost:1161 host
313
314 6.  Start the Net-SNMP agent.
315
316     Notes: If Net-SNMP has built in support for an OID and the proxy statement
317            is not for a specific OID, then it will respond instead of proxying
318            the request.  For example, if you proxy the 'system' tree and issue
319            an snmpget for sysDescr.0, Net-SNMP will respond with it's own
320            version of sysDescr.0 instead of forwarding it.  To prevent Net-SNMP
321            from doing this, you must prevent the system MIB from being
322            initialized when snmpd.exe is started by specifying what MIBS to
323            initialize using the -I switch.
324
325            If you are forwarding everything to the Microsoft agent (.1.3),
326            start snmpd.exe using:
327
328              snmpd.exe -Ivacm_conf,proxy,pass,pass_persist
329
330            The above will enable proxy, pass and pass_persist support.  See the
331            snmpd man page for more information on the -I switch.
332
333            If you are forwarding a section of the tree that is not implemented
334            in Net-SNMP such as 'host', you do not need to use the -I switch as
335            Net-SNMP will forward the request.  This may cause issues in the
336            future if newer versions of Net-SNMP implement the section of the
337            tree you are forwarding, such as the HOST-RESOURCES MIB.
338
339            The pass and pass_persist commands will work even if the entire
340            tree is proxied to the Microsoft Agent.
341
342 7.  Test the agent.  If you have forwarded the entire tree, issue an snmpget
343     for sysDescr.0.  For example:
344
345       snmpget -v 1 -c public localhost sysDescr.0
346
347     The Microsoft agent will respond in a format similar to:
348
349       Hardware: x86 Family 15 Model 12 Stepping 0 AT/AT COMPATIBLE - Software:
350        Windows 2000 Version 5.0 (Build 2195 Uniprocessor Free)
351
352     The Net-SNMP agent would normally respond in a format similar to:
353
354       Windows host1 5.0.2195 Service Pack 4 2000 Server x86 Family 15 Model 12
355        Stepping 0
356
357If you had previously configured the Microsoft agent with multiple community
358strings to restrict who can read and write to the OID tree, the security
359settings should be transferred to snmpd.conf.  For example, if the Microsoft
360agent was configured with:
361
362 Community              Rights
363 ---------------------------------
364 public                 read
365 S3cur39876             read/write
366 Sn0wb0ard345           read/create
367
368Add the following to snmpd.conf:
369
370 rocommunity  public
371 rwcommunity  S3cur39876
372 rwcommunity  Sn0wb0ard345
373
374It is possible to add more granular security using Net-SNMP.  For example, to
375restrict the public community string to only read the system tree, use:
376
377 rocommunity  public 0.0.0.0 system
378
379See the snmpd.conf man page for more information on configuring security.
380
381
382***************************************************************************
383*
384* Microsoft Visual Studio - Overview
385*
386***************************************************************************
387
388nmake is required to build Net-SNMP with Microsoft Visual Studio.
389
390To use nmake on the command line, the Configure script is run first to create
391the various makefiles.  Once these have been created, nmake is used to build
392the applications.  Perl is required to use this method, as the Configure
393script is written in Perl.  Perl source code is available at:
394
395        https://www.cpan.org/src/
396
397The make file system is based on and uses the directory structure of the
398projects contained in the Workspace files which are described below.  It is
399recommended that you read and understand how the workspaces are configured
400even if you will only be using the command line Configure / nmake system.
401
402If you want to distribute the generated executable, you will also need
403to distribute the Microsoft Visual Studio Redistributable Package. Check the
404EULA included with that package before redistributing it.
405
406OpenSSL is required to support the encryption capabilities in SNMPv3,
407or SHA authentication.
408
409Since the Microsoft Visual Studio build environment does not natively use
410"configure" nor "make" to generate the various pathnames that the programs
411require, the header files need to be manually modified when using the IDE, and
412an install script is provided.  When using the Perl Configure / nmake system,
413the header files are automatically modified and require no manual editing.
414
415The projects are arranged so that ALL of the usable products, the .exe files,
416are written to the win32\bin directory.  The win32\lib directory is used only
417to build the the files in the win32\bin directory.  Once building is
418completed, there is no further use for the files in the win32\lib directory.
419
420***************************************************************************
421*
422* Microsoft Visual Studio - Configure / nmake - Building
423*
424***************************************************************************
425
426There are two ways to build Net-SNMP using the Configure / nmake system.
427The first and easiest method is by running the win32\build.bat script.  The
428second is manually running Configure and nmake.
429
430Note:  Perl is required to use this method as the Configure script is
431       written in Perl.  The Perl source code is available at:
432
433        https://www.cpan.org/src/
434
435The Perl interpreter can be built as follows:
4361. Extract the Perl source code archive.
4372. In win32/Makefile, change CCTYPE to the string that corresponds to your
438   Visual Studio version, e.g. MSVC140.
4393. Edit INST_DRV and INST_TOP if necessary.
4404. Run vcvarsall.bat.
4415. Run nmake.
4426. Run nmake install.
443
444Win32\build.bat script
445======================
446
447The build.bat script is an easy menu driven system that allows you to select
448how Net-SNMP should be built, and where it should be installed.  Follow these
449steps to build using build.bat:
450
4511.  Open a command prompt
452
4532.  When building with OpenSSL, set the environment variables INCLUDE and LIB
454    such that these point at the proper OpenSSL directories. An example:
455
456    set INCLUDE=C:\OpenSSL-Win32\include
457    set LIB=C:\OpenSSL-Win32\lib\VC\static
458
4593.  Initialize the Visual Studio build environment by running vcvarsall.bat
460    which can be found in the bin folder of your Visual Studio install folder.
461    If you want to generate 64-bit binaries instead of 32-bit binaries, run
462    vcvarsall.bat with the amd64 argument. See also "How to: Enable a 64-Bit
463    Visual C++ Toolset at the Command Line" for more information
464    (http://msdn.microsoft.com/en-us/library/x4d2c09s%28v=vs.80%29.aspx).
465
4664.  Run win32\build.bat
467
4685.  The following screen will appear:
469
470    Net-SNMP build and install options
471    ==================================
472
473    1.  OpenSSL support:                disabled
474    2.  OpenSSL include directory:      C:\OpenSSL-Win64\include
475    3.  OpenSSL library directory:      C:\OpenSSL-Win64\lib\VC
476    4.  Platform SDK support:           disabled
477
478    5.  Install path:                   c:/usr
479    6.  Install after build:            enabled
480
481    7.  Perl modules:                   disabled
482    8.  Install perl modules:           disabled
483
484    9.  Quiet build (logged):           enabled
485    10. Debug mode:                     disabled
486
487    11. IPv6 transports (requires SDK): disabled
488    12. winExtDLL agent (requires SDK): disabled
489
490    13. Link type:                      static
491
492    14. Install development files       disabled
493
494    F.  Finished - start build
495    Q.  Quit - abort build
496
497    Select option to set / toggle:
498
4996.  Toggle the options on and off as desired by typing the line number
500    followed by <enter>.
501
502    To compile with OpenSSL, the OpenSSL library and header files must
503    already be installed.  See the section 'Microsoft Visual C++ - Building
504    with OpenSSL' for details.
505
506    To use the IPv6 transports, Windows 98 or later is required.
507
508    See the section 'Running Net-SNMP as a replacement for the Microsoft
509    SNMP service' for important information on using the winExtDLL agent.
510
511    If Quiet mode is enabled, all build activity is stored in various *.out
512    files inside of the win32 folder.
513
514    When you are ready to build, type f <enter>
515
5167.  Building will begin.  Following is a sample screen shot of a quiet build:
517
518    Building...
519
520    Deleting old log files...
521    Running Configure...
522    Cleaning...
523    Building main package...
524    Installing main package...
525    Running Configure for DLL...
526    Cleaning libraries...
527    Building DLL libraries...
528    Installing DLL libraries...
529    Cleaning Perl....
530    Building Perl modules...
531    Testing Perl modules...
532    Installing Perl modules...
533
534    See perlmake.out for Perl test results
535
536    Done!
537
5388.  If the folder that Net-SNMP was installed to is ever changed, modify the
539    system environment variables or registry keys as explained in the
540    'Configuration_Overview.html' file located in win32/dist/htmlhelp.
541
542
543Manual build using Configure / nmake
544====================================
545
546To build using nmake on the command line, the make files need to be generated
547first by the Configure script.  Following are sample steps to:
548
549  -enable Platform SDK support
550  -enable OpenSSL support
551  -enable debug mode
552  -build Net-SNMP
553  -install to 'c:\usr'
554  -compile the Perl modules
555  -test the Perl modules
556  -install the Perl modules
557
5581.  Open a command prompt
559
5602.  Initialize the Visual Studio build environment by running VCVARS32.bat
561    which can be found in the bin folder of your Visual Studio install folder.
562
5633.  Run the following command:
564
565      perl Configure --with-sdk --with-ssl --config=debug --prefix="c:/usr"
566
5674.  The make files will be generated, and a configuration summary will appear:
568
569    ---------------------------------------------------------
570                Net-SNMP configuration summary:
571    ---------------------------------------------------------
572
573      Config type:                debug
574      SDK:                        enabled
575      Link type:                  static
576      Prefix / Destdir:           c:/usr
577      OpenSSL:                    enabled
578
5795.  Type:
580
581      nmake clean
582      nmake
583      nmake install
584
585      perl Configure --with-sdk --with-ssl --config=debug --linktype=dynamic\
586           --prefix="c:/usr"
587
588      nmake libs_clean
589      nmake libs
590      nmake install
591
592      nmake perl_clean
593      nmake perl
594      nmake perl_test
595      nmake perl_install
596
597For a complete list of Configure options, run:
598
599  perl Configure --help
600
601For a complete list of possible build targets, after generating the make files
602using Configure, run:
603
604  nmake help
605
606Note:  The Configure option --linktype=static (or not specifying a linktype)
607       will result in libsnmp being compiled and all other components being
608       statically linked to it.
609
610       The Configure option --linktype=dynamic will result in libsnmp_dll
611       (netsnmp.dll) being compiled and all other components being dynamically
612       linked to it.
613
614
615***************************************************************************
616*
617* Microsoft Visual Studio - Building with OpenSSL
618*
619***************************************************************************
620
621OpenSSL is required to support the encryption capabilities in SNMPv3
622(or SHA authentication). Pre-compiled binaries are available from
623http://www.slproweb.com/products/Win32OpenSSL.html.
624
625
626***************************************************************************
627*
628* Microsoft Visual Studio - Building your own applications with snmplib
629*
630***************************************************************************
631
632Linking in an snmplib built to use the Multithreaded DLL runtime library to
633an application configured for the Debug Multithreaded DLL runtime library
634results in a link error along the lines of 'defaultlib "MSVCRT" conflicts
635with use of other libs'.   If you receive a similar message, check that the
636projects settings between library and application match up.
637
638To successfully build your existing project with Net-SNMP libraries,
639change the project settings FOR YOUR APPLICATION ONLY as follows:
640
641   1. In the Link section, Select "Additional Libraries".
642      Add netsnmp.lib for Release version.
643      Add netsnmp_d.lib for Debug version.
644
645   2. Remove all references to these libraries:
646      libsnmp*.lib msvcrt*.lib libc*.lib oldnames.lib
647
648   3. In the C++ section, Select "Code Generation".
649      For Release, select /MD or "MultiThreaded DLL".
650      For Debug, select /MDd or "Debug MultiThreaded DLL".
651
652   4. Make sure "Ignore all default libraries" is NOT SET.
653
654   5. Make sure "_MBCS" is included in your pre-processor defines.
655
656Note: Some users may have better results compiling other packages that use
657      the installed header files by removing the "mode_t" definition from
658      net-snmp-config.h file in the installed directories.
659
660
661***************************************************************************
662*
663* Microsoft Visual Studio - Extending the Agent
664*
665***************************************************************************
666
667Assuming that the MIB compiler generated the my.h and my.c files for the
668custom MIB "my", the following changes are required to extend the agent
669using VC++:
670
671   - Add the my.h and my.c files to your 'netsnmpmibs' project in VC++.
672   - Next edit the '<sourcedir>\win32\mib_module_includes.h' file to
673     add an include to your .h file.
674
675        #include "mibgroup/my.h"
676
677   - Next edit the '<sourcedir>\win32\mib_module_inits.h' file to add
678     code to call your initialize function.
679
680        if (should_init("my")) init_my();
681
682That's all that is needed. Now go ahead and compile the 'netsnmpmibs'
683and 'snmpd' project. And things should work just fine.
684
685
686***************************************************************************
687*
688* GCC on Windows
689*
690***************************************************************************
691
692There are multiple versions of GCC (the GNU Compiler Collection) in common use
693on Microsoft Windows operating systems. This section will attempt to point the
694user to the information required to choose the one to best suit their needs.
695
696Cygwin
697
698The Cygwin compiler and toolkit provides a Unix style shell and environment
699for Windows based systems. The cygwin1.dll provides a POSIX emulation layer
700that simplifies porting Unix / Linux applications to Windows. The Cygwin dlls
701are required if an application is to be distributed. The dependency on the
702The Cygwin tool chain and documentation can be found at:
703
704http://sources.redhat.com/cygwin/
705
706
707MinGW and Mingw-w64
708
709The MinGW projects provide a Windows native version of gcc. The tool chain
710links against existing Windows dlls found on most systems. Binaries compiled
711with MinGW do not require additional libraries to be distributed. The MSYS
712and MSYS2 environments provide a shell (Bash) and tools to emulate a Unix style
713build environment on Windows. Mingw-w64 is an improved version of MinGW which
714supports both 32-bit and 64-bit environments.
715
716MSYS + MinGW
717============
718
719The MinGW and MSYS tools and documentation can be found at:
720
721http://www.mingw.org
722
723
724***************************************************************************
725*
726* Cygwin - Building
727*
728***************************************************************************
729
730An alternate way to build and run Net-SNMP on Win32 is to use the Cygwin
731environment.  Detailed information about the Cygwin environment is available
732on the web at: http://sources.redhat.com/cygwin/.
733
734Cygwin allows you to compile almost the complete agent and applications.
735As an example, the following configure options create a working set of
736programs:
737
738ENV_SEPARATOR=":" \
739./configure \
740	--with-mib-modules="host agentx disman/event-mib examples/example" \
741	--with-out-mib-modules=host/hr_network \
742
743If you want to disable SNMPv3 auth and privacy features, add:
744	--without-openssl \
745
746If you want to use IPv6 transports, add:
747	--enable-ipv6
748
749Note: the source code should *not* be in a folder that contains a space.
750For example, compiling in your 'My Documents' folder or your Desktop folder
751(usually c:\Documents and Settings\xxxx\Desktop) is not supported.
752
753If the folder that Net-SNMP was installed to is ever changed, modify the
754system environment variables or registry keys as explained in the
755'Configuration_Overview.html' file located in win32/dist/htmlhelp.
756
757
758***************************************************************************
759*
760* MinGW - Building
761*
762***************************************************************************
763
764MinGW, MSyS and the associated documentation can be downloaded from
765http://www.mingw.org.
766
767Compiling net-snmp with MinGW requires GNU regex and libintl. Binaries and
768developer header files for these libraries can be installed by running the
769following command from a MinGW shell:
770
771  mingw-get install msys-libregex msys-libintl msys-libopenssl
772  mingw-get upgrade msys-libregex msys-libintl msys-libopenssl
773
774Proceed as follows to build Net-SNMP:
775
7761. Configure net-snmp using the configure flags as shown:
777
778	BASEDIR=c:/usr
779
780	./configure --prefix="$BASEDIR" \
781		--with-mibdirs="$BASEDIR/share/snmp/mibs" \
782	--with-mib-modules="agentx disman/event-mib winExtDLL examples/example"\
783        --disable-embedded-perl --without-perl-modules \
784
785   If you want to use IPv6 transports, add:
786	--enable-ipv6 --with-transports="TCPIPv6 UDPIPv6"
787
788   Note: while the Net-SNMP implementation of the host resources MIB is not
789   supported when using MinGW, winExtDLL is supported. Via winExtDLL you can
790   use Microsoft's implementation of the host resources MIB.
791
7922. Type "make" to compile the package.
793
7943. Type "make install" to install the package.
795
7964. If the folder that Net-SNMP was installed to is ever changed, modify the
797   system environment variables or registry keys as explained in the
798   'Configuration_Overview.html' file located in win32/dist/htmlhelp.
799
800***************************************************************************
801*
802* Mingw-w64 - Building
803*
804***************************************************************************
805
806MSYS2 and Mingw-w64 can be installed as follows:
8071. Download the MSYS2 installer from https://www.msys2.org/.
8082. Run the MSYS2 installer.
8093. Open an MSYS2 shell.
8104. Run pacman -S make diffutils
8115. On a 32-bit system, run
812   pacman -S mingw-w64-i686-gcc mingw-w64-i686-openssl
8136. On a 64-bit system, run
814   pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl
815
816Do not try to make the MinGW64 gcc compiler to use the MSYS2 openssl-devel
817headers by adding /usr/include to the include path because this will trigger
818plenty of complaints about redefined macros and structures.
819
820***************************************************************************
821*
822* Building the Windows Net-SNMP Installer
823*
824***************************************************************************
825
826Proceed as follows:
827 1. Uninstall Net-SNMP.
828 2. Remove the C:\usr directory completely.
829 3. Open a command prompt
830 4. Run the Microsoft Visual Studio vcvarsall.bat script.
831 5. Change the current working directory to the Net-SNMP win32\dist directory.
832 6. Run the .\build-binary.bat script.
833 7. Copy the net-snmp-${version}.x86.exe installer to the desired location.
834
835***************************************************************************
836*
837* Configuring Net-SNMP
838*
839***************************************************************************
840
841Online documentation is available from the Net-SNMP home page at:
842
843http://www.net-snmp.org/docs/
844
845All configuration files should be placed in the INSTALL_BASE\etc\snmp folder.
846The INSTALL_BASE folder is defined in the win32\net-snmp\net-snmp-config.h
847file.  For example, c:\usr\etc\snmp.
848
849Included is a Perl script called snmpconf which can be used to create
850configuration files.  Full documentation on using snmpconf is available from the
851Net-SNMP web site at the above link.
852
853To run snmpconf, first modify snmpconf.bat located in the bin folder where
854Net-SNMP is installed.  Modify the set MYPERLPROGRAM= line to contain the full
855path to the snmpconf Perl script.  For example:
856
857  set MYPERLPROGRAM=c:\usr\bin\snmpconf
858
859You can now run snmpconf using the standard command line such as:
860
861  snmpconf -i
862
863For detailed information on using environment variables and the registry to
864configure Net-SNMP, see the 'Configuration_Overview.html' file in
865win32/dist/htmlhelp.
866
867
868***************************************************************************
869*
870* How to Register the Net-SNMP Agent and Trap Daemon as Windows services
871*
872***************************************************************************
873
874The Agent (snmpd.exe) and trap daemon (snmptrapd.exe) can be run as a service
875under Windows operating systems that have the Service Control Manager (SCM)
876(Services Control Panel).  This includes Windows NT, 2000, XP and 2003.
877Windows 9x/Me do not have the SCM.
878
879To allow snmpd.exe or snmptrapd.exe to run as a service, the programs need
880to be registered with the SCM.  This is done by running the program once with
881the -register command line switch from a command prompt.
882
883If Net-SNMP was installed using the binary available from the Net-SNMP web site,
884there will be shortcuts in the Start menu for registering and unregistering the
885agent and snmptrapd.
886
887The synopsis for registering snmpd as a Windows service is:
888
889  snmpd -register [OPTIONS] [LISTENING ADDRESSES]
890
891The synopsis for registering snmptrapd as a Windows service is:
892
893  snmptrapd -register [OPTIONS] [LISTENING ADDRESSES]
894
895After registration, the services 'Net-SNMP Agent' and 'Net-SNMP Trap Handler'
896will be available in the SCM.  The services can be started and stopped using
897the SCM (Services Control Panel) or from the command prompt using:
898
899 net start "Net-SNMP Agent"
900 net start "Net-SNMP Trap Handler"
901
902and
903
904 net stop "Net-SNMP Agent"
905 net stop "Net-SNMP Trap Handler"
906
907If any command line options are specified after the -register option, they
908will be included when the service starts.  For example, to register the
909snmptrapd daemon and enable logging of traps to c:\usr\log\snmptrapd.log,
910enter the following command line:
911
912 snmptrapd -register -Lf c:/usr/log/snmptrapd.log
913
914Note:  Use Unix style slashes (/) for all paths.
915
916For a complete list of command line options, consult the man pages, or use
917the -h switch:
918
919 snmpd -h
920 snmptrapd -h
921
922Notes: -H will display all available snmpd.conf, snmptrapd.conf and snmp.conf
923       configuration file options, not the command line options.
924
925       Like all Net-SNMP applications, snmpd and snmptrapd will use the
926       SNMPCONFPATH and SNMPSHAREPATH environment variables when run as a
927       service.  The registry is the recommended method for defining these
928       variables due to a limitation in the Windows Service Control Manager
929       (SCM).  When running as a service, if any system environment variables
930       are changed, the system will need to be rebooted to allow the services
931       to access the changed environment variables (see Microsoft knowledge
932       base article  821761).  Therefore, when running snmpd or snmptrapd as
933       a service, if SNMPCONFPATH or SNMPSHAREPATH is changed, a reboot will
934       be required after setting the environment variables, otherwise the
935       services may fail to start.  Using the registry to store the environment
936       variables eliminates this problem.  See the 'Configuration_Overview.html'
937       file in win32/dist/htmlhelp for more information on using the registry.
938
939
940Unregistering the services
941--------------------------
942
943To un-register the services, use the command line switch -unregister.  For
944example:
945
946 snmpd -unregister
947
948 snmptrapd -unregister
949
950Note:  Be sure to have all Service Control Panel windows closed when
951       unregistering, otherwise a reboot may be required to complete
952       the removal.
953
954
955Modifying the services
956----------------------
957
958To change the parameters that the SCM passes to snmpd or snmptrapd, the
959service must be unregistered, and then re-registered with the new options.
960
961For example, to change the parameters that SCM passes to snmpd, open a
962command prompt window, CD to the directory where the snmpd program is located
963(unless it is already in your PATH), identify the full set of parameters you
964desire, then type these two commands:
965
966 snmpd -unregister
967 snmpd -register [OPTIONS] [LISTENING ADDRESSES]
968
969Note:  Be sure to have all Service Control Panel windows closed when
970       unregistering, otherwise a reboot may be required to complete
971       the removal.
972
973
974Registry Information
975--------------------
976
977Warning:  Improper use of the registry editor can damage to your operating
978          system and should only be used by experienced users.
979
980The following registry keys are used by snmpd and snmptrapd:
981
982HKLM\SYSTEM\CurrentControlSet\Services\Net-SNMP Agent
983HKLM\SYSTEM\CurrentControlSet\Services\Net-SNMP Trap Handler
984
985Each command line option specified when regsitering the service will be added
986to the Parameters registry subkey for the service as a ParamX REG_SZ value
987where X starts at 1 and increments for each additional command line option.
988For example, '-Lf c:/usr/log/snmptrapd.log' would be:
989
990 HKLM\SYSTEM\CurrentControlSet\Services\
991   Net-SNMP Trap Handler\Parameters\Param1 -Lf
992
993 HKLM\SYSTEM\CurrentControlSet\Services\
994   Net-SNMP Trap Handler\Parameters\Param2 c:/usr/log/snmptrapd.log
995
996To add additional command line switches or modify the existing ones, it is
997recommended to unregister and re-register the services with the new command
998line options.  It is also possible to directly add or modify the ParamX values
999in the registry.
1000
1001Note:  The Parameters key is only created when there is at least one command
1002       line option specified when registering the service so it may need to be
1003       manually added if modifying using the registry editor.
1004
1005
1006***************************************************************************
1007*
1008* Notes on SET support for WIN32 ports
1009*
1010***************************************************************************
1011
1012Requirements:
1013
1014  Windows NT/2000/XP or later: Requires Windows NT 4.0 SP4 or later.
1015  Windows 95/98/Me: Requires Windows 98 or later.
1016
1017Windows support for SET on following groups:
1018
1019interfaces:
1020----------
1021ifAdminStatus is read-write. Status can be set with either 'up' or
1022'down'. (IE, 'testing' status is not supported.)
1023
1024
1025ip group:
1026--------
1027Scalar objects:
1028ipForwarding:Currently windows supports only ON->OFF (IE,
1029enable->disable). For any other value, it returns with failure.
1030
1031ipDefaultTTL: Supports value greater than or equal to 0.
1032
1033Table objects:
1034-------------
10351. ipRouteTable:
1036   ------------
1037route_write.c implements this.
1038
1039ipRouteDest: Setting this value, updates row with new ipRouteDest and all other
1040             entries will be same as old row.
1041    EX:
1042    Consider there is an entry with ipRouteDest = 10.0.0.20
1043    Request, snmpset localhost private ip.ipRouteTable.ipRouteEntry.ipRouteDest.10.0.0.20 -a 10.0.0.16
1044    Updates that row with ipRouteDest = 10.0.0.16
1045
1046ipRouteIfIndex:Write supported.
1047
1048ipRouteMetric1: Supports value greater than or equal to -1
1049
1050ipRouteMetric2, ipRouteMetric3, ipRouteMetric4, ipRouteMetric5: Even though
1051		call returns with success, Windows doesn't change these (as
1052		these are not used in Windows)
1053
1054ipRouteNextHop: Write supported.
1055
1056ipRouteType: Write Supported. If value is 2, IE 'invalid', it deletes the entry.
1057
1058ipRouteAge: Whenever any row is updated this will be automatically reset.
1059
1060ipRouteMask: Write Supported.
1061
1062Creation of ipRouteTable row:
1063-----------------------------
1064snmpset request for non existent OID with ipRouteIfIndex, ipRouteMetric1,
1065ipRouteNextHop and ipRouteMask varbinds, creates a row.
1066
1067snmpset with create option is not supported, as row creation requires
1068ipRouteIfIndex, ipRouteMetric1, ipRouteNextHop and ipRouteMask  in a single
1069request.
1070
1071Example to create a row:
1072-----------------------
1073Consider there is no entry for 10.0.0.18
1074
1075snmpset localhost private ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex.10.0.0.18 i 2 4.21.1.ipRouteMask.10.0.0.18 a 255.255.255.255 4.21.1.ipRouteNextHop.10.0.0.0 a 10.0.0.0 4.21.1.ipRouteMetric1.10.0.0.18 i 1
1076
1077If ipRouteIfIndex is valid then creates row with:
1078ipRouteIfIndex = 2
1079ipRouteMask = 255.255.255.255
1080ipRouteNextHop = 10.0.0.0
1081ipRouteMetric1 = 1
1082
10832. ipNetToMediaTable:
1084--------------------
1085ipNetToMediaIfIndex: write supported
1086ipNetToMediaPhysAddress: write supported
1087ipNetToMediaNetAddress: write supported
1088ipNetToMediaType: write supported, setting with value 2, deletes the row.
1089
1090Creation of row:
1091--------------------
1092snmpset request for non existent OID with ipNetToMediaPhysAddress varbind
1093creates a row.
1094
1095snmpset with create option is not supported, as row creation requires
1096ipNetToMediaPhysAddress in a request
1097request.
1098
1099Example to create a row:
1100-----------------------
1101Consider there is no entry for 10.0.0.32
1102
1103snmpset localhost private ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress.2.10.0.0.32 x efcd12130103
1104
1105If ipNetToMediaIfIndex is valid then creates row with:
1106ipNetToMediaIfIndex = 2
1107ipNetToMediaPhysAddress = ef:cd:12:12:01:03
1108ipNetToMediaNetAddress = 10.0.0.32
1109ipNetToMediaType = 4
1110
1111TCP:
1112---
1113tcpConnState of tcpConnTable is writable and the only value which may
1114be set by a management station is deleteTCB(12)
1115
1116
1117***************************************************************************
1118*
1119* Notes on preprocessor defines for Microsoft Visual Studio, MinGW and Cygwin
1120*
1121***************************************************************************
1122
1123When adding Windows specific code, proceed as follows:
1124- Add a configure test in the appropriate file under configure.d for MinGW
1125  and Cygwin.
1126- Add the symbol defined by the configure test to
1127  win32/net-snmp/net-snmp-config.h and also to
1128  win32/net-snmp/net-snmp-config.h.in. If the feature is supported by
1129  Microsoft visual Studio, define the symbol. Otherwise undefine it.
1130
1131Try to avoid to add #ifdef's that use the WIN32, _MSC_VER, mingw32 and/or
1132cygwin macros. These macros are defined as follows:
1133
1134Define:          Description:
1135-------          ------------
1136_WIN32           Defined by Microsoft Visual Studio, MinGW and Mingw-w64.
1137
1138_WIN64           Defined by Microsoft Visual Studio and Mingw-w64 when
1139                 generating 64-bit code.
1140
1141_MSC_VER         Defined by Microsoft Visual Studio only
1142
1143__MINGW32__      Defined by MinGW and Mingw-w64
1144
1145__MINGW64__      Defined by Mingw-w64 only
1146
1147cygwin           Defined by Cygwin only
1148
1149
1150***************************************************************************
1151*
1152* Acknowledgements
1153*
1154***************************************************************************
1155
1156These people are known to have contributed to one or more of
1157the Win32 platform ports.  If you have, and your name is not here,
1158please accept our apologies, and tell us so we can add your name.
1159
1160David Perkins, Joe Marzot, Wes Hardaker, Niels Baggesen, Dave Shield,
1161Robert Story, Suvrit Sra, Mike Slifcak, Latha Prabhu, Nikolai Devereaux,
1162Alex Burger, Bernhard Penz, Andy Smith and Bart Van Assche.
1163
1164