[collectd] Modbus segfault
Matt Baker
matt at sevenone.com
Wed Feb 1 02:28:19 CET 2012
Hi Stefan,
Thankyou for letting me know that it's not just me that is seeing the issue with the modbus plugin stalling. I recompiled with debug turned on and then have run for a while to see if I could see in the logs some hint as to what is going wrong.
My setup is I have a monitoring box that has a direct network (cross over cable) connection to a EGX100 modbus gateway. The EGX100 is not reporting any errors on the serial network, but it looks like some sort of issue occurs after about 2 hours and then only a restart of collectd will kick things off again.
At the point where it fails I see in the logs:
[2012-02-01 11:29:04] Modbus plugin: mb_read_data: Success! modbus_read_registers returned with status 2.
[2012-02-01 11:29:04] Modbus plugin: mb_read_data: Returned float value is 16.7224
[2012-02-01 11:29:04] plugin_dispatch_values: time = 1328057944.042; interval = 10.000; host = 10.1.2.2; plugin = modbus; plugin_instance = PM710-Main; type = thd; type_instance = CurrentTHD-C;
[2012-02-01 11:29:04] uc_update: 10.1.2.2/modbus-PM710-Main/thd-CurrentTHD-C: ds[0] = 16.722437
[2012-02-01 11:29:04] plugin: plugin_write: Writing values via rrdtool.
[2012-02-01 11:29:04] rrdtool plugin: rrd_cache_insert: file = /d0/collectd/rrd/10.1.2.2/modbus-PM710-Main/thd-CurrentTHD-C.rrd; values_num = 5; age = 39.933;
[2012-02-01 11:29:04] Modbus plugin: Re-established connection to 10.1.2.2
[2012-02-01 11:29:05] Modbus plugin: Re-established connection to 10.1.2.2
[2012-02-01 11:29:05] Modbus plugin: mb_read_data: Success! modbus_read_registers returned with status 0.
[2012-02-01 11:29:05] Modbus plugin: mb_read_data: Returned float value is 0
[2012-02-01 11:29:05] plugin_dispatch_values: time = 1328057945.045; interval = 10.000; host = 10.1.2.2; plugin = modbus; plugin_instance = PM710-Main; type = thd; type_instance = VoltageTHD-AN;
[2012-02-01 11:29:05] uc_update: 10.1.2.2/modbus-PM710-Main/thd-VoltageTHD-AN: ds[0] = 0.000000
[2012-02-01 11:29:05] plugin: plugin_write: Writing values via rrdtool.
[2012-02-01 11:29:05] rrdtool plugin: rrd_cache_insert: file = /d0/collectd/rrd/10.1.2.2/modbus-PM710-Main/thd-VoltageTHD-AN.rrd; values_num = 5; age = 40.860;
[2012-02-01 11:29:05] Modbus plugin: Re-established connection to 10.1.2.2
[2012-02-01 11:29:06] Modbus plugin: Re-established connection to 10.1.2.2
[2012-02-01 11:29:06] Modbus plugin: mb_read_data: Success! modbus_read_registers returned with status 0.
[2012-02-01 11:29:06] Modbus plugin: mb_read_data: Returned float value is 0
[2012-02-01 11:29:06] plugin_dispatch_values: time = 1328057946.048; interval = 10.000; host = 10.1.2.2; plugin = modbus; plugin_instance = PM710-Main; type = thd; type_instance = VoltageTHD-BN;
So, for some reason the mb_read_data starts returning a status of 0 compared to the normal 2. During all this time I have a nagios process that monitors connectivity to the gateway and that is not reporting any connectivity issues.
cheers,
Matt
> Hi Matt,
>
> by now I'm running a somewhat more changed version that I put up at https://github.com/snickl/collectd/tree/snickl/3-modbus-connect-handling (my first attempt on github btw).
>
> I also noticed that data stopped coming in after several hours, but from the logs it looked more like modbus connection errors. Debug is enabled now, but no problem for over a day. I'll sure check on zero values if it stalls again.
>
> Cheers, Stefan
More information about the collectd
mailing list