recmon 1.1.1 → 1.1.2
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.
- data/CHANGELOG +3 -0
- data/README +0 -8
- data/lib/recmon/diskfree-sensor.rb +1 -1
- data/lib/recmon/diskspace-sensor.rb +1 -1
- data/lib/recmon/proc-sensor.rb +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -42,14 +42,6 @@ and it will periodically write entries to the log file (default = +/var/log/recm
|
|
42
42
|
...
|
43
43
|
2012-09-13T16:09:16+10:00 Recmon is exiting.
|
44
44
|
|
45
|
-
You can daemonise the process with the daemons rubygem:
|
46
|
-
require 'rubygems'
|
47
|
-
require 'recmon'
|
48
|
-
require 'daemons'
|
49
|
-
s = Recmon::Monitor.new()
|
50
|
-
# add sensors...
|
51
|
-
s.start()
|
52
|
-
|
53
45
|
== Sensors
|
54
46
|
There are several sensors:
|
55
47
|
|
@@ -15,7 +15,7 @@ class DiskfreeSensor < Sensor
|
|
15
15
|
# Called by Monitor. Executes df(1) to determine the disk %usage.
|
16
16
|
def sense()
|
17
17
|
begin
|
18
|
-
lines =
|
18
|
+
lines = `/bin/df #{@name}`.split("\n")
|
19
19
|
line = lines[1]
|
20
20
|
usage = "unknown"
|
21
21
|
if line
|
@@ -17,7 +17,7 @@ class DiskspaceSensor < Sensor
|
|
17
17
|
# Called by Monitor. Executes du(1) to determine the disk usage in Megabytes.
|
18
18
|
def sense()
|
19
19
|
begin
|
20
|
-
size =
|
20
|
+
size = `/usr/bin/du -sk #{@path}`.to_i()/1024
|
21
21
|
rescue
|
22
22
|
size = "unknown"
|
23
23
|
end
|
data/lib/recmon/proc-sensor.rb
CHANGED
@@ -14,8 +14,8 @@ class ProcSensor < Sensor
|
|
14
14
|
# Called by Monitor. This method executes pgrep(1) to check if one or more
|
15
15
|
# processes match
|
16
16
|
def sense()
|
17
|
-
|
18
|
-
status =
|
17
|
+
`/usr/bin/pgrep -f "#{@pattern}"`
|
18
|
+
status = $?.success? ? "running" : "stopped"
|
19
19
|
return("proc=#{@name} status=#{status}")
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recmon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Richard Kernahan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-30 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: "\tRecmon generates log entries for a range of events that are not typically logged.\n Once they are logged, they can be analysed to generate alerts.\n\n REC (Ruby Event Correlation) is the tool that correlates events across time to determine\n if a situation is abnormal, and so generates fewer, more meaningful alerts\n by email or instant message.\n\n So Recmon + REC = lightweight Nagios\n"
|