All Apps and Add-ons

Is there a way for the HipChat Room Notification Alert app to use an http_proxy setting to make calls to the internet?

mjlehman99
New Member

Is there a way for certain Splunk apps to use a http_proxy setting to be able to make calls to the internet?

The one app I am targeting is the "HipChat Room Notification Alert" app. I need to be able to go through the http_proxy to get from the DC to the HC Room I am targeting.

I have seen the splunk-launch.conf file to set it for Splunk Web to use. Just not sure if this gets passed to splunk apps.

Thanks,

0 Karma

jeremiahMN
Explorer

You'll want to install an opener like so...

existing code:

req = urllib2.Request(url, body, {"Content-Type": "application/json"})
    try:
        res = urllib2.urlopen(req)


Change to: (modify to suite your proxy address/port. Also if you need http and https calls you'll need to add both. )

req = urllib2.Request(url, body, {"Content-Type": "application/json"})
    proxy = urllib2.ProxyHandler({'https': '127.0.0.1:8080'})
    opener = urllib2.build_opener(proxy)
    urllib2.install_opener(opener)
    try:
        res = urllib2.urlopen(req)

passbt
Explorer

Thanks, adding this to the hipchat.py worked!

0 Karma

flle
Path Finder

Hi,

as there is no answer yet and I had the same question:
Yes, proxy settings in /etc/splunk-launch.conf are passed to Splunk apps.
Just adding

http_proxy=<proxyname>:<port>

or for https:

https_proxy=<proxyname>:<port>

to splunk-launch.conf worked for me and the Hipchat app happily uses the proxy for notification forwarding.

0 Karma

passbt
Explorer

I downvoted this post because i tried this, restarted splunk, and it is not working for me. after reviewing hipchat.py, i'm not sure the how this would work anyway.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...