tsung
tsung copied to clipboard
Monitoring with snmp does not work
Hi,
I am trying to monitor the servers with snmp:
<monitoring>
<monitor host="192.168.197.87" type="snmp">
<snmp version="v1" community="public" port="161"/>
</monitor>
</monitoring>
The snmpwalk works well, but Tsung produces errors - regardless of the snmp version (v1, v2):
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_config_server:(4:<0.135.0>) SYSINFO:Tsung version: 1.8.0
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_config_server:(4:<0.135.0>) SYSINFO:Erlang version: Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:8] [jit:ns]
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_config_server:(4:<0.135.0>) SYSINFO:System architecture x86_64-redhat-linux-gnu
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_config_server:(4:<0.135.0>) SYSINFO:Current path: /usr/lib/tsung/tsung-1.8.0/ebin/tsung.beam
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_os_mon_snmp:(5:<0.154.0>) starting os_mon_snmp with args {"192.168.197.87",
{161,
"public",
v1,[]},
10000,
{global,
ts_mon}}
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_os_mon_snmp:(5:<0.157.0>) Initialize SNMP application
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_os_mon_snmp:(5:<0.157.0>) Initialize SNMP manager: ok
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_os_mon_snmp:(5:<0.157.0>) Register SNMP manager: ok
=INFO REPORT==== 5-Apr-2023::23:13:00 ===
ts_os_mon_snmp:(5:<0.157.0>) SNMP initialization: ok
...
=ERROR REPORT==== 5-Apr-2023::23:13:10 ===
** Generic server <0.157.0> terminating
** Last message in was {timeout,#Ref<0.3636501632.2333081607.216382>,
send_request}
** When Server state == {state,
{global,ts_mon},
[],10000,undefined,"snmp://192.168.197.87:161",
"192.168.197.87",
[[1,3,6,1,4,1,2021,11,52,0],
[1,3,6,1,4,1,2021,11,50,0],
[1,3,6,1,4,1,2021,4,6,0],
[1,3,6,1,4,1,2021,10,1,5,1]],
{dict,4,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
{{[],[],[],[],[],[],
[[[1,3,6,1,4,1,2021,11,52,0]|
{cpu_system,sample_counter,
#Fun<ts_os_mon_snmp.0.104503733>}]],
[],
[[[1,3,6,1,4,1,2021,10,1,5,1]|
{load,sample,#Fun<ts_os_mon_snmp.3.104503733>}]],
[],[],[],
[[[1,3,6,1,4,1,2021,11,50,0]|
{cpu_user,sample_counter,
#Fun<ts_os_mon_snmp.1.104503733>}]],
[[[1,3,6,1,4,1,2021,4,6,0]|
{freemem,sample,
#Fun<ts_os_mon_snmp.2.104503733>}]],
[],[]}}},
v1,161,"public",
{192,168,197,87}}
** Reason for termination ==
** {'function not exported',
[{snmpm,sync_get,
["tsung","snmp://192.168.197.87:161",
[[1,3,6,1,4,1,2021,11,52,0],
[1,3,6,1,4,1,2021,11,50,0],
[1,3,6,1,4,1,2021,4,6,0],
[1,3,6,1,4,1,2021,10,1,5,1]],
5000],
[]},
{ts_os_mon_snmp,snmp_get,5,
[{file,"src/tsung_controller/ts_os_mon_snmp.erl"},{line,245}]},
{ts_os_mon_snmp,handle_info,2,
[{file,"src/tsung_controller/ts_os_mon_snmp.erl"},{line,164}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,1123}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,1200}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}
Any idea what is going wrong? I am not a Erlang programmer and need some help.
Thank you in advance.
Hi,
2 years later : same problem here!
Any help?
Thanks,
Christophe.
Bonjour, Hello !
This is because there is a difference between the Erlang version and the Tsung version.
Tsung 1.7 and 1.8 work with Erlang version 22. The distribution with the correct Erlang version "22" is on Debian 10. On higher versions, the Erlang versions are too recent. The problem comes from Erlang's "sync_get" module: tsung can't find it:
I also tried compiling Erlang 22 on Debian 11, but there are too many side effects.
Unfortunately, I'm not a developer to be able to fix this; I simply used Debian version 10 to perform my load tests with SNMP metrics.
Erlang version:
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
Erlang module:
erl -eval 'io:format("~p~n", [snmpm:module_info(exports)]), halt().'
{sync_get2,3},
{sync_get2,4},
The sync_get module is the problem. I tried to work around it, but I'm a complete novice at development :(
Let's hope the development teams find a solution for us, because Tsung is truly awesome!!!
Patrick.