Results 1 to 2 of 2

Thread: after upgraded to Shinken 2.4.2, shinken CLI not working

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    2

    Question after upgraded to Shinken 2.4.2, shinken CLI not working

    Hello,

    After I upgraded to Shinken 2.4.2 (https://pypi.python.org/pypi/Shinken), I cannot execute any Shinken CLI commands.
    For example:
    If I run shinken --version, I will get the following error:
    Traceback (most recent call last):
    File "/usr/local/bin/shinken", line 6, in <module>
    from shinken.bin.shinken_cli import main
    ImportError: No module named shinken_cli

    When I try to run any Shinken CLI command, it will give me the above error.

    Any idea?

  2. #2
    Junior Member
    Join Date
    Mar 2015
    Posts
    2

    bug found

    I've found out the problem. The shinken command does not contain the correct content for some reason. Also it should locate in /usr/bin not /usr/local/bin. It contains this wrong content:
    #!/usr/bin/python
    # PBR Generated from u'console_scripts'

    import sys

    from shinken.bin.shinken_cli import main


    if __name__ == "__main__":
    sys.exit(main())

    instead, it should contain

    #!/usr/bin/env python

    # Copyright (C) 2009-2014:
    # Gabes Jean, naparuba@gmail.com
    # Gerhard Lausser, Gerhard.Lausser@consol.de
    # Gregory Starck, g.starck@gmail.com
    # Hartmut Goebel, h.goebel@goebel-consult.de
    #
    # This file is part of Shinken.
    #
    # Shinken is free software: you can redistribute it and/or modify
    # it under the terms of the GNU Affero General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # Shinken is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU Affero General Public License for more details.
    #
    # You should have received a copy of the GNU Affero General Public License
    # along with Shinken. If not, see <http://www.gnu.org/licenses/>.


    import optparse
    import sys
    import os
    import re
    import tempfile
    import json
    import shutil
    import zipfile
    import tarfile
    import pycurl
    import urllib
    import ConfigParser
    import imp
    import shlex
    import readline
    import signal
    from StringIO import StringIO

    try:
    import shinken
    from shinken.bin import VERSION
    except ImportError:
    # If importing shinken fails, try to load from current directory
    # or parent directory to support running without installation.
    # Submodules will then be loaded from there, too.
    import imp
    imp.load_module('shinken',
    *imp.find_module('shinken',
    [os.path.realpath("."),
    os.path.realpath(".."),
    .......
    ......
    ......

    Quote Originally Posted by CSShinken View Post
    Hello,

    After I upgraded to Shinken 2.4.2 (https://pypi.python.org/pypi/Shinken), I cannot execute any Shinken CLI commands.
    For example:
    If I run shinken --version, I will get the following error:
    Traceback (most recent call last):
    File "/usr/local/bin/shinken", line 6, in <module>
    from shinken.bin.shinken_cli import main
    ImportError: No module named shinken_cli

    When I try to run any Shinken CLI command, it will give me the above error.

    Any idea?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •