Hmm, no immediate luck.
First, output for the commands requested.
Gives:
Gives:
Code: Select all
lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python2
lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3674216 Mar 8 2021 /usr/bin/python2.7
lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python3 -> python3.8
-rwxr-xr-x 1 root root 5490488 Nov 26 14:14 /usr/bin/python3.8
-rwxr-xr-x 1 root root 5902 Jan 13 2020 /usr/bin/python3-wsdump
I then edited the check_docker.py. Note - the filepath I edited was the one from the error (/usr/local/ncpa/plugins/check_docker.py), different from the one you had (nagios vs ncpa). The original header line:
I then tried modifying it with each of the following:
Code: Select all
#!/usr/bin/env python /usr/bin/python
#!/usr/bin/env python /usr/bin/python2
#!/usr/bin/env python /usr/bin/python2.7
However, each gave the same error. Thinking maybe you had a reason for modifying the path at nagios (whcih exists on the nagios server, but not the end-user), I then tried modifying it on the Nagios server as well - no change.
I then tried changing up that syntax altogether and just being:
But unfortunately still no luck there.
Going back to the original commands, I think "which python" indicates it actually SHOULD have been using python v2 by default, even without the explicit path. So maybe it really is something else going on besides the python version?