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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...