1SNMPStats Module (Simple Network Management Protocal Statistic Module)
2
3Jeffrey Magder
4
5 SOMA Networks, Inc.
6
7Edited by
8
9Jeffrey Magder
10
11Olle E. Johansson
12
13 Copyright © 2006 SOMA Networks, Inc.
14
15 Copyright © 2013 Edvina AB, Sollentuna, Sweden
16 __________________________________________________________________
17
18 Table of Contents
19
20 1. Admin Guide
21
22 1. Overview
23
24 1.1. General Scalar Statistics
25 1.2. SNMP Tables
26 1.3. Alarm Monitoring
27
28 2. How it works
29
30 2.1. How the SNMPStats module gets its data
31 2.2. How data is moved from the SNMPStats module to a NOC
32
33 3. Dependencies
34
35 3.1. Kamailio Modules
36 3.2. External Libraries or Applications
37
38 4. Parameters
39
40 4.1. sipEntityType (String)
41 4.2. MsgQueueMinorThreshold (Integer)
42 4.3. MsgQueueMajorThreshold (Integer)
43 4.4. dlg_minor_threshold (Integer)
44 4.5. dlg_major_threshold (Integer)
45 4.6. snmpgetPath (String)
46 4.7. snmpCommunity (String)
47 4.8. export_registrar (int)
48
49 5. Functions
50 6. Installation and Running
51
52 6.1. Compiling the SNMPStats Module
53 6.2. Configuring NetSNMP to allow connections from the
54 SNMPStats module.
55
56 6.3. Configuring the SNMPStats module for communication with
57 a Master Agent
58
59 6.4. Testing for a proper Configuration
60
61 2. Frequently Asked Questions
62
63 List of Examples
64
65 1.1. Setting the sipEntityType parameter
66 1.2. Setting the MsgQueueMinorThreshold parameter
67 1.3. Setting the MsgQueueMajorThreshold parameter
68 1.4. Setting the dlg_minor_threshold parameter
69 1.5. Setting the dlg_major_threshold parameter
70 1.6. Setting the snmpgetPath parameter
71 1.7. Setting the snmpCommunity parameter
72 1.8. Setting the export_registrar parameter
73
74Chapter 1. Admin Guide
75
76 Table of Contents
77
78 1. Overview
79
80 1.1. General Scalar Statistics
81 1.2. SNMP Tables
82 1.3. Alarm Monitoring
83
84 2. How it works
85
86 2.1. How the SNMPStats module gets its data
87 2.2. How data is moved from the SNMPStats module to a NOC
88
89 3. Dependencies
90
91 3.1. Kamailio Modules
92 3.2. External Libraries or Applications
93
94 4. Parameters
95
96 4.1. sipEntityType (String)
97 4.2. MsgQueueMinorThreshold (Integer)
98 4.3. MsgQueueMajorThreshold (Integer)
99 4.4. dlg_minor_threshold (Integer)
100 4.5. dlg_major_threshold (Integer)
101 4.6. snmpgetPath (String)
102 4.7. snmpCommunity (String)
103 4.8. export_registrar (int)
104
105 5. Functions
106 6. Installation and Running
107
108 6.1. Compiling the SNMPStats Module
109 6.2. Configuring NetSNMP to allow connections from the SNMPStats
110 module.
111
112 6.3. Configuring the SNMPStats module for communication with a
113 Master Agent
114
115 6.4. Testing for a proper Configuration
116
1171. Overview
118
119 1.1. General Scalar Statistics
120 1.2. SNMP Tables
121 1.3. Alarm Monitoring
122
123 The SNMPStats module provides an SNMP management interface to Kamailio.
124 Specifically, it provides general SNMP queryable scalar statistics,
125 table representations of more complicated data such as user and contact
126 information, and alarm monitoring capabilities.
127
128 The MIB has been renamed in version 4.0.0 to reflect the product name.
129 Please note that all the OID names has changed, as well as the MIB
130 itself.
131
1321.1. General Scalar Statistics
133
134 The SNMPStats module provides a number of general scalar statistics.
135 Details are available in KAMAILIO-MIB, KAMAILIO-REG-MIB,
136 KAMAILIO-SIP-COMMON-MIB, and KAMAILIO-SIP-SERVER-MIB. But briefly,
137 these scalars are:
138
139 * kamailioSIPProtocolVersion
140 * kamailioSIPServiceStartTime
141 * kamailioSIPEntityType
142 * kamailioSIPSummaryInRequests
143 * kamailioSIPSummaryOutRequest
144 * kamailioSIPSummaryInResponses
145 * kamailioSIPSummaryOutResponses
146 * kamailioSIPSummaryTotalTransactions
147 * kamailioSIPCurrentTransactions
148 * kamailioSIPNumUnsupportedUris
149 * kamailioSIPNumUnsupportedMethods
150 * kamailioSIPOtherwiseDiscardedMsgs
151 * kamailioSIPProxyStatefulness kamailioSIPProxyRecordRoute
152 * kamailioSIPProxyAuthMethod
153 * kamailioSIPNumProxyRequireFailures
154 * kamailioSIPRegMaxContactExpiryDuration
155 * kamailioSIPRegMaxUsers
156 * kamailioSIPRegCurrentUsers
157 * kamailioSIPRegDfltRegActiveInterval
158 * kamailioSIPRegAcceptedRegistrations
159 * kamailioSIPRegRejectedRegistrations
160 * kamailioMsgQueueDepth
161 * kamailioCurNumDialogs
162 * kamailioCurNumDialogsInProgress
163 * kamailioCurNumDialogsInSetup
164 * kamailioTotalNumFailedDialogSetups
165
166 There are also scalars associated with alarms. They are as follows:
167
168 * kamailioMsgQueueMinorThreshold
169 * kamailioMsgQueueMajorThreshold
170 * kamailioMsgQueueDepthAlarmStatus
171 * kamailioMsgQueueDepthMinorAlarm
172 * kamailioMsgQueueDepthMajorAlarm
173 * kamailioDialogLimitMinorThreshold
174 * kamailioDialogLimitMajorThreshold
175 * kamailioDialogUsageState
176 * kamailioDialogLimitAlarmStatus
177 * kamailioDialogLimitMinorAlarm
178 * kamailioDialogLimitMajorAlarm
179
180 In Kamailio 4.1 a set of new OIDs was added to reflect the Kamailio
181 configuration, the version, core status (memory, connections),
182 transports and module data.
183
1841.2. SNMP Tables
185
186 The SNMPStats module provides several tables, containing more
187 complicated data. The current available tables are:
188
189 kamailioSIPPortTable, kamailioSIPMethodSupportedTable,
190 kamailioSIPStatusCodesTable, kamailioSIPRegUserTable,
191 kamailioSIPContactTable, kamailioSIPRegUserLookupTable
192
1931.3. Alarm Monitoring
194
195 If enabled, the SNMPStats module will monitor for alarm conditions.
196 Currently, there are two alarm types defined.
197 1. The number of active dialogs has passed a minor or major threshold.
198 The idea is that a network operation centre can be made aware that
199 their SIP servers may be overloaded, without having to explicitly
200 check for this condition.
201 If a minor or major condition has occurred, then a
202 kamailioDialogLimitMinorEvent trap or a
203 kamailioDialogLimitMajorEvent trap will be generated, respectively.
204 The minor and major thresholds are described in the parameters
205 section below.
206 2. The number of bytes waiting to be consumed across all of Kamailios
207 listening ports has passed a minor or major threshold. The idea is
208 that a network operation centre can be made aware that a machine
209 hosting a SIP server may be entering a degraded state, and to
210 investigate why this is so.
211 If the number of bytes to be consumed passes a minor or major
212 threshold, then a kamailioMsgQueueDepthMinorEvent or
213 kamailioMsgQueueDepthMajorEvent trap will be sent out,
214 respectively.
215
216 Full details of these traps can be found in the distributions
217 KAMAILIO-MIB file.
218
2192. How it works
220
221 2.1. How the SNMPStats module gets its data
222 2.2. How data is moved from the SNMPStats module to a NOC
223
2242.1. How the SNMPStats module gets its data
225
226 The SNMPStats module uses Kamailios internal statistic framework to
227 collect most of its data. However, there are two exceptions.
228 1. The kamailioSIPRegUserTable and kamailioSIPContactTable rely on the
229 usrloc modules callback system. Specifically, the SNMPStats module
230 will receive callbacks whenever a user/contact is added to the
231 system.
232 2. The SNMPStats modules kamailioSIPMsgQueueDepthMinorEvent and
233 kamailioSIPMsgQueueDepthMajorEvent alarms rely on the Kamailio core
234 to find out what interfaces, ports, and transports Kamailio is
235 listening on. However, the module will actually query the proc file
236 system to find out the number of bytes waiting to be consumed.
237 (Currently, this will only work on systems providing the proc file
238 system).
239
2402.2. How data is moved from the SNMPStats module to a NOC
241
242 We have now explained how the SNMPStats module gathers its data. We
243 still have not explained how it exports this data to a NOC (Network
244 Operations Centre), or administrator.
245
246 The SNMPStats module expects to connect to a Master Agent. This would
247 be a NetSNMP daemon running either on the same system as the Kamailio
248 instance, or on another system. (Communication can take place over TCP,
249 so there is no restriction that this daemon need be on the same system
250 as Kamailio).
251
252 If the master agent is unavailable when Kamailio first starts up, the
253 SNMPStats module will continue to run. However, you will not be able to
254 query it. Thankfully, the SNMPStats module continually looks for its
255 master agent. So even if the master agent is started late, or if the
256 link to the SNMPStats module is severed due to a temporary hardware
257 failure or crashed and restarted master agent, the link will eventually
258 be re-established. No data should be lost, and querying can begin
259 again.
260
261 To request for this data, you will need to query the master agent. The
262 master agent will then redirect the request to the SNMPStats module,
263 which will respond to the master agent, which will in turn respond to
264 your request.
265
2663. Dependencies
267
268 3.1. Kamailio Modules
269 3.2. External Libraries or Applications
270
2713.1. Kamailio Modules
272
273 The SNMPStats module provides a plethora of statistics, some of which
274 are collected by other modules. If the dependent modules are not loaded
275 then those specific statistics will still be returned, but with zeroed
276 values. All other statistics will continue to function normally. This
277 means that the SNMPStats module has no hard/mandatory dependencies on
278 other modules. There are however, soft dependencies, as follows:
279 * usrloc - all scalars and tables relating to users and contacts are
280 dependent on the usrloc module. If the module is not loaded, the
281 respective tables will be empty.
282 * dialog or dialog-ng - all scalars relating to the number of dialogs
283 are dependent on the presence of a dialog module. Furthermore, if
284 the module is not loaded, then the kamailioDialogLimitMinorEvent,
285 and kamailioDialogLimitMajorEvent alarm will be disabled.
286
287 The contents of the kamailioSIPMethodSupportedTable change depending on
288 which modules are loaded.
289
2903.2. External Libraries or Applications
291
292 The following libraries or applications must be installed before
293 running Kamailio with this module loaded:
294 * NetSNMP v5.3 or greater - NetSNMP must be around at the time of
295 compilation. Furthermore, there are several shared objects that
296 must be loadable at the time SNMPStats is loaded. This means that
297 NetSNMP must be installed (but not necessarily running) on the
298 system that has loaded the SNMPStats module. (Details can be found
299 in the compilation section below).
300 * lm_sensors-dev - on some OS-es, this lib is required for
301 compilation (http://www.lm-sensors.org/).
302
3034. Parameters
304
305 4.1. sipEntityType (String)
306 4.2. MsgQueueMinorThreshold (Integer)
307 4.3. MsgQueueMajorThreshold (Integer)
308 4.4. dlg_minor_threshold (Integer)
309 4.5. dlg_major_threshold (Integer)
310 4.6. snmpgetPath (String)
311 4.7. snmpCommunity (String)
312 4.8. export_registrar (int)
313
3144.1. sipEntityType (String)
315
316 This parameter describes the entity type for this Kamailio instance,
317 and will be used in determining what is returned for the
318 kamailioSIPEntityType scalar. Valid parameters are:
319
320 registrarServer, redirectServer, proxyServer, userAgent,
321 edgeproxyServer, sipcaptureServer,other
322
323 Example 1.1. Setting the sipEntityType parameter
324...
325modparam("snmpstats", "sipEntityType", "registrarServer")
326modparam("snmpstats", "sipEntityType", "proxyServer")
327...
328
329 Note that as the above example shows, you can define this parameter
330 more than once. This is of course because a given Kamailio instance can
331 take on more than one role. The edgeproxyServer is an edge server using
332 the outbound module and path extensions. The sipcaptureServer is a
333 Homer Sip Capture server that collect SIP messages.
334
3354.2. MsgQueueMinorThreshold (Integer)
336
337 The SNMPStats module monitors the number of bytes waiting to be
338 consumed by Kamailio. If the number of bytes waiting to be consumed
339 exceeds a minor threshold, the SNMPStats module will send out an
340 kamailioMsgQueueDepthMinorEvent trap to signal that an alarm condition
341 has occurred. The minor threshold is set with the
342 MsgQueueMinorThreshold parameter.
343
344 Example 1.2. Setting the MsgQueueMinorThreshold parameter
345...
346modparam("snmpstats", "MsgQueueMinorThreshold", 2000)
347...
348
349 If this parameter is not set, then there will be no minor alarm
350 monitoring.
351
3524.3. MsgQueueMajorThreshold (Integer)
353
354 The SNMPStats module monitors the number of bytes waiting to be
355 consumed by Kamailio. If the number of bytes waiting to be consumed
356 exceeds a major threshold, the SNMPStats module will send out an
357 kamailioMsgQueueDepthMajorEvent trap to signal that an alarm condition
358 has occurred. The major threshold is set with the
359 MsgQueueMajorThreshold parameter.
360
361 Example 1.3. Setting the MsgQueueMajorThreshold parameter
362...
363modparam("snmpstats", "MsgQueueMajorThreshold", 5000)
364...
365
366 If this parameter is not set, then there will be no major alarm
367 monitoring.
368
3694.4. dlg_minor_threshold (Integer)
370
371 The SNMPStats module monitors the number of active dialogs. If the
372 number of active dialogs exceeds a minor threshold, the SNMPStats
373 module will send out an kamailioDialogLimitMinorEvent trap to signal
374 that an alarm condition has occurred. The minor threshold is set with
375 the dlg_minor_threshold parameter.
376
377 Example 1.4. Setting the dlg_minor_threshold parameter
378...
379 modparam("snmpstats", "dlg_minor_threshold", 500)
380...
381
382 If this parameter is not set, then there will be no minor alarm
383 monitoring.
384
3854.5. dlg_major_threshold (Integer)
386
387 The SNMPStats module monitors the number of active dialogs. If the
388 number of active dialogs exceeds a major threshold, the SNMPStats
389 module will send out an kamailioDialogLimitMajorEvent trap to signal
390 that an alarm condition has occurred. The major threshold is set with
391 the dlg_major_threshold parameter.
392
393 Example 1.5. Setting the dlg_major_threshold parameter
394...
395 modparam("snmpstats", "dlg_major_threshold", 750)
396...
397
398 If this parameter is not set, then there will be no major alarm
399 monitoring.
400
4014.6. snmpgetPath (String)
402
403 The SNMPStats module provides the kamailioSIPServiceStartTime scalar.
404 This scalar requires the SNMPStats module to perform a snmpget query to
405 the master agent. You can use this parameter to set the path to your
406 instance of NetSNMP's snmpget program.
407
408 Default value is “/usr/local/bin/”.
409
410 Example 1.6. Setting the snmpgetPath parameter
411...
412modparam("snmpstats", "snmpgetPath", "/my/custom/path/")
413...
414
4154.7. snmpCommunity (String)
416
417 The SNMPStats module provides the kamailioSIPServiceStartTime scalar.
418 This scalar requires the SNMPStats module to perform a snmpget query to
419 the master agent. If you have defined a custom community string for the
420 snmp daemon, you need to specify it with this parameter.
421
422 Default value is “public”.
423
424 Example 1.7. Setting the snmpCommunity parameter
425...
426modparam("snmpstats", "snmpCommunity", "customCommunityString")
427...
428
4294.8. export_registrar (int)
430
431 The SNMPStats module will export registrar (usrloc) records if this
432 parameter is set to 1. This will result in more memory usage and bigger
433 exporter structure.
434
435 If you enable this setting and NOT use it (i.e. not check the SNMP
436 tables for registrations) an internal memory queue of usrloc changes
437 will keep growing in shared (core) memory. To release the queue memory,
438 run snmpwalk or use a monitoring tool to check the tables with regular
439 intervals.
440
441 Default value is “0” (don't export).
442
443 Example 1.8. Setting the export_registrar parameter
444...
445modparam("snmpstats", "export_registrar", 1)
446...
447
4485. Functions
449
450 Currently, there are no exported functions.
451
4526. Installation and Running
453
454 6.1. Compiling the SNMPStats Module
455 6.2. Configuring NetSNMP to allow connections from the SNMPStats
456 module.
457
458 6.3. Configuring the SNMPStats module for communication with a Master
459 Agent
460
461 6.4. Testing for a proper Configuration
462
463 There are several things that need to be done to get the SNMPStats
464 module compiled and up and running.
465
4666.1. Compiling the SNMPStats Module
467
468 In order for the SNMPStats module to compile, you will need at least
469 version 5.3 of the NetSNMP source code. The source can be found at:
470 http://net-snmp.sourceforge.net/
471
472 For the specifics of installing NetSNMP, please see the INSTALL
473 document in the root of the NetSNMP source package.
474
475 The SNMPStats modules makefile requires that the NetSNMP script
476 "net-snmp-config" can run. At a minimum, running "net-snmp-config
477 --agent-libs" from the Kamailio source directory should return
478 something similar to:
479 -L/usr/local/lib -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp
480
481 The specifics of what is returned depends on how the system was
482 configured. If your NetSNMP installation was installed from an RPM (or
483 another packaged version), then there is a good chance that
484 net-snmp-config will return something unnecessarily longer. It is
485 highly recommended you install NetSNMP from source to avoid bringing in
486 excessive dependencies to the SNMPStats module.
487
4886.2. Configuring NetSNMP to allow connections from the SNMPStats module.
489
490 The SNMPStats module will communicate with the NetSNMP Master Agent.
491 This communication happens over a protocol known as AgentX. This means
492 that NetSNMP must have been compiled with AgentX support. This will
493 always be the case when you are compiling from source unless you
494 explicitly removed AgentX support with ./configure.
495
496 After AgentX support has been compiled into NetSNMP, its configuration
497 file needs to be changed to turn on AgentX support. The exact location
498 of the configuration file (snmpd.conf) may vary depending on your
499 system. On my system, it is located in:
500 /usr/local/share/snmp/snmpd.conf.
501
502 At the very end of the file add the following line:
503 master agentx
504
505 The line tells NetSNMP to act as an AgentX master agent, so that it can
506 accept connections from sub-agents such as the SNMPStats module.
507
508 There is still one last step. Even though we have compiled and
509 configured NetSNMP to have AgentX support, we still need to tell the
510 daemon which interface and port to listen to for AgentX connections.
511 This is done when the daemon is started as follows:
512 snmpd -x mySystemName:PortNumber
513
514 On my system, I start the NetSNMP daemon with:
515 snmpd -x localhost:705
516
517 This tells NetSNMP to act as a master agent, listening on the localhost
518 UDP interface at port 705.
519
5206.3. Configuring the SNMPStats module for communication with a Master Agent
521
522 The previous section explained how to set up a NetSNMP master agent to
523 accept AgentX connections. We now need to tell the SNMPStats module how
524 to communicate with this master agent. This is done by giving the
525 SNMPStats module its own NetSNMP configuration file. The file must be
526 named snmpstats.conf, and must be in the same folder as the snmpd.conf
527 file that was configured above. On my system this would be:
528 /usr/local/share/snmp/snmpstats.conf
529
530 The default configuration file included with the distribution can be
531 used, and contains the following:
532 agentXSocket tcp:localhost:705
533
534 The above line tells the SNMPStats module to register with the master
535 agent on the localhost, port 705. The parameters should match up with
536 the snmpd process. Note that the master agent (snmpd) does not need to
537 be present on the same machine as Kamailio. localhost could be replaced
538 with any other machine.
539
5406.4. Testing for a proper Configuration
541
542 As a quick test to make sure that the SNMPStats module sub-agent can
543 successfully connect to the NetSNMP Master agent, start snmpd with the
544 following:
545 snmpd -f -Dagentx -x tcp:localhost:705 2>&1 | less
546
547 You should see something similar to the following:
548 No log handling enabled - turning on stderr logging
549 registered debug token agentx, 1
550 ...
551 Turning on AgentX master support.
552 agentx/master: initializing...
553 agentx/master: initializing... DONE
554 NET-SNMP version 5.3.1
555
556 Now, start up Kamailio in another window. In the snmpd window, you
557 should see a bunch of:
558 agentx/master: handle pdu (req=0x2c58ebd4,trans=0x0,sess=0x0)
559 agentx/master: open 0x81137c0
560 agentx/master: opened 0x814bbe0 = 6 with flags = a0
561 agentx/master: send response, stat 0 (req=0x2c58ebd4,trans=0x0,sess=0x0)
562 agentx_build: packet built okay
563
564 The messages beginning with "agentx" are debug messages stating that
565 something is happening with an AgentX sub-agent, appearing because of
566 the -Dagentx snmpd switch. The large number of debug messages appear at
567 startup as the SNMPStats module registers all of its scalars and tables
568 with the Master Agent. If you receive these messages, then SNMPStats
569 module and NetSNMP daemon have both been configured correctly.
570
571Chapter 2. Frequently Asked Questions
572
573 2.1. Where can I find more about SNMP?
574 2.2. Where can I find more about NetSNMP?
575 2.3. Where can I find out more about AgentX?
576 2.4. Why am I not receiving any SNMP Traps?
577 2.5. Kamailio refuses to load the SNMPStats module. Why is it
578 displaying "load_module: could not open module snmpstats.so"?
579
580 2.6. How can I learn what all the scalars and tables are?
581 2.7. Why do snmpget, snmpwalk, and snmptable always time out?
582 2.8. How do I use snmpget?
583 2.9. How do I use snmptable?
584 2.10. Where can I find more about Kamailio?
585 2.11. Where can I post a question about this module?
586 2.12. How can I report a bug?
587
588 2.1.
589
590 Where can I find more about SNMP?
591
592 There are many websites that explain SNMP at all levels of detail. A
593 great general introduction can be found at
594 http://en.wikipedia.org/wiki/SNMP If you are interested in the nitty
595 gritty details of the protocol, then please look at RFC 3410. RFC 3410
596 maps out the many other RFCs that define SNMP, and can be found at
597 http://www.rfc-archive.org/getrfc.php?rfc=3410
598
599 2.2.
600
601 Where can I find more about NetSNMP?
602
603 NetSNMP source code, documentation, FAQs, and tutorials can all be
604 found at http://net-snmp.sourceforge.net/.
605
606 2.3.
607
608 Where can I find out more about AgentX?
609
610 The full details of the AgentX protocol are explained in RFC 2741,
611 available at: http://www.rfc-archive.org/getrfc.php?rfc=2741
612
613 2.4.
614
615 Why am I not receiving any SNMP Traps?
616
617 Assuming you've configured the trap thresholds in kamailio.cfg with
618 something similar to:
619 modparam("snmpstats", "MsgQueueMinorThreshold", 1234)
620 modparam("snmpstats", "MsgQueueMajorThreshold", 5678)
621
622 modparam("snmpstats", "dlg_minor_threshold", 500)
623 modparam("snmpstats", "dlg_minor_threshold", 600)
624
625 Then either Kamailio is not reaching these thresholds (which is a good
626 thing), or you haven't set up the trap monitor correctly. To prove this
627 to yourself, you can start NetSNMP with:
628 snmpd -f -Dtrap -x localhost:705
629
630 The -f tells the NetSNMP process to not daemonize, and the -Dtrap
631 enables trap debug logs. You should see something similar to the
632 following:
633 registered debug token trap, 1
634 trap: adding callback trap sink ----- You should see both
635 trapsess: adding to trap table ----- of these lines.
636 Turning on AgentX master support.
637 trap: send_trap 0 0 NET-SNMP-TC::linux
638 trap: sending trap type=167, version=1
639 NET-SNMP version 5.3.1
640
641 If the two lines above did not appear, then you probably have not
642 included the following in your snmpd.conf file.
643 trap2sink machineToSendTrapsTo:machinesPortNumber.
644
645 When a trap has been received by snmpd, the following will appear in
646 the above output:
647 sent_trap -1 -1 NET-SNMP-TC::linus
648 sending trap type=167, version=1
649
650 You'll also need a program to collect the traps and do something with
651 them (such as sending them to syslog). NetSNMP provides snmptrapd for
652 this. Other solutions exist as well. Google is your friend.
653
654 2.5.
655
656 Kamailio refuses to load the SNMPStats module. Why is it displaying
657 "load_module: could not open module snmpstats.so"?
658
659 On some systems, you may receive the following error at stdout or the
660 log files depending on the configuration.
661 ERROR: load_module: could not open module </usr/local/lib/kamailio/modules_k
662/snmpstats.so>:
663 libnetsnmpmibs.so.10: cannot open shared object file: No such file or
664 directory.
665
666 This means one of two things:
667 1. You did not install NetSNMP. ("make install" if building from
668 source)
669 2. The dynamic linker cannot find the necessary libraries.
670
671 In the second case, the fix is as follows:
672 1. find / -name "libnetsnmpmibs*"
673 + You will find a copy unless you haven't installed NetSNMP.
674 Make note of the path.
675 2. less /etc/ld.so.conf
676 + If the file is missing the path from step 1, then add the path
677 to ld.so.conf
678 3. ldconfig
679 4. Try starting Kamailio again.
680
681 Alternatively, you may prefix your startup command with:
682 LD_LIBRARY_PATH=/path/noted/in/step/one/above
683
684 For example, on my system I ran:
685 LD_LIBRARY_PATH=/usr/local/lib kamctl start
686
687 2.6.
688
689 How can I learn what all the scalars and tables are?
690
691 All scalars and tables are named in the SNMPStats module overview. The
692 files KAMAILIO-MIB, KAMAILIO-REG-MIB, KAMAILIO-SIP-COMMON-MIB and
693 KAMAILIO-SIP-SERVER-MIB contain the full definitions and descriptions.
694 Note however, that the MIBs may actually contain scalars and tables
695 which are currently not provided by the SNMPStats module. Therefore, it
696 is better to use NetSNMP's snmptranslate as an alternative. Take the
697 kamailioSIPEntityType scalar as an example. You can invoke
698 snmptranslate as follows:
699 snmptranslate -TBd kamailioSIPEntityType
700
701 Which would result in something similar to the following:
702 -- FROM KAMAILIO-SIP-COMMON-MIB
703 -- TEXTUAL CONVENTION KamailioSIPEntityRole
704 SYNTAX BITS {other(0), userAgent(1), proxyServer(2), redirectServer(3
705), registrarServer(4)}
706 MAX-ACCESS read-only
707 STATUS current
708 DESCRIPTION " This object identifies the list of SIP entities this
709 row is related to. It is defined as a bit map. Each
710 bit represents a type of SIP entity.
711 If a bit has value 1, the SIP entity represented by
712 this row plays the role of this entity type.
713
714 If a bit has value 0, the SIP entity represented by
715 this row does not act as this entity type
716 Combinations of bits can be set when the SIP entity
717 plays multiple SIP roles."
718
719 2.7.
720
721 Why do snmpget, snmpwalk, and snmptable always time out?
722
723 If your snmp operations are always returning with: "Timeout: No
724 Response from localhost", then chances are that you are making the
725 query with the wrong community string. Default installs will most
726 likely use "public" as their default community strings. Grep your
727 snmpd.conf file for the string "rocommunity", and use the result as
728 your community string in your queries.
729
730 2.8.
731
732 How do I use snmpget?
733
734 NetSNMP's snmpget is used as follows:
735 snmpget -v 2c -c theCommunityString machineToSendTheMachineTo scalarElement.
7360
737
738 For example, consider an snmpget on the kamailioSIPEntityType scalar,
739 run on the same machine running the Kamailio instance, with the default
740 "public" community string. The command would be:
741 snmpget -v2c -c public localhost kamailioSIPEntityType.0
742
743 Which would result in something similar to:
744 KAMAILIO-SIP-COMMON-MIB::kamailioSIPEntityType.0 = BITS: F8 \
745 other(0) userAgent(1) proxyServer(2) \
746 redirectServer(3) registrarServer(4)
747
748 2.9.
749
750 How do I use snmptable?
751
752 NetSNMP's snmptable is used as follows:
753 snmptable -Ci -v 2c -c theCommunityString machineToSendTheMachineTo theTable
754Name
755
756 For example, consider the kamailioSIPRegUserTable. If we run the
757 snmptable command on the same machine as the running Kamailio instance,
758 configured with the default "public" community string. The command
759 would be:
760 snmptable -Ci -v 2c -c public localhost kamailioSIPRegUserTable
761
762 Which would result in something similar to:
763 index kamailioSIPUserUri kamailioSIPUserAuthenticationFailures
764 1 DefaultUser 0
765 2 bogdan 0
766 3 jeffrey.magder 0
767
768 2.10.
769
770 Where can I find more about Kamailio?
771
772 Take a look at https://www.kamailio.org/.
773
774 2.11.
775
776 Where can I post a question about this module?
777
778 First at all check if your question was already answered on one of our
779 mailing lists:
780 * User Mailing List -
781 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
782 * Developer Mailing List -
783 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
784
785 E-mails regarding any stable Kamailio release should be sent to
786 <sr-users@lists.kamailio.org> and e-mails regarding development
787 versions should be sent to <sr-dev@lists.kamailio.org>.
788
789 2.12.
790
791 How can I report a bug?
792
793 Please follow the guidelines provided at:
794 https://github.com/kamailio/kamailio/issues.
795