my_nagios 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c81af784954c0a2770b725f040679fd24438ca7
4
- data.tar.gz: 87714809d6f2fb412c999c3b337db1a4d1860c04
3
+ metadata.gz: 65516932c8d438f3830679205966b778d4c9b160
4
+ data.tar.gz: 3795267e9e979ebeabc96e1b5208eeec83c7b5a5
5
5
  SHA512:
6
- metadata.gz: be3e802b5290b24b49e91ea7cc68bcb9d3bf1761eb92fa00796a129a97ee95297cc9607780b482fce31c429f44c1164bbdc957c1d097d8ddcffda87eb31108e8
7
- data.tar.gz: ea05ff6bf582358ed5575e682d11ff568092afab20b0485ccb62344e7462a7800d59d808b03c123398ccb4cb67856f41fe7704496a87c8ca090d6d0dca992b1a
6
+ metadata.gz: 99a3712ed84c1b11b4a61b40d960051911e89dadc8e3fa14068abc0fef67fe6d55d891728ee6d978e11ac0dc36d1bb92f6d0c68524612235153179c9d2d9f6e0
7
+ data.tar.gz: 4f75995204af1805b65047d6ef8aa176ef67bc98913a11be691e90707283ae383afae5d6375ea4f1843c2dc835862aeddd86104edb8abda9ec67a6d377f5ab40
@@ -3,6 +3,7 @@ require_dependency "my_nagios/application_controller"
3
3
  module MyNagios
4
4
  class WelcomeController < ApplicationController
5
5
 
6
+ skip_before_action :verify_authenticity_token, only: [:autorefresh]
6
7
  before_filter :find_criticals, only: [:index, :autorefresh]
7
8
 
8
9
  def index
@@ -11,12 +11,12 @@ module MyNagios
11
11
  begin
12
12
  self.update(state: :running)
13
13
 
14
- Net::SSH.start( self.host, self.user, config: true, keys: [self.pem_key] ) do| ssh |
14
+ Net::SSH.start( self.host, self.user, config: true, keys: [self.pem_key], non_interactive: true ) do| ssh |
15
15
  result = ssh.exec! self.command
16
16
  self.update(status: Check.determinate_status_by_response(result), latest_state: result, latest_updated_at: Time.now)
17
17
  end
18
18
  rescue => e
19
- self.update(status: :critical, latest_state: e, latest_updated_at: Time.now)
19
+ self.update(status: :info, latest_state: e, latest_updated_at: Time.now)
20
20
  ensure
21
21
  self.update(state: :completed)
22
22
  end
@@ -28,7 +28,7 @@ module MyNagios
28
28
  begin
29
29
  check_list.update_all(state: :running)
30
30
 
31
- Net::SSH.start( config['host'], config['user'], config: true, keys: [config['pem_key']] ) do |ssh|
31
+ Net::SSH.start( config['host'], config['user'], config: true, keys: [config['pem_key']], non_interactive: true ) do |ssh|
32
32
  check_list.each do |check|
33
33
  result = ssh.exec! check.command
34
34
  check.update(status: Check.determinate_status_by_response(result), latest_state: result, latest_updated_at: Time.now)
@@ -36,7 +36,7 @@ module MyNagios
36
36
  end
37
37
 
38
38
  rescue => e
39
- check_list.update_all(status: :critical, latest_state: e, latest_updated_at: Time.now)
39
+ check_list.update_all(status: :info, latest_state: e, latest_updated_at: Time.now)
40
40
  ensure
41
41
  check_list.update_all(state: :completed)
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module MyNagios
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Omelchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-22 00:00:00.000000000 Z
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails