python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

diamond not running on Ubuntu 16.04 #712

Open KlavsKlavsen opened 6 years ago

KlavsKlavsen commented 6 years ago

First I got:

Traceback (most recent call last):
  File "/tmp/diamond", line 25, in <module>
    from diamond.server import Server
ImportError: No module named diamond.server

Then I added correct search path (as used by setup.py):

for path in [
    os.path.join('/usr', 'share', 'pyshared'),
    os.path.join('/opt', 'diamond', 'lib'),
    os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))
]:

(to bin/diamond)

$ /usr/bin/python /usr/bin/diamond
Traceback (most recent call last):
  File "/usr/bin/diamond", line 26, in <module>
    from diamond.server import Server
  File "/usr/share/pyshared/diamond/server.py", line 21, in <module>
    from diamond.utils.classes import initialize_collector
ImportError: No module named utils.classes
KlavsKlavsen commented 6 years ago

It turns outinit.py is NOT included in the package-file (for diamond.utils) - diamond and diamond.handler gets it.

KlavsKlavsen commented 6 years ago

build output SAYS it does the right thing though - and setup ( ) in setup.py looks correct:

hard linking src/diamond/handler/__init__.py -> diamond-4.0.830/src/diamond/handler
hard linking src/diamond/utils/__init__.py -> diamond-4.0.830/src/diamond/utils
copying src/diamond/__init__.py -> /home/b56v/Diamond/build/diamond-4.0.830/./build/lib.linux-x86_64-2.7/diamond
copying src/diamond/utils/__init__.py -> /home/b56v/Diamond/build/diamond-4.0.830/./build/lib.linux-x86_64-2.7/diamond/utils
copying src/diamond/handler/__init__.py -> /home/b56v/Diamond/build/diamond-4.0.830/./build/lib.linux-x86_64-2.7/diamond/handler

however contents is missing one of the init.py.. :


$ dpkg --contents build/diamond_4.0.830_all.deb | grep init__
-rw-r--r-- root/root        15 2017-04-18 11:08 ./usr/share/pyshared/diamond/handler/__init__.py
-rw-r--r-- root/root        49 2017-04-18 11:08 ./usr/share/pyshared/diamond/__init__.py