TurboTurtle / rig

A lightweight, flexible, easy to use system monitoring and event handling utility
GNU General Public License v2.0
10 stars 7 forks source link

rig command return return "ModuleNotFoundError: No module named 'systemd'" #27

Closed amtdas closed 4 years ago

amtdas commented 4 years ago

Following error observed while executing rig on rhel8.3 . rig command return "ModuleNotFoundError: No module named 'systemd'" when installed with rig-1.0-2.el8.noarch.rpm

[root@localhost ~]# rig --help Traceback (most recent call last): File "/usr/bin/rig", line 67, in supported_rigs = _load_supported_rigs() File "/usr/bin/rig", line 59, in _load_supported_rigs modules.extend(_import_modules(_mod)) File "/usr/bin/rig", line 26, in _import_modules module = import(modname, globals(), locals(), [mod_short_name]) File "/usr/lib/python3.6/site-packages/rigging/rigs/logs.py", line 17, in from systemd import journal ModuleNotFoundError: No module named 'systemd'

[root@localhost ~]# uname -a Linux localhost.localdomain 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Fri Oct 16 13:36:46 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux [root@localhost ~]# rpm -qa rig rig-1.0-2.el8.noarch [root@localhost ~]# which rig /usr/bin/rig [root@localhost ~]# python3 python3 python3.6 python3.6m
[root@localhost ~]# which python3 /usr/bin/python3 [root@localhost ~]#

TurboTurtle commented 4 years ago

So, the cause is the same as #25 - the build process for RHEL does not do auto determination like the builds for Fedora do, my fault there. It's an easy fix.

As a side note however, I'm honestly not sure how you have a RHEL 8 system that does not have python3-systemd. It's a default installation as far as I'm aware.

Thanks for the report!

amtdas commented 4 years ago

I will agree with you. Something is wrong with my previously installed rhel82 vm. Now, did the fresh rhel82 and rhel83 ISO installation. Package python3-systemd comes as default installed package.

[root@rh83-new ~]# yum list python3-systemd Installed Packages python3-systemd.x86_64 234-8.el8 @AppStream [root@rh83-new ~]#

[root@rh82-new ~]# yum list python3-systemd Installed Packages python3-systemd.x86_64 234-8.el8 @AppStream [root@rh82-new ~]#

Registered above rhel83 system, executed 'yum install rig-1.0-2.el8.noarch.rpm'. It installed the dependency python3-psutil-5.4.3-10.el8.x86_64. 'rig' or 'rig --help' is successful.

[root@rh83-new ~]# rig --help
usage: 
    rig <subcmd> <options>

    <subcmd> may be one of the following:

        list            Get a list of current rigs
        destroy         Destroy a specified rig

        filesystem      Monitor a filesystem, directory, or file.
    logs            Watch one or more log files and/or journals for a specified log message
    ping            Send pings at a regular interval
    process         Monitor a process for state or resource consumption thresholds.
    system          Monitor overall system utilization metrics

Rig is used to monitor a resource for a specific trigger and then execute a
user-defined action.

positional arguments:
  subcmd          subcommand to execute

optional arguments:
  -h, --help      show this help message and exit
  -i ID, --id ID  rig id for list or destroy
  --force         force deletion of requested rig(s)

For more information on the types of rigs and the options available to them
use rig <subcmd> --help. E.G. 'rig logs --help'
[root@rh83-new ~]# 

Also, works fine with rig-1.0-3.el8.noarch.rpm version .