From 45412d75d16189719c059c0368eca4bda75e6ff8 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 19 Jan 2016 20:05:22 +0100 Subject: [feat] Add 'leap debug' cmd This will output node debug information by calling the bin/debug.sh script. --- bin/debug.sh | 25 +++++++++++++++++++++++++ lib/leap_cli/commands/debug.rb | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 bin/debug.sh create mode 100644 lib/leap_cli/commands/debug.rb diff --git a/bin/debug.sh b/bin/debug.sh new file mode 100755 index 00000000..2363644c --- /dev/null +++ b/bin/debug.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# debug script to be run on remote servers +# called from leap_cli with the 'leap debug' cmd + +regexp='(leap|pixelated|stunnel|couch|soledad|haproxy)' + +# query facts and filter out private stuff +echo -e '\n\n' +facter | egrep -iv '(^ssh|^uniqueid)' + +# query installed versions +echo -e '\n\n' +dpkg -l | egrep "$regexp" + + +# query running procs +echo -e '\n\n' +ps aux|egrep "$regexp" + +echo -e '\n\n' +echo -e "Last deploy:\n" +tail -2 /var/log/leap/deploy-summary.log + + + diff --git a/lib/leap_cli/commands/debug.rb b/lib/leap_cli/commands/debug.rb new file mode 100644 index 00000000..a969b752 --- /dev/null +++ b/lib/leap_cli/commands/debug.rb @@ -0,0 +1,15 @@ +module LeapCli; module Commands + + desc 'Output debug information.' + long_desc 'The FILTER can be the name of a node, service, or tag.' + arg_name 'FILTER' + command [:debug, :d] do |c| + c.action do |global,options,args| + nodes = manager.filter!(args) + ssh_connect(nodes, connect_options(options)) do |ssh| + ssh.leap.debug + end + end + end + +end; end -- cgit v1.2.3