LinuxSystemInfo 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 748a4f845568bf41239a32eabb16f35994c760f9
4
- data.tar.gz: 3d58731f3f371626a18bed8c459554a86a6ff1c7
3
+ metadata.gz: bddb8a7b8cd8763dfbc53881ac4da5849f65a44f
4
+ data.tar.gz: 0bb6cf8d049b8664a35434e7b9833da09307942d
5
5
  SHA512:
6
- metadata.gz: 59cb62005a4b49aefe6a56354bee43f871ff86defd0abba30df2799cd561b773732dc7d1b1ac11b0059e2d3b509563a98563c2e7f8b1fa74d8e554ef7a5b6cd6
7
- data.tar.gz: 21195531b50a2a75a26282b853bc82cb91c983381d8bcf9d8dd297d76ef89c54fead3e9784eb04487b771fb5196911e9027255f6b152dd9637c0d446b0796dac
6
+ metadata.gz: f12428a487163082abd0a7481d51ef81cdbd20836c14333a49ce70b54319583bf05699bfcc1871104e640722e1de75222a3dd55fd6e2203f5e4b81e45dd938a4
7
+ data.tar.gz: 9fb493c2a884f4c59a0ead181ff7703b834bcaba9b6542995e1e467a10a3cb2c1b2704809b1c50a5af04efc4e4528016ef783dc664a1a5e9ae121cb705fa46cd
data/README.md CHANGED
@@ -205,6 +205,26 @@ LinuxSystemInfo.hostname
205
205
  "example.com"
206
206
  ```
207
207
 
208
+ #### Processes
209
+
210
+ LinuxSystemInfo.processes
211
+
212
+ Returns all process that are not by root, nobody, and syslog user.
213
+
214
+ ```ruby
215
+ {
216
+ "929"=>{:user=>"avahi", :pid=>"929", :cpu=>"0.0", :mem=>"0.0", :vsz=>"32348", :rss=>"1644", :tty=>"?", :stat=>"S", :start=>"07:42", :time=>"0:00", :command=>"avahi-daemon:"},
217
+ "932"=>{:user=>"avahi", :pid=>"932", :cpu=>"0.0", :mem=>"0.0", :vsz=>"32224", :rss=>"468", :tty=>"?", :stat=>"S", :start=>"07:42", :time=>"0:00", :command=>"avahi-daemon:"},
218
+ "1096"=>{:user=>"whoopsie", :pid=>"1096", :cpu=>"0.0", :mem=>"0.0", :vsz=>"430420", :rss=>"4964", :tty=>"?", :stat=>"Ssl", :start=>"07:42", :time=>"0:00", :command=>"whoopsie"},
219
+ "1229"=>{:user=>"mysql", :pid=>"1229", :cpu=>"0.0", :mem=>"1.7", :vsz=>"922568", :rss=>"136528", :tty=>"?", :stat=>"Ssl", :start=>"07:42", :time=>"0:21", :command=>"/usr/sbin/mysqld"},
220
+ "1252"=>{:user=>"postgres", :pid=>"1252", :cpu=>"0.0", :mem=>"0.2", :vsz=>"247716", :rss=>"16184", :tty=>"?", :stat=>"S", :start=>"07:42", :time=>"0:00", :command=>"/usr/lib/postgresql/9.3/bin/postgres"},
221
+ "1284"=>{:user=>"postgres", :pid=>"1284", :cpu=>"0.0", :mem=>"0.0", :vsz=>"248580", :rss=>"2996", :tty=>"?", :stat=>"Ss", :start=>"07:42", :time=>"0:00", :command=>"postgres:"},
222
+ "1285"=>{:user=>"postgres", :pid=>"1285", :cpu=>"0.0", :mem=>"0.0", :vsz=>"103392", :rss=>"1772", :tty=>"?", :stat=>"Ss", :start=>"07:42", :time=>"0:00", :command=>"postgres:"},
223
+ [...]
224
+ "1671"=>{:user=>"kernoops", :pid=>"1671", :cpu=>"0.0", :mem=>"0.0", :vsz=>"37144", :rss=>"1008", :tty=>"?", :stat=>"Ss", :start=>"07:42", :time=>"0:00", :command=>"/usr/sbin/kerneloops"}
225
+ }
226
+ ```
227
+
208
228
  #### Hash
209
229
 
210
230
  LinuxSystemInfo.to_hash
@@ -301,7 +321,10 @@ LinuxSystemInfo.to_hash
301
321
  :ip6 => "fe80::c23f:d5ff:fe6b:d5c8/64"
302
322
  }
303
323
  },
304
- :video => "Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)",
324
+ :video =>
325
+ [
326
+ "Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)"
327
+ ],
305
328
  :audio =>
306
329
  [
307
330
  "Intel Corporation Haswell-ULT HD Audio Controller (rev 09)",
@@ -76,6 +76,24 @@ module LinuxSystemInfo
76
76
  }
77
77
  end
78
78
 
79
+ def processes
80
+ users = 'root,nobody,syslog'
81
+ procs = `ps u -U '#{users}' -u '#{users}' -N`
82
+ output = Hash.new
83
+ procs = procs.split("\n")
84
+ procs.slice!(0)
85
+ procs.each do |proc|
86
+ proc = proc.split
87
+ output[proc[1]] = {
88
+ user: proc[0], pid: proc[1], cpu: proc[2],
89
+ mem: proc[3], vsz: proc[4], rss: proc[5],
90
+ tty: proc[6], stat: proc[7], start: proc[8],
91
+ time: proc[9], command: proc[10]
92
+ }
93
+ end
94
+ output
95
+ end
96
+
79
97
  def storage
80
98
  output = Hash.new
81
99
  storage = `df -h`
@@ -1,3 +1,3 @@
1
1
  module LinuxSystemInfo
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: LinuxSystemInfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler