Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] snmpcollector not able to send data to external influxdb when behind corp. proxy #473

Closed
fredma opened this issue Feb 22, 2021 · 6 comments · Fixed by #476

Comments

@fredma
Copy link
Contributor

fredma commented Feb 22, 2021

  • What SnmpCollector version are you using?
    0.8.1

  • What OS are you running snmpcollector on?

rehl7.8

  • What did you do?

We have snmpcollector running in docker container and I defined the env var for HTTP_PROXY and HTTPS_PROXY

        "Env": [
            "HTTP_PROXY=http://myproxy:80/",
            "HTTPS_PROXY=http://myproxy:80/",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "PATHS_HOME=/opt/snmpcollector/",
            "SNMPCOL_GENERAL_DATA_DIR=/opt/snmpcollector//data/",
            "SNMPCOL_GENERAL_LOG_DIR=/opt/snmpcollector//log/"
        ],
  • What was the expected result?

snmp collector runs inside a corp network and it is configured to send data to external influxdb endpoint (outside of corp network)

The expected result should be a successful connection to external influxdb endpoint.

  • What happened instead?

snmpcollector is not able to connect and the below error show in the snmpcollector.log

time="2021-02-22 10:41:23" level=error msg="ERROR on Write batchPoint in DB default (3 points) | elapsed : 30.000279439s | Error: Post https://<EXTERNAL_INFLUXDB_FQDN>:443/write?consistency=&db=snmp&precision=s&rp=autogen: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) "

To verify this is an issue in snmpcollector, I ran a curl command within the container and it was able to use the proxy defined in HTTPS_PROXY to reach external endpoint e.g. google.co.uk

@fredma
Copy link
Contributor Author

fredma commented Feb 22, 2021

I believe this is using the influxdb client and a ticket has been raised for this for influxdb
influxdata/telegraf#1588
The fix has already been committed in influxdata/influxdb@c67a054
and possibly snmpcollector would need to use the latest influxdb client as per comments in
influxdata/influxdb#11035

@fredma
Copy link
Contributor Author

fredma commented Feb 22, 2021

Hi, I managed to fix the issue by applying the following patch on the 0.9.0 version.

http_proxy.patch.txt

Can you please review and let me know if it is good to merge upstream?

Thanks,

Fred

@toni-moreno
Copy link
Owner

Hello @fredma Could you please, fork the repo and send a PR with these changes please?

@fredma
Copy link
Contributor Author

fredma commented Feb 22, 2021

Thanks @toni-moreno, I will do that.

@fredma
Copy link
Contributor Author

fredma commented Feb 22, 2021

Here you go

#474

@fredma
Copy link
Contributor Author

fredma commented Mar 8, 2021

Sorry, I was on holidays.
Thanks for the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants