Hello, 

I managed to get kamailio working with the module snmpstats and also to set a SNMP AgentX running. The issue was in the librairies location, i don't know why but i created symbolic links and it solved it.

But even if kamailio and snmpd agentx are running I still don't see any communication between them.
I done a tethereal capture on lo and i haven't see anything.

Here are the configuration files running :
snmpd.conf
name user default community
group    group v1 user
group    group v2c user
view     all              included .1
view     systemview      included .1.3.6.1.2.1.1
view     systemview      included .1.3.6.1.2.1.25.1.1
access group "" any noauth exact all none none
master agentx
agentXSocket    tcp:localhost:705


kamailio_params.cfg
[...]
loadmodule "snmpstats.so"
[...]
modparam("snmpstats", "sipEntityType", "registrarServer")
modparam("snmpstats", "sipEntityType", "proxyServer")
modparam("snmpstats", "snmpgetPath", "/usr/local/bin/")
modparam("snmpstats", "snmpCommunity", "community")
[...]

In the logs every time I restart kamailio I see this: "snmpd[26832]: Connection from UDP: [127.0.0.1]:57688->[127.0.0.1]" with a different port number at each iteration.
My guess is I have to configure this in the kamailio snmpstats parameters, but i don't find where regarding the documentation.
I made a file snmpstats.conf in the same folder than snmpd.conf with one line :
agentXSocket tcp:localhost:705

Thanks for your help.

Regards,

Igor.

2014-10-29 19:39 GMT+01:00 Igor Potjevlesch <igor.potjevlesch@gmail.com>:
Hello,

I tried to install the snmpstats module following this process :
I installed the dependencies for snmpstats module, then i modified modules.lst. 
Then i made a make modules, make, and make install.
Everything is fine so far.

After that, i edited kamailio.cfg the loadmodule for snmstats.so and when i launch kamailio I have the following error : "kamailio: ERROR: <core> [modparam.c:166]: set_mod_param_regex(): No module matching <snmpstats> found"

I also made a ldd :
# ldd -v -d -r /usr/local/lib64/kamailio/modules/snmpstats.so
        linux-vdso.so.1 =>  (0x00007ffff53ff000)
        libnetsnmpmibs.so.30 => not found
        libnetsnmpagent.so.30 => not found
        libnetsnmp.so.30 => not found
        libkcore.so.1 => /usr/local/lib64/kamailio/libkcore.so.1 (0x00007fca7823b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fca77ea8000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003d6ee00000)
undefined symbol: log_color     (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: dprint_crit   (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: log_prefix_val        (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: default_global_address        (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: log_stderr    (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: process_no    (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: core_cfg      (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: mem_block     (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: default_global_port   (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: log_level_info        (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: dprint_color_reset    (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: parse_params  (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: parse_msg     (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: fm_malloc     (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: get_sock_info_list    (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: counter_register      (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: parse_uri     (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: counter_lookup_str    (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: clear_branches        (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: get_debug_level       (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: my_pid        (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: parse_headers (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: dprint_color  (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: fm_free       (/usr/local/lib64/kamailio/libkcore.so.1)
undefined symbol: full_version  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_name      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: log_color     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_child_cb_first    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_global_lock       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_global    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_ginst_count       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: shm_block     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: dprint_crit   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: mem_lock      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: log_prefix_val        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_arch      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_group     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: log_stderr    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_local     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: process_no    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: tcp_disable   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_block_size        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_compiler  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_table_array_helper_handler    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_os        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_child_cb  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: core_cfg      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_flags     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_compiled_time     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: mem_block     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_id        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: ver_version   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: log_level_info        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_child_cb_last     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: dprint_color_reset    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_get_do_debugging (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_set_mode_request_error        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: register_timer        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_ds_set_boolean        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_get_by_name       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: send_v2trap   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_table_array_check_row_status  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_register_scalar       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: tcp_options_get       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_container_find        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: fm_malloc     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_register_child    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: init_agent    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: register_procs        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: debugmsg      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: get_ticks     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_check_vb_rowstatus    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_register_ctx      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: debugmsgtoken (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: init_snmp     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: counter_lookup_str    (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: get_debug_level       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_child_init        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_set_var_typed_value      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_free_varbind     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: parse_oid_indexes     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_table_container_register      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_create_handler_registration   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: agent_check_and_process       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_shutdown (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: find_module_by_name   (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: fork_process  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: netsnmp_check_vb_type_and_size        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: cfg_move_handle       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: counter_get_val       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_varlist_add_variable     (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: my_pid        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_reset_var_buffers        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: fm_info       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_log      (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: dprint_color  (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: snmp_clone_mem        (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: fm_free       (/usr/local/lib64/kamailio/modules/snmpstats.so)
undefined symbol: find_export   (/usr/local/lib64/kamailio/modules/snmpstats.so)

        Version information:
        /usr/local/lib64/kamailio/modules/snmpstats.so:
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /usr/local/lib64/kamailio/libkcore.so.1:
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

Can you help me with this please ?

By the way I configured /etc/snmpd.conf by adding the line "master agentx" and created a file /etc/snmpstats.cfg with only one line : "agentXSocket tcp:localhost:705". Is that correct ?
Do i need to reload something after modifing those files ?