Can the Icinga Monitoring Service execute custom plugins that are built using Python3 (v3.6)?
I have a custom plugin that I am writing (check_truenas.py) that keeps giving me the following error when trying to execute (e.g. “check now” via Icinga Web):
/usr/bin/env: python3 : No such file or directory
I know I have things defined correctly in Icinga Director for this, as I was executing a similar plugin (check_freenas.rb) that was written in Ruby. I just thought it would be fun to convert the Ruby to Python3, after upgrading my FreeNAS from 11.3-U5 to TrueNAS Core 12.0.
I can execute the plugin from an SSH session, with both the root and “sudo -u icinga …” user, and it returns the expected results. The Icinga Service seems to be trying to use the Python 2.7 environment when executing from there though.
I have restarted the Icinga service after installing Python 3.6, but have not rebooted the host. I did not restart Icinga Director or Icinga Web yet.
Any help you can give would be fantastic.
Thanks - Todd
- CentOS Linux release 7.9.2009 (Core), running in a ESXi VM instance
- Icinga Web 2 Version 2.11.4
- Icinga Director 1.10.2
- Icinga Monitoring 2.11.4
- PHP Version 7.3.33
- Git commit date 2023-01-26
- Chrome browser, Version 111.0.5563.147 (Official Build) (64-bit)
- Python version 2.7
- Python version 3.6
[root@centos7vm scripts]# pip --version pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7) [root@centos7vm scripts]# pip3 --version pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)