forked from grantc/ingres-snmp-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FAQ
3654 lines (2627 loc) · 149 KB
/
FAQ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Frequently Asked Questions (FAQ) for the UCD/Net-SNMP package
=============================================================
FAQ Author: Dave Shield
net-snmp Version: 5.4.1 CVS branch
net-snmp/ucd-snmp Project Leader: Wes Hardaker
Email: net-snmp-coders@lists.sourceforge.net
TABLE OF CONTENTS
=================
TABLE OF CONTENTS
GENERAL
What is it?
Where can I get it?
What documentation is available?
Are there binaries available?
What's the difference between UCD-SNMP and Net-SNMP?
What operating systems does it run on?
What happens if mine isn't listed?
Does it run on Windows?
How do I find out about new releases?
How do I submit a patch or bug report?
Can I reuse the code in my commercial application?
What's the difference between SNMPv1, SNMPv2 and SNMPv3?
What's the difference between SNMPv2 and SNMPv2c?
Which versions of SNMP are supported in this package?
Can I use SNMPv1 requests with an SNMPv2 MIB (or vice versa)?
Where can I find more information about network management?
Is Net-SNMP thread safe?
APPLICATIONS
How do I add a MIB?
How do I add a MIB to the tools?
Why can't I see anything from the agent?
Why doesn't the agent respond?
I can see the system group, but nothing else. Why?
Why can't I see values in the <INSERT ENTERPRISE HERE> tree?
The agent worked for a while, then stopped responding. Why?
Requesting an object fails with "Unknown Object Identifier" Why?
Why do I get "noSuchName" when asking for "sysUpTime" (or similar)?
Why do I sometimes get "End of MIB" when walking a tree, and sometimes not?
How do I use SNMPv3?
I cannot set any variables in the MIB.
Variables seem to disappear when I try to set them. Why?
Why can't I change sysLocation (or sysContact)?
I get an error when trying to set a negative value - why?
I get an error when trying to get a string-indexed table value - why?
How do I send traps and notifications?
How do I handle traps and notifications?
My traphandler script doesn't work when run like this - why not?
How big can an SNMP request (or reply) be?
How can I monitor my systems (disk, memory, etc)?
Applications complain about entries in your example 'snmp.conf' file. Why?
OK, what should I put in snmp.conf?
PERL
Where can I get the Perl SNMP package?
How do I install the Perl SNMP modules?
But compiling this fails! Why?
Compiling the Perl module works OK, but 'make test' fails. Why?
I'm trying to use mib2c (or tkmib) and it can't locate SNMP.pm?
I'm trying to use mib2c (or tkmib) and it can't load SNMP.so?
I'm trying to use tkmib and it can't locate Tk.pm?
I'm trying to install your RPM, but it complains about missing Perl modules. Why?
I've got a problem with the Net-SNMP module. Can you help?
MIBS
Where can I find a MIB compiler?
Why aren't my mib files being read in?
I'm getting answers, but they're all numbers. Why?
What does "Cannot find module (XXX-MIB)" mean?
What about "unlinked OID"?
The parser doesn't handle comments properly. Why not?
How can I get more information about problems with MIB files?
What's this about "too many imported symbols"?
Do I actually need the MIB files?
AGENT
What MIBs are supported?
What protocols are supported?
How do I configure the agent?
How do I remove a MIB from the agent?
I've installed a new MIB file. Why can't I query it?
How do I add a MIB to the agent?
What's the difference between 'exec', 'sh', 'extend' and 'pass'?
What's the difference between AgentX, SMUX and proxied SNMP?
What about 'dlmod' - what's that about?
Which should I use?
Can I use AgentX when running under Windows?
Can I use AgentX (or an embedded SNMP agent) in a threaded application?
How can I run AgentX with a different socket address?
How can I turn off SMUX support?
How can I combine two copies of the 'mib2' tree from separate subagents?
What traps are sent by the agent?
Where are these traps sent to?
How can I send a particular trap to selected destinations?
When I run the agent it runs and then quits without staying around. Why?
After a while the agent stops responding, and starts eating CPU time. Why?
How can I stop other people getting at my agent?
How can I listen on just one particular interface?
How do I configure access control?
I don't understand the new access control stuff - what does it mean?
How do I configure SNMPv3 users?
The 'createUser' line disappears when I start the agent. Why?
What's the difference between /var/net-snmp and /usr/local/share/snmp?
My new agent is ignoring the old snmpd.conf file. Why?
Why am I getting "Connection refused"?
Why can't I see values in the UCDavis 'extensible' or 'disk' trees?
Why can't I see values in the UCDavis 'memory' or 'vmstat' tree?
What do the CPU statistics mean - is this the load average?
How do I get percentage CPU utilization using ssCpuRawIdle?
What about multi-processor systems?
The speed/type of my network interfaces is wrong - how can I fix it?
The interface statistics for my subinterfaces are all zero - why?
Does the agent support the RMON-MIB?
What does "klread: bad address" mean?
What does "nlist err: wombat not found" (or similar) mean?
How about "Can't open /dev/kmem"?
The agent is complaining about 'snmpd.conf'. Where is this?
The system uptime (sysUpTime) returned is wrong!
Can the agent run multi-threaded?
COMPILING
How do I compile with 'cc' instead of 'gcc'?
The compilation is complaining about missing libraries. Why?
I'm getting an error "autoheader: not found" - what's wrong?
How can I reduce the memory footprint?
How can I reduce the installation footprint or speed up compilation?
How can I compile the project to use static linking?
Why is the project workspace empty under Visual C++?
Why does 'make test' skip five tests?
Why does 'make test' complain about a pid file?
CODING
How do I write C code to integrate with the agent?
How does the agent fetch the value of a MIB variable from the system?
Mib2c complains about a missing "mib reference" - what does this mean?
Mib2c complains about not having a "valid OID" - what does this mean?
Why doesn't mib2c like the MIB file I'm giving it?
Mib2c ignores my MIB and generates a pair of 'mib-2' code files. Why?
What's the difference between the various mib2c configuration files?
Which mib2c configuration file should I use?
How can I have mib2c generate code for both scalars and tables?
Are there any examples, or documentation?
Where should I put the files produced by 'mib2c'?
I've created a new module with 'mib2c' but it doesn't work. Why not?
I've added my code to this template and it still doesn't work. Why not?
Why does the iterator call my get_{first,next} routines so often?
How can I get the agent to generate a trap (or inform)?
How can I get the agent to send an SNMPv1 (or SNMPv2c) trap?
How can I get the agent to include varbinds with an SNMPv1 trap?
How can I get the agent to send an SNMPv1 enterprise-specific trap?
How can I get the agent to send an SNMPv3 trap (or inform)?
Why does calling 'send_v2trap' generate an SNMPv1 trap (or vice versa)?
What if I'm using an AgentX sub-agent instead?
How can I register a MIB module in a different (SNMPv3) context?
MISC
What ASN.1 parser is used?
What is the Official Slogan of the net-snmp-coders list?
GENERAL
=======
What is it?
----------
- Various tools relating to the Simple Network Management Protocol
including:
* An extensible agent
* An SNMP library
* tools to request or set information from SNMP agents
* tools to generate and handle SNMP traps
* a version of the unix 'netstat' command using SNMP
* a graphical Perl/Tk/SNMP based mib browser
This package is originally based on the Carnegie Mellon University
SNMP implementation (version 2.1.2.1), but has developed significantly
since then.
Where can I get it?
------------------
Download:
- http://www.net-snmp.org/download/
- ftp://ftp.net-snmp.org/pub/sourceforge/net-snmp/
Web page:
- http://www.net-snmp.org/
Sourceforge Project page:
- http://www.net-snmp.org/project/
Mirrors (note that sourceforge download servers are mirrored themselves):
- US: ftp://ftp.freesnmp.com/mirrors/net-snmp/
- Greece: ftp://ftp.ntua.gr/pub/net/snmp/net-snmp/
What documentation is available?
-------------------------------
This FAQ (!)
README and individual READMEs for various platforms
README.thread (discusses threading issues)
INSTALL
PORTING
EXAMPLE.conf
man pages for the individual tools, files and the API
A guide for extending the agent
Tutorials for both ucd-snmp v4 and net-snmp v5
at http://www.net-snmp.org/tutorial/
and http://www.net-snmp.org/tutorial-5/ respectively
Most of this documentation (plus archives of the mailing lists)
is also available on our web page:
http://www.net-snmp.org/
There is also a Wiki (including a community-maintained version
of this FAQ) at
http://www.net-snmp.org/wiki/
Are there binaries available?
----------------------------
There are binaries for some versions/systems available under
the "net-snmp binaries" package on the project download site.
What's the difference between UCD-SNMP and Net-SNMP?
---------------------------------------------------
Not a great deal, really.
Although the project originally started at UC Davis (hence the name),
and it has always been based there, most of the contributors have had
little or no connection with this institution.
The move to SourceForge was intended to provide a more flexible
environment for the project, and to distribute the administrative
workload more evenly. The change of name simply reflects this move,
which was the last remaining link with UC Davis.
The 4.2.x line saw the last releases made using the ucd-snmp name,
and all releases on this line have been been bug-fixes only. Release
5.0 was the first version released under the Net-SNMP name, and all
further development is being done on the 5.x code base. The 4.2.x
code line is now almost completely dormant, and is due to be closed
down altogether.
Much of the work done for the various 5.x releases has involved
some fairly significant changes to the code - in particular the
architecture of the agent. However attempts have been made to retain
backwards compatibility as much as possible, and most code written
for earlier releases should continue to work. The most significant
change from the 4.2.x ucd suite to the 5.x Net-SNMP releases was a
restructuring of the header file organisation - not least a change
from <ucd-snmp/xxx.h> to <net-snmp/yyy.h>.
But given the maturity of the Net-SNMP code, this should be less
of a consideration for most current SNMP development projects.
What operating systems does it run on?
-------------------------------------
Both the applications and the agent have been reported as running
(at least in part) on the following operating systems:
* Linux (kernels 2.6 to 1.3)
* Solaris/SPARC (11 to 2.3), Solaris/Intel (10, 9) -- see
README.solaris
* HP-UX (10.20 to 9.01 and 11.23 to 11.0 -- see README.hpux11)
* Mac OS X (10.4 to 10.1) -- see README.osX
* NetBSD (2.0 to 1.0)
* FreeBSD (6.1 to 2.2)
* OpenBSD (4.0 to 2.6)
* BSDi (4.0.1 to 2.1)
* AIX (5.3, 5.2, 5.1, 4.3.3, 4.1.5, 3.2.5) -- see README.aix
* IRIX (6.5 to 5.1)
* OSF (4.0, 3.2 and Tru64 Unix 5.1B -- see README.tru64)
* SunOS 4 (4.1.4 to 4.1.2)
* Ultrix (4.5 to 4.2)
* Dynix/PTX 4.4
* QNX 6.2.1A
We have also been informed about a port to the Stratus VOS.
See http://ftp.stratus.com/vos/network/network.html for details.
See the next question for the status of Windows support.
Certain systems fail to compile particular portions of the agent.
These can usually be persuaded to compile (at the loss of some
functionality) by omitting the modules affected.
See the next question for more details.
Also note that the presence of a particular configuration in this
list does not imply a perfect or complete implementation. This is
simply what various people have reported as seeming to work. (Or more
frequently, the configurations people have reported problems which
that we think we've fixed!)
What happens if mine isn't listed?
---------------------------------
It's probably worth trying to compile it anyway. Unless your
system is significantly different to the supported configurations,
most of the code (library, applications and the agent infrastructure)
should probably compile with little or no difficulty. The most
likely source of problems will be MIB modules within the agent,
as this tends to be where the most system-specific code is found.
If only a few modules fail to compile, try removing them from
the agent by running "configure --with-out-mib-module=xxx,yyy",
and re-compiling. If a large number of modules fail, then it
might be easier to start from a relatively bare system, using
"configure --enable-mini-agent --with-defaults". Then if this
minimal agent compiles and runs successfully, try adding each of
the missing mibgroups individually using the configure option
'--with-mib-module'.
If configure fails with "invalid configuration" messages, or
you get completely stuck, contact the coders list for advice.
Similarly, if you manage to get this working on a new system,
please let us know of any code changes that you needed to make,
together with details of the hardware you're using, and what
versions of the operating system you've tried it on. The entry
'host' in the file 'config.status' should show this information.
Oh, and congratulations!
Does it run on Windows?
----------------------
The suite will compile and run on Win32 platforms, including
the library, command-line tools and the basic agent framework.
Note that the agent now includes support for the MIB-II module,
but this requires Microsoft's Core Platform SDK. Instructions
for how to install this are given in README.win32.
Pre-compiled binaries are available from the Net-SNMP web site.
As of Net-SNMP 5.4, the Net-SNMP agent is able to load the Windows
SNMP service extension DLLs by using the Net-SNMP winExtDLL extension.
Some Net-SNMP MIB modules, including the UCD pass-through extensions,
do not currently work under Windows. Volunteers to assist in
these missing modules are likely to welcomed with open arms :-)
Further details of Windows support (currently Visual C++, MinGW
and Cygnus cygwin32) is available in the file README.win32.
How do I find out about new releases?
------------------------------------
There is a mailing list for these announcements
net-snmp-announce@lists.sourceforge.net
To be added to (or removed from) this list, visit
http://www.net-snmp.org/lists/net-snmp-announce/. Or you can send a
message to the address
'net-snmp-announce-request@lists.sourceforge.net' with a subject
line of 'subscribe' (or 'unsubscribe' as appropriate).
Major code revisions may be announced more widely (e.g. on the
SNMP mailing lists, or comp.protocols.snmp) but this list is the most
reliable way to keep in touch with the status of this package.
Patches to fix known problems are also made available via the web site:
http://www.net-snmp.org/patches/
How can I find out what other people are doing?
----------------------------------------------
There is a general purpose discussion list
net-snmp-users@lists.sourceforge.net
To be added to (or removed from) this list, visit
http://www.net-snmp.org/lists/net-snmp-users. Or you can send a
message to the address 'net-snmp-users-request@lists.sourceforge.net'
with a subject line of 'subscribe' (or 'unsubscribe' as appropriate).
To find out what the developers are doing, and to help them out, please
read the PORTING file enclosed with the package.
There is also an net-snmp IRC channel set up on the freenode.net IRC
chat servers (you can use irc.freenode.net to connect and/or see
http://www.freenode.net/ for getting started with irc). Several
core developers hang out there on a regular basis.
How do I submit a patch or bug report?
-------------------------------------
The best way to submit a bug report is via the bug database through
the interface found at http://www.net-snmp.org/bugs/. Be sure to
include the version of the package that you've been working with,
the output of the command 'uname -a', the precise configuration or
command that triggers the problem and a copy of any output produced.
All patches should be submitted to the patch manager at
http://www.net-snmp.org/patches/. If possible, submit a
bug report describing the patch as well (referencing it by its patch
number) since the patch manager doesn't contain a decent description
field.
Questions about using the package should be directed at the
net-snmp-users@lists.sourceforge.net mailing list. Note that this
mailing list is relatively busy, and the people answering these
questions are doing so out of the goodness of their hearts, and in
addition to their main employment. Please note the following:
- use plain text mail, rather than HTML
- don't resend questions more than once
(even if no-one answered immediately)
- include full details of exact commands and error messages
("I've tried everything, and it doesn't work" isn't much use!)
- do *NOT* send messages to -users and -coders mailing lists
(most developers read both anyway)
- don't mail the developers privately - keep everything on the list
Remember that this is basically an unsupported package. Fundamentally
it's Open Source, so you have the source code. If you need something
fixing badly enough, it's up to you to do the work.
We can't promise to be able to solve all problems, but we'll
certainly try and help. But remember that this is basically an
unsupported package. It's Open Source, so if you need something
fixing badly enough, fundamentally it's up to you to do the work.
Can I reuse the code in my commercial application?
-------------------------------------------------
The details of the COPYRIGHTs on the package can be found in the COPYING
file. You should have your lawyer read this file if you wish to use the
code in your commercial application. We will not summarize here what is
in the file, as we're not lawyers and are unqualified to do so.
What's the difference between SNMPv1, SNMPv2 and SNMPv3?
-------------------------------------------------------
What's the difference between SNMPv2 and SNMPv2c?
------------------------------------------------
A full description is probably beyond the scope of this FAQ.
Very briefly, the original protocol and admin framework was
described in RFCs 1155-1157, and is now known as SNMPv1.
Practical experience showed up various problems and deficiencies
with this, and a number of revised frameworks were developed to try
and address these problems. Unfortunately, it proved difficult to
achieve any sort of agreement - particularly over the details of
the administrative framework to use.
There was less disagreement over the proposed changes to the
protocol operations. These included:
* increasing the range of errors that could be reported
* introducing "exception values"
(so a single missing value didn't affect
the other varbinds in the same request)
* a new GETBULK operation
(a supercharged GETNEXT)
* new notification PDUs
(closer in structure to the other request PDUs)
Strictly speaking, it's this revised protocol (originally defined
in RFC 1905, and most recently in RFC 3416) that is "SNMPv2".
The only framework based on this protocol that saw a significant
level of use was "Community-based SNMPv2" or "SNMPv2c" (defined in
RFCs 1901-1908). This retained the same administrative framework
as SNMPv1 (with all of the accompanying limitations), but using
the new protocol operations.
More recently, a new administrative framework has been developed,
building on the various competing SNMPv2 proposals, and using the
same SNMPv2 protocol operations. This is SNMPv3, which is defined
in RFCs 3411-3418. It addresses some of the deficiencies of the
community-based versions, including significant improvements to
the security of SNMP requests (like it finally has some!).
SNMPv3 is now a full IETF standard protocol.
Strictly speaking, SNMPv3 just defines a fairly abstract framework,
based around the idea of "Security Models" and "Access Control Models".
It's this combination of SNMPv3 plus accompanying models that actually
provides a working SNMP system.
However, the only models in common use are the "User-based Security
Model" (RFC 3414) and the "View-based Access Control Model" (RFC 3415).
So "SNMPv3" is frequently used to mean the combination of the basic
SNMPv3 framework with these two particular models.
This is also sometimes described as "SNMPv3/USM".
So in brief:
- SNMPv2c updated the protocol operations
but left the administrative framework unchanged.
- SNMPv3 updated the administrative framework
but left the protocol operations unchanged.
Which versions of SNMP are supported in this package?
----------------------------------------------------
This package currently supports the original SNMPv1, Community-based
SNMPv2 (i.e. RFCs 1901-1908), and SNMPv3 (i.e. RFCs 3411-3418).
The agent will respond to requests using any of these protocols,
and all the tools take a command-line option to determine which
version to use.
Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452)
was dropped with the 4.0 release of the UCD-snmp package.
Can I use SNMPv1 requests with an SNMPv2 MIB (or vice versa)?
------------------------------------------------------------
Yes.
The syntax used to specify a MIB file (better referred
to as SMIv1 or SMIv2) is purely concerned with how to define
the characteristics of various management objects. This is
(almost) completely unrelated to the versions of the protocol
used to operate on these values. So it is quite reasonable to
use SNMPv1 requests on objects defined using SMIv2, or SNMPv2
(or SNMPv3) requests on objects defined using SMIv1.
The one exception is objects of syntax Counter64, which are
only accessible using SNMPv2 or higher. SNMPv1 requests will
either treat such objects as an error, or skip them completely.
Where can I find more information about network management?
----------------------------------------------------------
There are a number of sites with network management information on
the World Wide Web. A couple of the most useful are
http://www.simpleweb.org/
http://www.snmplink.org/
http://www.mibdepot.com/
There are two Usenet newsgroups which are relevant.
'comp.dcom.net-management'
which discusses general issues relating to network management
'comp.protocols.snmp'
which is specifically concerned with use of SNMP in particular
(though there is a large overlap between these two groups).
The SNMP group also has an FAQ (split into two parts) which discusses more
general issues related to SNMP, including books, software, other sites,
how to get an enterprise number, etc, etc.
This is available from
ftp://rtfm.mit.edu/pub/usenet/comp.protocols.snmp/
or via any of the Web sites above.
Is Net-SNMP thread safe?
-----------------------
Strictly speaking, no. However, it should be possible to use the
library in a thread-safe manner. This is covered in detail in the file
README.thread (shipped with the standard distribution), but can be
summarised as follows:
- Call 'snmp_sess_init()' prior to activating any threads.
This reads in and parses MIB information (which isn't thread-safe)
as well as preparing a session structure for subsequent use.
- Open an SNMP session using 'snmp_sess_open()' which returns an
opaque session handle, which is essentially independent of any
other sessions (regardless of thread).
- Resource locking is not handled within the library, and is the
responsibility of the main application.
The applications and the agent have not been designed for threaded use.
It should be safe to use the agent library to embed a subagent within
a threaded application as long as *all* SNMP-related activity (including
generating traps, and parsing MIBs) is handled within a single thread.
Unfortunately, the SNMPv3 support was added about the same time as
the thread support and since they occurred in parallel the SNMPv3
support was never checked for multi-threading correctness. It is
most likely that it is not thread-safe at this time.
APPLICATIONS
============
How do I add a MIB?
------------------
This is actually two separate questions, depending on whether you
are referring to the tools, or the agent (or both).
See the next question or the next section respectively.
How do I add a MIB to the tools?
-------------------------------
Adding a MIB to the client-side tools has two main effects:
- it allows you to refer to MIB objects by name
(rather than having to use the numeric OIDs)
- it allows the results to be displayed in a more immediately
meaningful fashion. Not just giving the object names, but
also showing named enumeration values, and interpreting table
indexes properly (particularly for string and OID index values).
Most of the tools (apart from 'snmptable') will work quite happily
without any MIB files at all - although the results won't be displayed
in quite the same way.
The same holds true for the agent - see the AGENT section for details.
There are two steps required to add a new MIB file to the tools.
Firstly, copy the MIB file into the appropiate location:
cp MY-MIB.txt /usr/local/share/snmp/mibs
(which makes it available to everyone on the system)
or
mkdir $HOME/.snmp
mkdir $HOME/.snmp/mibs
cp MY-MIB.txt $HOME/.snmp/mibs
(which makes it available to you only)
Note that the location of the shared MIB directory may be different
from that given here - particularly if you're working with a vendor
supplied distribution. See where the MIBs are currently installed,
and copy the new MIB to the same place.
Secondly, tell the tools to load this MIB:
export MIBS=+MY-MIB
(load it for this session only)
or
echo "mibs +MY-MIB" >> $HOME/.snmp/snmp.conf
(load it every time)
This will add the new MIB to the list of MIBs loaded by default.
Omitting the '+' will *replace* the list of MIBs to be loaded by
the specified (colon-separated) list - together with any MIBs that
they explicitly rely on.
Note that the value for this variable is the name of the MIB
module, *not* the name of the MIB file. These are typically the
same (apart from the .txt suffix), but if in doubt, check the contents
of the file. The value to use is the token immediately before the
word DEFINITIONS at the start of the file.
If you prefer to have the tools load all available MIBs (which
may slow them down), then set the MIBS environmental variable
(or the snmp.conf token "mibs") to the special value "ALL".
Note that you need *both* steps.
Why can't I see anything from the agent?
---------------------------------------
There are two main general causes of problems retrieving information
from the agent. Either the client tool may not like the request (and
refuse to send it at all), or the agent may not respond with anything
useful. The simplest way to distinguish between the two is to run the
command with the command-line option '-d'.
If this doesn't display a hex dump of the raw outgoing packet, then
it's the client side which is dropping the request. Hopefully you
should see some form of error message, to help identify what's wrong.
If this displays one or more outgoing dumps (but nothing coming back),
then the request is failing at the agent end. See the next entry for
more details.
If you see dumps of both the outgoing request, and a response, but
no results are displayed, then either there may be a problem with
decoding the response (in which case you should see an error message),
or the agent may simply not support the requested information (and the
response is being discarded as irrelevant).
Why doesn't the agent respond?
-----------------------------
Assuming that the agent is actually sending the request (see the
previous entry), there are two main likely causes for the agent not
to respond. Either it doesn't receive the request (e.g. it's being
blocked by a firewall or packet filtering), or it receives it, but
is unwilling (or unable) to process it.
If the remote system is running the Net-SNMP agent, then the easiest
way to check what's going wrong is to shut down the agent, and re-start
it using the options:
-f -Le -d
This will display raw dumps of packets seen (or sent) by the agent,
just as the '-d' flag did for the client side in the previous entry.
Restart the agent with these flags, and send the same query as before.
If the agent doesn't display anything in response to this request, then
it's probably some form of firewall settings, which are preventing the
agent from ever seeing the request.
If the agent displays a dump of the incoming request, but nothing going
out, then the most likely cause is access control settings. See the
relevant entries in the AGENT section for details.
A third possibility is that the agent *is* responding to the request,
but only after a long delay. This would be indicated by a series of
incoming packet dumps (showing various retries from the client side),
followed by several outgoing dumps - possibly long after the client
tool has given up in disgust.
See the entry
The agent worked for a while, then stopped responding. Why?
later in this section.
The same basic causes could also affect other vendors' SNMP agents.
Please consult the relevant documentation for how to investigate and
address such problems.
I can see the system group, but nothing else. Why?
--------------------------------------------------
This is almost definitely due to the access configuration of the agent.
Many pre-configured systems (such as most Linux distributions) will only
allow access to the system group by default, and need to be configured
to enable more general access.
The easiest way to test this is to try a GETNEXT request that ought
to return the entry of interest.
e.g.
snmpgetnext -v1 -c public localhost UCD-SNMP-MIB::versionTag
instead of
snmpget -v1 -c public localhost UCD-SNMP-MIB::versionTag.0
If the agent responds with "end of MIB" or a different object, then
either the agent doesn't implement that particular object at all, or
the access control won't allow you access to it.
See the entries on access control in the AGENT section for how to
configure the Net-SNMP agent, or consult the agent's own documentation.
Why can't I see values in the <INSERT ENTERPRISE HERE> tree?
-----------------------------------------------------------
If you're walking a specific tree, but failing to see anything in
it, then the most likely cause is that the agent simply does not
implement those particular MIB objects. Or if it does, that the
access control or other configuration settings mean that there's
nothing for you to see there.
However, if you're trying a basic "snmpwalk" with no explicit OID
specified, then this would also explain why you're not seeing any
enterprise-specific results.
By default, unless given an explicit starting OID, then the 'snmpwalk'
command will display the contents of the 'mib-2' tree, containing most
of the IETF-standard management information supported by the agent.
When the agent reaches the end of this tree, it will return the first
enterprise-specific value, and 'snmpwalk' will recognise that this
marks the end of the (implicitly) request tree, and stop. No
enterprise-specific information will be displayed.
To walk the whole tree, and see *all* the information that the
agent supports, specify a starting point of '.iso' or '.1'.
To walk a specific enterprise subtree, specify the root of this tree
as the starting point - e.g:
snmpwalk -v1 -c public localhost UCD-SNMP-MIB::ucdavis
There is more information about particular UCD-specific subtrees in
the AGENT section.
The agent worked for a while, then stopped responding. Why?
-----------------------------------------------------------
There are three basic possibilities:
- the agent has crashed
- it is hanging
- it is temporarily overloaded
Detecting whether the agent has crashed should be fairly straighforward.
If you can reliably reproduce this crash (e.g. by sending a particular
SNMP request), then contact the coders list for advice.
It's the other two cases that are probably more significant.
To tell the difference between these two, try leaving the agent
undisturbed for a while, and then probe it using a single 'snmpget'
request, specifying a longer timeout (e.g. '-t 120'). If it now
responds, then something was probably sending requests (including
duplicate retries) faster than the agent could process them, and it
was building up a backlog. Try adjusting the timeout period and retry
frequency of these client requests, or look at improving the efficiency
of the implementation of the relevant MIB objects.
If the agent remains unresponsive (particularly if the load on the
system is steadily climbing), then it's probably hanging, and all
you can really do is restart the agent. If you can identify what
causes this to happen, then contact the coders list for advice.
Requesting an object fails with "Unknown Object Identifier" Why?
----------------------------------------------------------------
If a general snmpwalk shows a particular entry, but asking for it more
specifically gives a "sub-identifier not found:" or "Unknown Object
Identifier" error, then that's a problem with the tool, rather than
the agent.
Firstly, make sure that you're asking for the object by the right name.
Object descriptors are case-sensitive, so asking for 'sysuptime' will
not be recognised, but 'sysUpTime' will.
Alternatively, the object may be defined in a MIB that hasn't been
loaded. Try loading in all the MIB files:
snmpget -m ALL -v1 -c public localhost sysUpTime.0
or specify the name of the appropriate MIB explicitly:
snmpget -v1 -c public myhost SNMPv2-MIB::sysUpTime.0
Note that this uses the name of the *module*, not the name of the file.
See the second entry in this section for the distinction. However,
if 'snmpwalk' displays the object by name, this is unlikely to be the
cause, and you should look closely at the exact object name you are using.
Why do I get "noSuchName" when asking for "sysUpTime" (or similar)?
------------------------------------------------------------------
Assuming that you do have access to this object, the most likely
cause is forgetting the "instance subidentifier".
If you try walking the 'system' group, you should notice that all
of the results have a number after the MIB object name. This is
the "instance subidentifier" of that particular MIB instance.
For values from the sysORTable, this basically provides an index into
the table, and should be very familiar. But the other values in the
system group also have an instance number displayed. For non-table
objects ("scalars"), this instance subidentifier will always be '0',
and it *must* be included when making a GET request.
Compare the following:
$ snmpget -v1 -c public localhost sysUpTime
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
This name doesn't exist: system.sysUpTime
$ snmpget -v1 -c public localhost sysUpTime.0
system.sysUpTime.0 = Timeticks: (69189271) 8 days, 0:11:32.71
This is a little less obscure when using SNMPv2c or v3 requests:
$ snmpget -v 2c -c public localhost sysUpTime
system.sysUpTime = No Such Instance currently exists
Why do I sometimes get "End of MIB" when walking a tree, and sometimes not?
--------------------------------------------------------------------------
This depends on which MIB modules are supported by the agent you are
querying and exactly what you're asking for.
Note that a tree is walked by repeatedly asking for "the next entry" until
all the values under that tree have been retrieved. However, the agent has
no idea that this is what's happening - all it sees is a request for "the
next entry after X".
If the object X happens to be the last entry in a sub-tree, the agent will
provide the next object supported (as requested) even though this will be
in a different subtree. It's up to the querying tool to recognise that
this last result lies outside the area of interest, and simply discard it.
If the object X happens to be the last entry supported by the agent, it
doesn't have another object to provide, so returns an "end of MIB"
indication. The Net-SNMP tools report this with the message above.
But in either case, the actual information provided will be the same.
How do I use SNMPv3?
-------------------
The simplest form of SNMPv3 request (unauthenticated, unencrypted)
would be something like:
snmpget -v 3 -l noAuthNoPriv localhost sysUpTime.0
An authenticated request would specify a username and pass phrase:
snmpget -v 3 -l authNoPriv -u dave -A "Open the Door"
localhost sysUpTime.0
A fully secure request would also specify the privacy pass phrase:
snmpget -v 3 -l authPriv -u dave -A "Open the Door"
-X "Bet you can't see me" localhost sysUpTime.0
In practise, most of these would probably be set via configuration
directives in a personal $HOME/.snmp/snmp.conf file (note, *not* the
agent's snmpd.conf file). The equivalent settings for the third
example would be:
defSecurityName dave
defSecurityLevel authPriv
defAuthPassphrase "Open the Door"
defPrivPassphrase "Bet you can't see me"
If the AuthPassphrase and the PrivPassphrase are the same, then you
can use the single setting
defPassphrase "Open the Door and see me"
instead.
See the AGENT section for how to configure the agent for SNMPv3 access.
I cannot set any variables in the MIB.
-------------------------------------
There are three possible reasons for this:
Many MIB objects are defined as "read-only" and inherently cannot be
changed via SET requests. Attempts to do so will typically be dropped
by the 'snmpset' command without ever being sent to the agent.
Of those objects that can in principle be changed, the agent may not
include the code necessary to support SET requests. (GET and GETNEXT
are much easier to handle - particularly for objects relating to the
internals of the underlying operating system).
Even if SET support has been implemented, the agent may not be configured
to allow write access to this object.
Ready-installed distributions (such as those shipped with Linux) tend
to be configured with read-only access to part of the mib tree (typically
just the system group) and no write access at all.
To change this, you will need to set up the agent's access control
configuration. See the AGENT section for more details.
Note that neither the community string "public" nor "private" can be
used to set variables in a typical default configuration.
Variables seem to disappear when I try to set them. Why?
--------------------------------------------------------
This is actually the same as the previous question - it just isn't
particularly obvious, particularly when using SNMPv1. A typical
example of this effect would be
$ snmpget -v1 -c public localhost system.sysLocation.0
system.sysLocation.0 = somewhere nearby
$ snmpset -v1 -c public localhost system.sysLocation.0 s "right here"
Error in packet.
Reason: (noSuchName) There is no such variable name in this MIB.
This name doesn't exist: system.sysLocation.0
Trying the same request using SNMPv2 or above is somewhat more informative:
$ snmpset -v 2c -c public localhost system.sysLocation.0 s "right here"