servermonitor 0.1.1.3 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e0cb8074195288e7fd01286ef67396860c4d74f
4
- data.tar.gz: 2a8b1383942152216d78cc1b149ee5f26c664906
3
+ metadata.gz: 81b2885f879aa8d54a1d77cf47aaf6a9dbae54b0
4
+ data.tar.gz: faa7ceb84b76796e53aab9af5106f163db82770a
5
5
  SHA512:
6
- metadata.gz: 43632977b563cea2b2de32013a24e4cfa22576e221ca4024104099cbfd7de443f2145ef53551692ffc126d7289650d12be9034b9924842632b2b733e2f0407cf
7
- data.tar.gz: f0e18522b0d1091978ec3934bc002e1490d8f7dd726bf0f322ad046b0d4e03bd040a763d0578aca72b95ca34df1821863e17de8d24e184d8680924ef959e8828
6
+ metadata.gz: 200aaf21993d96637153e92516b1755a26e045e27017fbecd6c445a3583c2692056a665caaf40ebcfe140016f0873ebcdf552108f12a421c2f54b68ff58bb388
7
+ data.tar.gz: 9952e4a008d8f4652b6808a90d4242c70939a4ffec7b23a78d1e3e8d1c573f73f4e4e2b9faf1d2ee7dc82ee49e51e2b0b847902d66fdc46fb1d358a5d5f2ab41
@@ -43,23 +43,24 @@ module ServerMonitor
43
43
  raid_status.each_line { |l| in_in << l.chomp }
44
44
 
45
45
  # Check virtual drive status
46
- in_in.each { |i| Regexp.new('State\s*:\s*Optimal').match?(i) ? vd_status = "Optimal".upcase : vd_status = "NOT Optimal".upcase }
46
+ in_in.each do |i|
47
+ Regexp.new('State\s*:\s*Optimal').match?(i) ? vd_status = "Optimal".upcase : vd_status = "NOT Optimal".upcase
47
48
 
48
- # Display VD Status
49
- if vd_status == "Optimal"
50
- puts "Virtual drive status is " + vd_status.to_s + " on hostname " + fhostname
51
- puts exit 0 unless self.config.exit_codes == false
52
- else
53
- puts "Virtual drive status is " + vd_status.to_s + " on hostname " + fhostname
54
- puts exit 1 unless self.config.exit_codes == false
55
- end
56
-
57
- if self.config.email_to != nil
58
- time = Time.now.strftime("%d.%m.%Y %H:%M")
59
- subject = "Daily RAID check STARTED on #{fhostname} at #{time}. RAID STATE: #{vd_status}."
60
- body = "Daily RAID check: #{vd_status}"
61
- 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)
62
- email.deliver
49
+ # Display VD Status
50
+ if vd_status == "Optimal"
51
+ puts "Virtual drive status is " + vd_status.to_s + " on hostname " + fhostname
52
+ puts exit 0 unless self.config.exit_codes == false
53
+ else
54
+ puts "Virtual drive status is " + vd_status.to_s + " on hostname " + fhostname
55
+ puts exit 1 unless self.config.exit_codes == false
56
+ end
57
+ if self.config.email_to != nil
58
+ time = Time.now.strftime("%d.%m.%Y %H:%M")
59
+ subject = "Daily RAID check STARTED on #{fhostname} at #{time}. RAID STATE: #{vd_status}."
60
+ body = "Daily RAID check: #{vd_status}"
61
+ 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)
62
+ email.deliver
63
+ end
63
64
  end
64
65
  end
65
66
  end
@@ -1,3 +1,3 @@
1
1
  module ServerMonitor
2
- VERSION = "0.1.1.3"
2
+ VERSION = "0.1.2"
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.3
4
+ version: 0.1.2
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-10-25 00:00:00.000000000 Z
11
+ date: 2017-10-29 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.10
77
+ rubygems_version: 2.6.13
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Server Monitor