servermonitor 0.1.1 → 0.1.1.1

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: aea04d5aae429e99a52aea46c149606610007157
4
- data.tar.gz: 1dc67650c10d6ee53d0b2c9c0c01d8e3bbeda0fc
3
+ metadata.gz: e875fe6e9df96b677d259d9b72b6bcd046def11b
4
+ data.tar.gz: c211b56df4c119f9815fff9e78989dc53ad64447
5
5
  SHA512:
6
- metadata.gz: c1c6c11c4544a61098c0d5cf8fcc07f8acce2653668b8153d439c95a54a1c37d3e6ac5657b475340ac01abef4d8885f241b7e2cfa81ddd4e48a3fc0b1f67d9f9
7
- data.tar.gz: b6aa98003119fcaa2bc76853ceb934e0f885f1af5ae820b1c65967aff7f79f55739bc33973a93f4adf74afce39c58062ec82ee1a9e1a186940889f3e9a78b02a
6
+ metadata.gz: b72d17a17ac020188be71f72e1db7a733d59c6342f15126e0aff14d85ad880a12fc9ae15800a89a4aa81f5f61b20407f807e678ef2aa9ccd4b3876f2d1bf08ed
7
+ data.tar.gz: b4dae4345c6047ecbc00ff994ad91e0b0162d5f133332d46f42d1b7929b8d8a53a2d45ec56d7fb213ead8ff66e97a372112270b8eef0ee3928c4e5c37b17bd7e
@@ -47,19 +47,20 @@ module ServerMonitor
47
47
  in_in.each do |i|
48
48
  # Regex matching
49
49
  Regexp.new('Drive\s*has\s*flagged\s*a\s*S\.M\.A\.R\.T\s*alert\s*:\s*Yes').match?(i) ? smart_status = "ALERT: YES".upcase : smart_status = "ALERT: NO".upcase
50
- # Display S.M.A.R.T Status
50
+ # Display S.M.A.R.T Status and do a clean exit if parameter exit_codes is enabled
51
51
  if smart_status == "ALERT: NO"
52
52
  puts "S.M.A.R.T drive status is " + smart_status.to_s + " on hostname " + fhostname
53
53
  puts exit 0 unless self.config.exit_codes == false
54
54
  else
55
+ # Display S.M.A.R.T Status and exit with error if exit_codes parameter is enabled
55
56
  puts "S.M.A.R.T drive status is " + smart_status.to_s + " on hostname " + fhostname
56
57
  puts exit 1 unless self.config.exit_codes == false
57
58
  end
58
59
  # Send email if email_to address is not empty AND if a disk does not return an "Alert: NO"
59
60
  if self.config.email_to != nil && smart_status != "ALERT: NO"
60
61
  time = Time.now.strftime("%d.%m.%Y %H:%M")
61
- subject = "Daily RAID check STARTED on #{fhostname} at #{time}. RAID STATE: #{smart_status}."
62
- body = "Daily RAID check: #{smart_status}"
62
+ subject = "RAID check STARTED on #{fhostname} at #{time}. RAID STATE: #{smart_status}."
63
+ body = "RAID check: #{smart_status}"
63
64
  email = ServerMonitor::EMail.new(self.config.email_from, self.config.email_to, self.config.smtp_address, self.config.smtp_port, self.config.smtp_username, self.config.smtp_password, subject, body)
64
65
  email.deliver
65
66
  end
@@ -1,3 +1,3 @@
1
1
  module ServerMonitor
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servermonitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nedim Hadzimahmutovic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-17 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.6.13
77
+ rubygems_version: 2.6.14
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Server Monitor