perus 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perus/pinger/metrics/mem.rb +1 -1
- data/lib/perus/pinger/metrics/temp.rb +1 -1
- data/lib/perus/pinger/metrics/value.rb +2 -2
- data/lib/perus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40d2722b9e4a1770182427f3e21d750752d11458
|
4
|
+
data.tar.gz: 0e4ad7c96d8e1a1615baab6637bfeb9277e9db02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30cfd9e9e034c02c344c15d8a9d4736398c33292fc84a08145720e1471dacbc97705ea9a9a3a3d664217dff36b9671567c56ad859b44edfd6ce2e9ad687a13c
|
7
|
+
data.tar.gz: 96ddb1fd262be6906b7bfdbfd1cb0f03afabe2d39a711bac3b990026921f9cf8bb85b62eec04fe4dcb3e03db5acb00bf8c100e7d27cee697fa6228fcb012ae62
|
@@ -4,7 +4,7 @@ module Perus::Pinger
|
|
4
4
|
metric!
|
5
5
|
|
6
6
|
def run
|
7
|
-
percent = shell(%
|
7
|
+
percent = shell(%Q[cat /proc/meminfo | awk '{if ($1=="MemTotal:") total = $2; if ($1 == "MemFree:") free = $2;} END {print (1 - (free / total))*100}'])
|
8
8
|
{mem_all: percent.to_f}
|
9
9
|
end
|
10
10
|
end
|
@@ -9,7 +9,7 @@ module Perus::Pinger
|
|
9
9
|
if darwin?
|
10
10
|
degrees = shell('istats cpu temp').split[2].match(/([0-9\.]+)/)[0]
|
11
11
|
else
|
12
|
-
degrees = shell(%
|
12
|
+
degrees = shell(%Q[sensors | grep "#{options.device}:"]).match(/#{options.device}:\s+(\S+)/)[1]
|
13
13
|
end
|
14
14
|
|
15
15
|
{temp: degrees.to_f}
|
@@ -10,8 +10,8 @@ module Perus::Pinger
|
|
10
10
|
metric!
|
11
11
|
|
12
12
|
def run
|
13
|
-
grep =
|
14
|
-
line = shell(%
|
13
|
+
grep = options.grep.gsub('"', '\\"')
|
14
|
+
line = shell(%Q[cat #{options.path} | egrep "#{grep}"])
|
15
15
|
value = line.match(Regexp.compile(options.match))[1]
|
16
16
|
{options.name => value}
|
17
17
|
end
|
data/lib/perus/version.rb
CHANGED