toni-moreno / snmpcollector

A full featured Generic SNMP data collector with Web Administration Interface for InfluxDB
MIT License
286 stars 53 forks source link

fix: fix already closed connections on multiindex measurements #525

Closed sbengo closed 1 year ago

sbengo commented 1 year ago

On the measurement gatherloop the measurement is marked as non-connected if it becomes unresponsive or the metrica cannot be retrieved for some connectivity reason.

When it happens, the gatherloop tries to reconnect again querying complete sysinfo and resets the snmpclient

This PR tries to fix the logic of the snmpclient inherit from the measurement, as it is using a pointer of a copy instead of the original snmpclient.

In this case, any change on the measurement snmpclient doesn't populates to the multiindex measurement snmpclient, and an already closed connection was being used and the load index is not being done and all the indexes were remain as the last time that they got gethered (wrong if the processed failed at some point)

fix #524