Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Does not work dbclient via WebGUI

Help
Bedrich
2012-11-05
2013-04-13
  • Bedrich
    Bedrich
    2012-11-05

    Hello,
    I have a problem with letting the "dbclient" via WebGUI. Commands are probably not start at all, because there are no logs in /var/log/syslog.
    For example, if I want to turn on any plugin, so it ends up on timeout. Creates the file in the directory /usr/share/openqrm/var/spool/.
    When I take the command from that file and run it from the command line, so passes without errors and openqrm this change take effect.
    Can you help me with this!

    command example:dbclient -K 10 -y -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 22 root@10.199.199.10 "/usr/share/openqrm/bin/openqrm-cmd /usr/share/openqrm/plugins/vmware-esx/bin/openqrm-vmware-esx-autodiscovery

    Thanks

    Bedrich

     
  • Bedrich
    Bedrich
    2012-11-05

    Hi,
    so the problem is not with dbclient, but apparently with automatic pick-up commands from the queue.
    Thanks for any tip.

    configuration:
    openQRM 5
    Ubuntu 12.04

     
  • Bedrich
    Bedrich
    2012-11-06

    I solved it. The problem was with the openQRM server:

    $ /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is not running.

    When you start the dropbear did not pass check, although dbclient command worked correctly and server will not start.
    A quick fix is, comment out the code to check that the dropbear server is running and then let go.

    $ /etc/init.d/openqrm start
    ……
    $ /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is running.

    Have a nice day

    Bedrich

     
  • Matt
    Matt
    2012-11-06

    Hi Bedrich,

    great that you got it working by starting the openQRM Server.
    Still not sure what exactly the problem was. Can you elaborate a bit more about which check did not passed well ?

    btw: about your command example

    dbclient -K 10 -y -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 22 root@10.199.199.10 "/usr/share/openqrm/bin/openqrm-cmd /usr/share/openqrm/plugins/vmware-esx/bin/openqrm-vmware-esx-autodiscovery

    1) first part of the command:

    dbclient -K 10 -y -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 22 root@10.199.199.10

    -> this is similar to "ssh root@10.199.199.10"
    !! In this exmaple you have used port 22 (the ssh port) -> openQRM's dropbear runs on 1667 by default.

    2) second part (executed remotely on 10.199.199.10 in this example)

    /usr/share/openqrm/bin/openqrm-cmd
    -> is a simple bash wrapper

    3. third part of the command (running remotely)

    /usr/share/openqrm/plugins/vmware-esx/bin/openqrm-vmware-esx-autodiscovery

    -> in this example this runs the vmware-esx-autodiscover in the background via "screen"

    Hint:
    To run this command foreground for debugging on 10.199.199.10 in this example do:

    export RUN_IN_BACKGROUND=true
    bash -x  /usr/share/openqrm/plugins/vmware-esx/bin/openqrm-vmware-esx-autodiscovery

    With those simple 3 steps you can debug every openQRM command ;)

    many thanks, have a nice day and enjoy openQRM 5.0,

    Matt Rechenburg
    Project Manager openQRM

     
  • Bedrich
    Bedrich
    2012-11-06

    Hi Matt,

    thanks for the reply and hints. I how progressed exactly ;-)
    I had a problem making passwordless for dbclient -> dropbear on port 1667 at the beginning. I modified the configuration so openQRM, to communicate on port 22. When I did it, not set it back to port 1667. If I say it properly, so now it works dbclient -> OpenSSH. So check run dropbear is not quite correct. Rather, I somehow controlled command dbclient. Or when the check dropbear fails, I checked dbclient.

    $ /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is not running.
    

    openQRM will not start:

    $ /etc/init.d/openqrm start
    Starting the openQRM-server ver. 5.0.
    ERROR: Could not start the dropbear server. Please check to have dropbear installed correctly!
    

    although dropbear server running (the process number 17420):

    $ /etc/init.d/dropbear stop
    Stopping Dropbear SSH server: start-stop-daemon: warning: failed to kill 17420: Operation not permitted
    dropbear.
    

    dbclient command works correctly:

    $ dbclient -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 22 root@10.199.199.10
    Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-32-generic x86_64)
     * Documentation:  https://help.ubuntu.com/
      System information as of Tue Nov  6 13:28:12 CET 2012
      System load:  0.75               Processes:           190
      Usage of /:   12.5% of 45.01GB   Users logged in:     1
      Memory usage: 53%                IP address for eth0: 10.199.199.10
      Swap usage:   0%                 IP address for br0:  10.199.199.10
      Graph this data and manage this system at https://landscape.canonical.com/
    25 packages can be updated.
    18 updates are security updates.
    Last login: Mon Nov  5 14:40:21 2012 from davo-test2
    root@davo-test2:~#
    

    so I turned off the dropbear server:

    $ sudo /etc/init.d/dropbear stop
    Stopping Dropbear SSH server: dropbear.
    

    and again tested dbclient which again works properly. I am in the "/ etc / init.d / openqrm" comment out lines 455-459:

    452         case "$OPENQRM_EXECUTION_LAYER" in
    453                 dropbear)
    454                         # start the openqrm-execd daemon
    455                         #BB if ! dropbear -p $OPENQRM_EXEC_PORT -r $OPENQRM_SERVER_BASE_DIR/openqrm/etc/dropbear/dropbear_rsa_host_key; then
    456                         #BB     echo "ERROR: Could not start the dropbear server. Please check to have dropbear installed correctly!"
    457                         #BB     echo "TEST cmd: dropbear -p $OPENQRM_EXEC_PORT -r $OPENQRM_SERVER_BASE_DIR/openqrm/etc/dropbear/dropbear_rsa_host_key"
    458                         #BB     return 1
    459                         #BB fi
    460                         # start the openqrm-cmd-queue
    461                         $RUNSCREEN -dmS cmdqueue $OPENQRM_SERVER_BASE_DIR/openqrm/sbin/openqrm-cmd-queue
    462                         ;;
    463                 *)
    464                         echo "ERROR: Un-supported command execution layer $openqrm_execution_layer ! Exiting."
    465                         return 1
    466                         ;;
    

    I then started openQRM server again:

    $ sudo /etc/init.d/openqrm start
    .....
    $ /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is running.
    

    Now it already working properly (processes requests from the queue "/usr/share/openqrm/var/spool/")

    Sorry for the extensive explanation, I want to be as accurate as possible.

    Have a nice day

    Bedrich

     
  • Matt
    Matt
    2012-11-07

    Hi Bedrich,

    thanks for the additional infos!

    One question: Are you running those commands (especially starting openQRM) as "root" or as a regular user ?
    It seems to me you are not running them as root which may be the reason why they fail.

    Also there is no need to start the dropbear server manually since openQRM runs its own dropbear server on port 1667 (so it won't interfere)

    many thanks, have a nice day and enjoy openQRM 5.0,

    Matt Rechenburg
    Project Manager openQRM

     
  • Bedrich
    Bedrich
    2012-11-07

    Hi Matt,

    commands are running as a regular user.  I use cmd "sudo" for root rights.

    I have tried to change the port to 1667 and run the command.

    administrator@davo-test2:~$ dbclient -K 10 -y -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 1667 root@10.199.199.10 "/usr/share/openqrm/bin/openqrm-cmd openqrm_server_plugin_command puppet stop"
    dbclient: Exited: Error connecting: Connection refused
    

    start dropbear:

    administrator@davo-test2:~$ sudo /etc/init.d/dropbear start
    [sudo] password for administrator:
    Starting Dropbear SSH server: dropbear.
    

    I re-started the command successfully:

    administrator@davo-test2:~$ dbclient -K 10 -y -i /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key -p 1667 root@10.199.199.10 "/usr/share/openqrm/bin/openqrm-cmd openqrm_server_plugin_command puppet stop"
    administrator@davo-test2:~$
    

    So I tried to cancel my commented lines in "/ etc / init.d / openqrm", I changed the configuration openqrm on port 1667 and I carried the restart:

    administrator@davo-test2:~$ sudo /etc/init.d/openqrm restart
    Stopping enabled openQRM-server plugins...
    Stopping the openQRM cloud-plugin
    Stopping the openQRM collectd-plugin
    Stopping statistics collection and monitoring daemon: collectd.
    Stopping the openQRM dhcpd-plugin
    Stopping the openQRM dns-plugin
     * Stopping domain name service... bind9                                                                                waiting for pid 20526 to die
                                                                                                                     [ OK ]
    Stopping the openQRM image-shelf-plugin
    Stopping the openQRM iscsi-storage-plugin
    Stopping the openQRM kvm-plugin
    Stopping the openQRM local-server-plugin
    Stopping the openQRM lvm-storage-plugin
    Stopping the openQRM tftpd-plugin
    Stopping the openQRM vmware-esx-plugin
    Stopping the openQRM-server ver. 5.0.
    Starting the openQRM-server ver. 5.0.
    ERROR: Could not start the dropbear server. Please check to have dropbear installed correctly!
    TEST cmd: dropbear -p 1667 -r /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key
    administrator@davo-test2:~$
    administrator@davo-test2:~$
    administrator@davo-test2:~$ sudo /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is not running.
    administrator@davo-test2:~$
    

    manually command "dropbear -p 1667 -r /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key" ends successfully:

    administrator@davo-test2:~$ dropbear -p 1667 -r /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key
    administrator@davo-test2:~$
    
     
  • Matt
    Matt
    2012-11-10

    Hi again Bedrich,

    thanks for the additional infos. Still strange, working fine in our testing here without any troubles (with unchanged init script)

    Could you please run :

      killall dropbear
      dropbear -p 1667 -r /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key
      echo $?

    This will show us the return code of dropbear start.

    many thanks, have a nice day and enjoy openQRM 5.0,

    Matt Rechenburg
    Project Manager openQRM

     
  • Bedrich
    Bedrich
    2012-11-11

    Hi Matt

    I tried your commands:

    administrator@davo-test2:~$ killall dropbear
    dropbear(7314): Operation not permitted
    dropbear(29977): Operation not permitted
    dropbear: no process found
    administrator@davo-test2:~$ sudo killall dropbear
    [sudo] password for administrator:
    administrator@davo-test2:~$ dropbear -p 1667 -r /usr/share/openqrm/etc/dropbear/dropbear_rsa_host_key
    administrator@davo-test2:~$ echo $?
    0
    administrator@davo-test2:~$
    

    So I tried to cancel my commented lines in "/ etc / init.d / openqrm" and run openqrm restart:

    administrator@davo-test2:~$ sudo /etc/init.d/openqrm restart
    .....
    administrator@davo-test2:~$ 
    administrator@davo-test2:~$ /etc/init.d/openqrm status
    openQRM-server ver. 5.0 is running.
    administrator@davo-test2:~$
    

    Now I restart openqrm server is working correctly (without commented row).

    Many thanks and have a nice day
    Bedrich

     
  • Matt
    Matt
    2012-11-11

    :) great, thanks for info Bedrich!

    many thanks again, have a nice weekend,

    Matt Rechenburg
    Project Manager openQRM