# &faqguide;

Where can I find more about SNMP?

There are many websites that explain SNMP at all levels of detail. A great general introduction can be found at http://en.wikipedia.org/wiki/SNMP

If you are interested in the nitty gritty details of the protocol, then please look at RFC 3410. RFC 3410 maps out the many other RFCs that define SNMP, and can be found at http://www.rfc-archive.org/getrfc.php?rfc=3410

Where can I find more about NetSNMP?

NetSNMP source code, documentation, FAQs, and tutorials can all be found at http://net-snmp.sourceforge.net/.

Where can I find out more about AgentX?

The full details of the AgentX protocol are explained in RFC 2741, available at: http://www.rfc-archive.org/getrfc.php?rfc=2741

Why am I not receiving any SNMP Traps?

Assuming you've configured the trap thresholds in &kamailioconfig; with something similar to:

        modparam("snmpstats", "MsgQueueMinorThreshold", 1234)
        modparam("snmpstats", "MsgQueueMajorThreshold", 5678)

        modparam("snmpstats", "dlg_minor_threshold", 500)
        modparam("snmpstats", "dlg_minor_threshold", 600)

Then either &kamailio; is not reaching these thresholds (which is a good thing), or you haven't set up the trap monitor correctly. To prove this to yourself, you can start NetSNMP with:

        snmpd -f -Dtrap -x localhost:705

The -f tells the NetSNMP process to not daemonize, and the -Dtrap enables trap debug logs. You should see something similar to the following:

        registered debug token trap, 1
        trap: adding callback trap sink            ----- You should see both
        trapsess: adding to trap table             ----- of these lines.
        Turning on AgentX master support.
        trap: send_trap 0 0 NET-SNMP-TC::linux
        trap: sending trap type=167, version=1
        NET-SNMP version 5.3.1

If the two lines above did not appear, then you probably have not included the following in your snmpd.conf file.

        trap2sink machineToSendTrapsTo:machinesPortNumber.

When a trap has been received by snmpd, the following will appear in the above output:

        sent_trap -1 -1 NET-SNMP-TC::linus
        sending trap type=167, version=1

You'll also need a program to collect the traps and do something with them (such as sending them to syslog). NetSNMP provides snmptrapd for this. Other solutions exist as well. Google is your friend.

&kamailio; refuses to load the SNMPStats module. Why is it displaying "load_module: could not open module snmpstats.so"?

On some systems, you may receive the following error at stdout or the log files depending on the configuration.

        ERROR: load_module: could not open module </usr/local/lib/kamailio/modules_k/snmpstats.so>:
               libnetsnmpmibs.so.10: cannot open shared object file: No such file or directory.

This means one of two things:

1. You did not install NetSNMP. ("make install" if building from source)

2. The dynamic linker cannot find the necessary libraries.

In the second case, the fix is as follows:

1. find / -name "libnetsnmpmibs*"

   - You will find a copy unless you haven't installed NetSNMP. Make note of the path.

2. less /etc/ld.so.conf

   - If the file is missing the path from step 1, then add the path to ld.so.conf

3. ldconfig

4. Try starting &kamailio; again.

Alternatively, you may prefix your startup command with:

        LD_LIBRARY_PATH=/path/noted/in/step/one/above

For example, on my system I ran:

        LD_LIBRARY_PATH=/usr/local/lib &ctltool; start

How can I learn what all the scalars and tables are?

All scalars and tables are named in the SNMPStats module overview. The files KAMAILIO-MIB, KAMAILIO-REG-MIB, KAMAILIO-SIP-COMMON-MIB and KAMAILIO-SIP-SERVER-MIB contain the full definitions and descriptions. Note however, that the MIBs may actually contain scalars and tables which are currently not provided by the SNMPStats module. Therefore, it is better to use NetSNMP's snmptranslate as an alternative. Take the kamailioSIPEntityType scalar as an example. You can invoke snmptranslate as follows:

        snmptranslate -TBd kamailioSIPEntityType

Which would result in something similar to the following:

        -- FROM       KAMAILIO-SIP-COMMON-MIB
        -- TEXTUAL CONVENTION KamailioSIPEntityRole
        SYNTAX        BITS {other(0), userAgent(1), proxyServer(2), redirectServer(3), registrarServer(4)}
        MAX-ACCESS    read-only
        STATUS        current
        DESCRIPTION   " This object identifies the list of SIP entities this
                       row is related to. It is defined as a bit map.  Each
                       bit represents a type of SIP entity.
                       If a bit has value 1, the SIP entity represented by
                       this row plays the role of this entity type.

                       If a bit has value 0, the SIP entity represented by
                       this row does not act as this entity type
                       Combinations of bits can be set when the SIP entity
                       plays multiple SIP roles."

Why do snmpget, snmpwalk, and snmptable always time out?

If your snmp operations are always returning with: "Timeout: No Response from localhost", then chances are that you are making the query with the wrong community string. Default installs will most likely use "public" as their default community strings. Grep your snmpd.conf file for the string "rocommunity", and use the result as your community string in your queries.

How do I use snmpget?

NetSNMP's snmpget is used as follows:

        snmpget -v 2c -c theCommunityString machineToSendTheMachineTo scalarElement.0

For example, consider an snmpget on the kamailioSIPEntityType scalar, run on the same machine running the &kamailio; instance, with the default "public" community string. The command would be:

        snmpget -v2c -c public localhost kamailioSIPEntityType.0

Which would result in something similar to:

        KAMAILIO-SIP-COMMON-MIB::kamailioSIPEntityType.0 = BITS: F8 \
    		other(0) userAgent(1) proxyServer(2)          \
    		redirectServer(3) registrarServer(4)

How do I use snmptable?

NetSNMP's snmptable is used as follows:

        snmptable -Ci -v 2c -c theCommunityString machineToSendTheMachineTo theTableName

For example, consider the kamailioSIPRegUserTable. If we run the snmptable command on the same machine as the running &kamailio; instance, configured with the default "public" community string. The command would be:

        snmptable -Ci -v 2c -c public localhost kamailioSIPRegUserTable

Which would result in something similar to:

        index kamailioSIPUserUri kamailioSIPUserAuthenticationFailures
            1       DefaultUser                                    0
            2            bogdan                                    0
            3    jeffrey.magder                                    0

Where can I find more about &kamailio;?

Take a look at &kamailiohomelink;.

Where can I post a question about this module?

First at all check if your question was already answered on one of our mailing lists:

- User Mailing List - &kamailiouserslink;

- Developer Mailing List - &kamailiodevlink;

E-mails regarding any stable &kamailio; release should be sent to &kamailiousersmail; and e-mails regarding development versions should be sent to &kamailiodevmail;.

How can I report a bug?

Please follow the guidelines provided at: &kamailiobugslink;.