How to call Python script within Nagios check

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jankogaga
Posts: 37
Joined: Thu Apr 19, 2018 8:16 am

Re: How to call Python script within Nagios check

Post by jankogaga »

With
su - nagios
/usr/bin/env python3 /usr/local/nagios/libexec/check_ssl.py -H google.com -c E+,E,E-,F+,F,F-,T,M,C+,C-,C,D+,D,D- -d 15

Code: Select all

/usr/bin/env: python3: No such file or directory
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: How to call Python script within Nagios check

Post by mbellerue »

Looks like Python isn't in the nagios user's path. So you will either want to update the path, or change the shebang to point directly to python3.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
jankogaga
Posts: 37
Joined: Thu Apr 19, 2018 8:16 am

Re: How to call Python script within Nagios check

Post by jankogaga »

Thank you very much!
That has fixed the issue.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: How to call Python script within Nagios check

Post by mbellerue »

Excellent, glad to hear it's working! I will close the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked