All Apps and Add-ons

Website monitoring app generating python error when using http proxy

darrend
Path Finder

Hi

I am getting the following error when attempting to use our corporate http proxy, i have tested this proxy from command line by exporting the http_proxy and https_proxy session variables and using curl and the authentication details are correct.

2014-02-07 08:32:15,352 ERROR An error occurred when attempting to communicate with the proxy
Traceback (most recent call last):
  File "/opt/splunk/shared/etc/apps/website_monitoring/bin/web_ping.py", line 255, in ping
    response, content = http.request(url.geturl(), 'GET')
  File "/opt/splunk/lib/python2.7/site-packages/httplib2/__init__.py", line 1421, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/opt/splunk/lib/python2.7/site-packages/httplib2/__init__.py", line 1171, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/opt/splunk/lib/python2.7/site-packages/httplib2/__init__.py", line 1122, in _conn_request
    conn.connect()
  File "/opt/splunk/lib/python2.7/site-packages/httplib2/__init__.py", line 887, in connect
    sock.connect((self.host, self.port))
  File "/opt/splunk/lib/python2.7/site-packages/httplib2/socks.py", line 360, in connect
    raise GeneralProxyError((5, _generalerrors[5]))
GeneralProxyError: (5, 'bad input')

I have the following in my inputs.conf (redacted where appropriate)

[web_ping://test]
host = www.cheese.com
interval = 1m
title = cheesetest
url = httpwww.cheese.com

I have had to remove the :// from the url line to post as apparently i don't have enough "Karma" to include external links 😉

I have the following in my website_monitoring.conf

[default]
proxy_port = 8080
proxy_server = proxy.cheese.com
proxy_password = password
proxy_user = websitemonuser
proxy_type = http

The proxy_type did not get added by the GUI, i added that manually after checking the default/website_monitoring.conf file, i have tried with this line and without.

If i remove the proxy entries completely and attempt to connect to an internal URL that is accessible from my search head then everything functions as expected.

Any Ideas or assistance?

Thanks
Darren

0 Karma

darrend
Path Finder

Hi Luke

Certainly. I have just added the following

http colon slash slash www dot cheese dot com

It is generating the same error with that URL.

Thanks
Darren

0 Karma

LukeMurphey
Champion

Can you give me an example of the URL that you were trying to monitor and what version of Splunk you have installed? From what I can tell, this error appears when you use a proxy server and certain URLs. I haven't been able to reproduce this with any of the URLs I tried thus far.

0 Karma

LukeMurphey
Champion

This looks like a known bug in the Python HTTP libraries. I am looking into making a workaround (see http://lukemurphey.net/issues/681 for progress).

0 Karma

darrend
Path Finder

Hi Luke

How are you getting on with this bug? any closer to identifying the issue yet?

Thanks
Darren

0 Karma

adamgiemza
New Member

Hey,

I am currently experiencing the same issue. i can monitor splunk locally but as soon as add a proxy it does not work. I also get the "GeneralProxyError: (5, 'bad input')" thingy.

Thanks and regards,
Adam

0 Karma
*NEW* Splunk Love Promo!
Snag a $25 Visa Gift Card for Giving Your Review!

It's another Splunk Love Special! For a limited time, you can review one of our select Splunk products through Gartner Peer Insights and receive a $25 Visa gift card!

Review:





Or Learn More in Our Blog >>