Custom Script and Python Version
Posted: Wed Aug 30, 2023 9:33 am
Hello,
I am attempting to use a custom command to perform a Service Check.
I am added a Python script to /usr/local/nagios/libexec.
I have created the command itself:
Within my script:
However, I will get error:
I have installed requests library with pip3 and pip3 list shows I have
I am only suspecting that the script is being run with python2.7 despite me trying to have 3.6 run it.
Can anyone share some pointers, please?
I am attempting to use a custom command to perform a Service Check.
I am added a Python script to /usr/local/nagios/libexec.
I have created the command itself:
Code: Select all
/usr/bin/python3 $USER1$/my_script.py $ARG1$ $ARG2$ $ARG3$Within my script:
Code: Select all
#!/usr/bin/python3
import requests
Code: Select all
module 'requests' has no attribute 'request'Code: Select all
Package Version
------------------ -----------
requests 2.27.1Can anyone share some pointers, please?