# Telegraf plugin error for py script

**URL:** <https://community.grafana.com/t/telegraf-plugin-error-for-py-script/32097>\
**Category:** Grafana\
**Created:** [June 15, 2020, 8:32am UTC](https://community.grafana.com/t/telegraf-plugin-error-for-py-script/32097 "2020-06-15T08:32:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sady1710](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@sady1710](https://community.grafana.com/u/sady1710)\
**Post date:** [June 15, 2020, 8:32am UTC](https://community.grafana.com/t/telegraf-plugin-error-for-py-script/32097/1 "2020-06-15T08:32:07Z")

</div>

Hi team ,

I am trying to scedule a conf file from telegraf were i am trying to execute a py script  
however i am getting error "Error in plugin: exec: fork/exec /etc/telegraf/telegraf.d/EUHUB\_Messages.py: exec format error for command ‘/etc/telegraf/telegraf.d/EUHUB\_Messages.py’: "

the code is very simple i am trying to fetch a value from an API get call  
and want to use to print it in influx

import requests  
import json

url = “https://##########:443/api/v1/Queues(‘EUHUB\_JMS\_Queue\_v1’)?$format=json”

payload = {}  
headers = {  
’  
}

response = requests.request(“GET”, url, headers=headers, data=payload)

resp = json.loads(response.text)  
nomsgs1 = mydata[‘d’][‘NumbOfMsgs’]  
tenant = “r0121”  
#print(nomsgs1)  
#print(type(nomsgs1))

print “EU\_HUB\_messages,tenant=” + tenant+" total=" + str(nomsgs1)

can you help me here what i am missing and the format for printing in telegraf
