miab 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95347ecc09318a1e7ebaca9e64734f967c8899c079bc8599aa4e52c651d69531
4
- data.tar.gz: 90285540761d9d75885e5422c40b7c98e3da150dad239b5edd69c47b65855c93
3
+ metadata.gz: c3fcaeef9156e9bf966718d7358f2ab08057f95cd9564c731b31e66d0bdc9d2d
4
+ data.tar.gz: 231ad1eb33a389f691c0d9b7a03eb475d0bb8c19529d2b8e4707db4214e4eada
5
5
  SHA512:
6
- metadata.gz: 0dbda404925c31bb06077483a0e9fb566874d965d2ceccb31fbeffe11bc90071be6cf79f749cbd1d9099e1f15b1882dba5b3b0b29168a1171a9979500d98e3b2
7
- data.tar.gz: 1053f042d766580900023fd44c8817bdb9286e46ea6a552fa4deda2fbcc2b1c93737036b2bb8146a5867f7646715c175705aa1674843ccbe0c0b11ff8a9baa09
6
+ metadata.gz: 04b7ec49fa43e04931f4952327550d03f921677830483edda188f0a7008a9cfa4cb047c091f209c88340b0c1accecc7d0fec5f05b9c0fe975dd99e2e1bd1c993
7
+ data.tar.gz: bc255bce9674c29f047cb73d1e1b71f652ac916d58dcc5e74b0c3d413dbbdd250fb6aa5ae15ae985e2feccc2e226543f553211003cb79747793997f1e1a0da43
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/miab.rb CHANGED
@@ -44,10 +44,14 @@ class Miab
44
44
  host, user = raw_host.split(/@/,2).reverse
45
45
  @host = host
46
46
  @results[host] = {}
47
-
48
- @ssh = Net::SSH.start( host, user, password: password)
49
- eval @scroll
50
- @ssh.close
47
+
48
+ begin
49
+ @ssh = Net::SSH.start( host, user, password: password)
50
+ eval @scroll
51
+ @ssh.close
52
+ rescue
53
+ @results[host] = nil
54
+ end
51
55
 
52
56
  end
53
57
 
@@ -101,6 +105,18 @@ class Miab
101
105
 
102
106
  alias df disk_space
103
107
 
108
+ def memory()
109
+
110
+ instructions = 'free -h'
111
+
112
+ puts ('instructions: ' + instructions.inspect).debug if @debug
113
+ r = @ssh ? @ssh.exec!(instructions) : system(instructions)
114
+ puts ('memory: ' + r.inspect).debug if @debug
115
+ a = r.lines
116
+ total, used, avail = a[1].split.values_at(1,2,-1)
117
+ @results[@host][:memory] = {total: total, used: used, available: avail}
118
+
119
+ end
104
120
 
105
121
  def pwd()
106
122
  instructions = 'pwd'
@@ -115,4 +131,3 @@ class Miab
115
131
  end
116
132
 
117
133
  end
118
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  9irKsAp/hZt3dTbQOtnSlc9XREZZdegwOgu1FEqBqviNIn9R28OR237HExiWXwmw
36
36
  HDTFIjk8XBqTunABuFUgr4qx
37
37
  -----END CERTIFICATE-----
38
- date: 2019-09-01 00:00:00.000000000 Z
38
+ date: 2019-09-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: net-ssh
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.1
106
+ rubygems_version: 3.0.3
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Message in a bottle (MIAB) is designed to execute remote commands through
metadata.gz.sig CHANGED
Binary file