pdagent icon indicating copy to clipboard operation
pdagent copied to clipboard

pdagent fails to run on Ubuntu 24

Open misilot opened this issue 10 months ago • 6 comments

$ /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'

misilot avatar Jan 30 '25 15:01 misilot

Hi there! Any news?

n-rodriguez avatar Aug 07 '25 23:08 n-rodriguez

We are experiencing the same issue. So we have to stay on Ubuntu 22.04 on our nagios server, which is less than ideal.

firecow avatar Aug 13 '25 07:08 firecow

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

n-rodriguez avatar Aug 21 '25 19:08 n-rodriguez

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.

choffee avatar Sep 10 '25 11:09 choffee

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.

choffee avatar Sep 10 '25 11:09 choffee

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

johje349 avatar Sep 16 '25 07:09 johje349