All Apps and Add-ons

Issue with TA-connectivity (ping) - Resolution found

jbailey_splunk
Splunk Employee
Splunk Employee

I installed TA-connectivity and after turning on the inputs I received the following error in splunkd.log:

07-29-2016 16:10:07.410 +0000 ERROR ExecProcessor - message from "python D:\Splunk\etc\apps\TA-connectivity\bin\ping.py" ERROR local variable 'status' referenced before assignment

After looking into the python script "TA-connectivity/bin/connectivity_lib/pinger.py", I observed that the value "status" was not set, like the other variables. The resolution to this is to add status=''in the "def pingtest(dstaddr)" call, see example below:

def pingtest(dstaddr):
timenow = strftime("%m/%d/%Y %H:%M:%S %Z")
dstaddr = dstaddr.rstrip('\r\n')
trailer = ''
action=''
description=''
dst_ip=''
status=''
if platform.system() == 'Windows':

Once I restarted Splunk, the expected pings were working to each host listed in my hostfile.txt file.

Hope this helps others that encounter this issue...
Jamie Bailey

0 Karma
1 Solution

jbailey_splunk
Splunk Employee
Splunk Employee

After looking into the python script "TA-connectivity/bin/connectivity_lib/pinger.py", I observed that the value "status" was not set, like the other variables. The resolution to this is to add status=''in the "def pingtest(dstaddr)" call, see example below:

def pingtest(dstaddr):
timenow = strftime("%m/%d/%Y %H:%M:%S %Z")
dstaddr = dstaddr.rstrip('\r\n')
trailer = ''
action=''
description=''
dst_ip=''
status=''
if platform.system() == 'Windows':

Once I restarted Splunk, the expected pings were working to each host listed in my hostfile.txt file.

Hope this helps others that encounter this issue...
Jamie Bailey

View solution in original post

jbailey_splunk
Splunk Employee
Splunk Employee

After looking into the python script "TA-connectivity/bin/connectivity_lib/pinger.py", I observed that the value "status" was not set, like the other variables. The resolution to this is to add status=''in the "def pingtest(dstaddr)" call, see example below:

def pingtest(dstaddr):
timenow = strftime("%m/%d/%Y %H:%M:%S %Z")
dstaddr = dstaddr.rstrip('\r\n')
trailer = ''
action=''
description=''
dst_ip=''
status=''
if platform.system() == 'Windows':

Once I restarted Splunk, the expected pings were working to each host listed in my hostfile.txt file.

Hope this helps others that encounter this issue...
Jamie Bailey

seunomosowon
Communicator

Thanks Jamie. Been meaning to test this extensively in Windows. Should update the app over the weekend with any other fixes I find.

Cheers

0 Karma

ppablo
Retired

Hi @jbailey_splunk

Thanks for sharing this Q&A with the rest of the Splunk community! Can you actually post the solution as a formal answer in the "Enter your answer here..." box below? Then once it's posted, click "Accept" directly below the answer to resolve the post. Otherwise, this question will float around Answers appearing as having no solution in the list of questions.

Cheers

Patrick

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

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 ...