Results 1 to 7 of 7

Thread: Ninja installation

  1. #1
    Junior Member
    Join Date
    Jul 2011

    Ninja installation

    Hi all,

    Fist of all, let me thank you for developping shinken ... a great tool !

    I'm trying to install merlin/ninja as the webinterface (shinken is already running fine) ...

    To do so I followed that :

    mysql -u root
    mysql> create database merlin;
    mysql> grant all privileges on merlin.* to merlin@localhost identified by 'merlin';
    mysql> flush privileges;
    mysql> quit;

    # tar -zxvf merlin-0.9.0.tar.gz
    # cd merlin-0.9.0
    # make
    # ./ --nagios-cfg=/etc/shinken/nagios.cfg --dest-dir=/usr/share/merlin
    #sudo /etc/init.d/merlind start

    ps faux, I see the process ... no problem here.

    Then uncompressing ninja.tar.gz in /usr/share/ninja

    I did the right apache config to access ninja (alias directory etc ...) no problem.
    I changed $ninja_base = '/usr/local/nagios/addons/ninja'; to $ninja_base = '/usr/share/ninja';
    I changed auth_import_mysql.php to fit my needs :

    private $merlin_path = '/usr/share/merlin'; # where to find merlin files
    private $nagios_cfg_path = '/etc/shinken/nagios.cfg'; # path to nagios cfg files

    install_scripts/ /usr/share/ninja

    import is ok

    I edited ninja/application/config/database.php
    'user' => 'merlin'
    'pass' => 'merlin'
    'host' => 'localhost'
    'database' => 'merlin'

    And when I try to connect into ninja, I got a database error 'table user does not exist in you database'
    That right, no table users in database merlin... (mysql -umerlin -pmerlin ; use merlin; show tables
    Dis I miss something ?

    Thanks guys

  2. #2
    Administrator Frescha's Avatar
    Join Date
    May 2011

    Re: Ninja installation

    You can try to import the ninja.sql by hand (1).


  3. #3
    Junior Member
    Join Date
    Jul 2011

    Re: Ninja installation

    Could this possibly be related to mysql password?
    You have to specify your db password in for the script to work.
    This is the script responsible for adding the ninja.sql file. On the other hand it is always possible to insert the sql files manually (like #mysql merlin < /path/to/ninja.sql)

    Good luck!

  4. #4
    Junior Member
    Join Date
    Jul 2011

    Re: Ninja installation

    Ok guys,

    ninja.sql was successfully imported ... the users table exists in merlin database but it's empty.
    How can I create new users to login plz ?

  5. #5
    Administrator Frescha's Avatar
    Join Date
    May 2011

    Re: Ninja installation

    its a very dirty (!) way to add a new user, but i think it should work ...

    Step 1:
    INSERT INTO `shinken`.`users` (`id`, `realname`, `email`, `username`, `password_algo`, `password`, `logins`, `last_login`) VALUES (NULL, 'Real Name', '', 'user', 'b64_sha1', 'W6ph5Mm5Pz8GgiULbPgzG37mj9g=', '0', NULL);
    W6ph5Mm5Pz8GgiULbPgzG37mj9g= = password (sha1 base64)

    Step 2:
    INSERT INTO `shinken`.`ninja_user_authorization` (`id`, `user_id`, `system_information`, `configuration_information`, `system_commands`, `all_services`, `all_hosts`, `all_service_commands`, `all_host_commands`) VALUES (NULL, '2', '1', '1', '1', '1', '1', '1', '1');
    You must insert the correct user id in step 2

    Please note: All sql statements are untested ....

  6. #6

    Re: Ninja installation


    I'll try these sql statements.
    Is there another way to add the first user into the database ?

    I installed shinken, merlin and ninja quite easily but i can't login 'cause there's no user in the merlin user table.


  7. #7

    Re: Ninja installation

    It worked

    Thanks Frescha !

Posting Permissions

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