pdagent
pdagent copied to clipboard
pdagent fails to run on Ubuntu 24
$ /usr/share/pdagent/bin/pdagentd
Traceback (most recent call last):
File "/usr/share/pdagent/bin/pdagentd.py", line 75, in <module>
import pdagent.config
File "/usr/lib/python3/dist-packages/pdagent/config.py", line 38, in <module>
from pdagent.thirdparty.six.moves import configparser
ModuleNotFoundError: No module named 'pdagent.thirdparty.six.moves'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/pdagent/bin/pdagentd.py", line 81, in <module>
import pdagent.config
File "/usr/lib/python3/dist-packages/pdagent/config.py", line 38, in <module>
from pdagent.thirdparty.six.moves import configparser
ModuleNotFoundError: No module named 'pdagent.thirdparty.six.moves'
Hi there! Any news?
We are experiencing the same issue. So we have to stay on Ubuntu 22.04 on our nagios server, which is less than ideal.
We are experiencing the same issue. So we have to stay on Ubuntu 22.04 on our nagios server, which is less than ideal
I solved this by installing python 3.11 with asdf in nagios home, installing pd-agent python lib in nagios home (git clone) and using PYTHONPATH to load pd-agent lib
It seems to be a problem with the old copy of six.py that is imported. Trying with the latest version of six.py gets passed the import error but then gives a SafeConfigParser errror.
Updating the six.py to the latest upstream and then editing the config.py to change
config = configparser.SafeConfigParser()
to
config = configparser.ConfigParser()
Seems to get the agent started at least. Would be great to get a proper fix and a new release.
This small script to fixes it for me:
#!/usr/bin/bash
PDAGENT_PATH="/usr/lib/python3/dist-packages/pdagent"
echo "Fixing six"
ln -sf /usr/lib/python3/dist-packages/six.py "${PDAGENT_PATH}/thirdparty/six.py"
echo "Patching config.py"
sed -i 's/configparser\.SafeConfigParser/configparser.ConfigParser/g' "${PDAGENT_PATH}/config.py"
echo "Restarting pdagent"
service pdagent restart