recmon 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == Version 1.1.2
2
+ - Enable running under other user
3
+
1
4
  == Version 1.1.1
2
5
  - Added ability to name the process (eg. "ruby: mymonitor" in the process list)
3
6
 
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 = `sudo /bin/df #{@name}`.split("\n")
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 = `sudo /usr/bin/du -sk #{@path}`.to_i()/1024
20
+ size = `/usr/bin/du -sk #{@path}`.to_i()/1024
21
21
  rescue
22
22
  size = "unknown"
23
23
  end
@@ -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
- down = `sudo /usr/bin/pgrep -f "#{@pattern}"` == ""
18
- status = down ? "stopped" : "running"
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: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.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-29 00:00:00 Z
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"