arborist-snmp 0.6.1 → 0.6.2

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
  SHA256:
3
- metadata.gz: f2018a5dacf04f2cd6b821c5438fe71b2950d512f4c3f8e1f398c6cba4ca7f52
4
- data.tar.gz: '084f3b0db42917d34889931ca62a7f45830975024d410b35b715f64d87be1566'
3
+ metadata.gz: 4228ee82fe30505164e68c53d64f067c0ff3a2cff6fc1f9b58b573eea6b6dfb9
4
+ data.tar.gz: 680f22d6e97ece0699cf02851d698fdb478588239b9c0a921ef72909dc1dd3dc
5
5
  SHA512:
6
- metadata.gz: 174317ae1282ceadba0660f528e51147395801a3f26956acc950e44159f53567f4393d1f171e1378067ef441f2aac340b196b0902ff0a455f61dc0eed20a68c6
7
- data.tar.gz: 2e23e9e51ba7b583396f6b35d522e6d855dec586c619ba11c4e6004a6e53590ecd404c8d9cc222abbdf4defdc27d5675ae1e00e8dc3964e886cb3a06cd8d6567
6
+ metadata.gz: bf3c4613ca94861b2744e8e461e70142701c1205d07169fc05de0fc7111b22382e34414804fde1bf399eca2363d206b91efe20bfbe2b5941ad3b22c8c9f4c52b
7
+ data.tar.gz: 7d089aa2b0bac1a86118659c0aa4efb82b50363f13588d21ecb1359c62650df55a7016e0d47545824c4d7a2d04adba67c8dd6e393fcc7b8516a20a5cdb43a81a
Binary file
@@ -0,0 +1,3 @@
1
+ |U�M�8D�n�s���P]+ a<��J ��w�Y*��q�l���4�U����/j�,O*��*\k�����Q�; ��6S���f3�E�dvR���k�8?#���7`mq�D���SKG����XH,�s�nD� I[zȭ���fZ��kQ���Jbh���^�������@.ס�ΉחT�[��n�;
2
+
3
+ �W����2f�s7�2/�I� o��hD�<Sl��筒�m2����F���Z@�o�5Ё��-�~mY��C���j�`���14��w{�&^X�����О�Y�B�;��2�[�
@@ -57,7 +57,7 @@ module Arborist::Monitor::SNMP
57
57
  nodes.each_pair do |(identifier, props)|
58
58
  next unless props.key?( 'addresses' )
59
59
  address = props[ 'addresses' ].first
60
- self.identifiers[ address ] = [ identifier, props['config'] ]
60
+ self.identifiers[ address ] = [ identifier, props ]
61
61
  end
62
62
 
63
63
  # Perform the work!
@@ -117,7 +117,7 @@ class Arborist::Monitor::SNMP::CPU
117
117
  def find_load( host, snmp )
118
118
  info = self.format_load( snmp )
119
119
 
120
- config = identifiers[ host ].last || {}
120
+ config = self.identifiers[ host ].last['config'] || {}
121
121
  warn_at = config[ 'warn_at' ] || self.class.warn_at
122
122
  usage = info.dig( :cpu, :usage ) || 0
123
123
 
@@ -70,7 +70,9 @@ class Arborist::Monitor::SNMP::Disk
70
70
  ### Return the properties used by this monitor.
71
71
  ###
72
72
  def self::node_properties
73
- return USED_PROPERTIES
73
+ used_properties = USED_PROPERTIES.dup
74
+ used_properties << :mounts
75
+ return used_properties
74
76
  end
75
77
 
76
78
 
@@ -98,22 +100,23 @@ class Arborist::Monitor::SNMP::Disk
98
100
  ### +snmp+ connection.
99
101
  ###
100
102
  def gather_disks( host, snmp )
101
- mounts = self.system =~ /windows\s+/i ? self.windows_disks( snmp ) : self.unix_disks( snmp )
102
- config = self.identifiers[ host ].last || {}
103
- warn_at = config[ 'warn_at' ] || self.class.warn_at
103
+ current_mounts = self.system =~ /windows\s+/i ? self.windows_disks( snmp ) : self.unix_disks( snmp )
104
+ config = self.identifiers[ host ].last['config'] || {}
105
+ warn_at = config[ 'warn_at' ] || self.class.warn_at
106
+
107
+ self.log.warn self.identifiers[ host ]
104
108
 
105
109
  includes = self.format_mounts( config, 'include' ) || self.class.include
106
110
  excludes = self.format_mounts( config, 'exclude' ) || self.class.exclude
107
111
 
108
- mounts.reject! do |path, percentage|
112
+ current_mounts.reject! do |path, percentage|
109
113
  path = path.to_s
110
114
  excludes.match( path ) || ( includes && ! includes.match( path ) )
111
115
  end
112
116
 
113
117
  errors = []
114
118
  warnings = []
115
- mounts.each_pair do |path, percentage|
116
-
119
+ current_mounts.each_pair do |path, percentage|
117
120
  warn = if warn_at.is_a?( Hash )
118
121
  warn_at[ path ] || WARN_AT
119
122
  else
@@ -131,6 +134,13 @@ class Arborist::Monitor::SNMP::Disk
131
134
  end
132
135
  end
133
136
 
137
+ # Remove any past mounts that configuration exclusions should
138
+ # now omit.
139
+ mounts = self.identifiers[ host ].last[ 'mounts' ] || {}
140
+ mounts.keys.each{|k| mounts[k] = nil }
141
+
142
+ mounts.merge!( current_mounts )
143
+
134
144
  self.results[ host ] = { mounts: mounts }
135
145
  self.results[ host ][ :error ] = errors.join(', ') unless errors.empty?
136
146
  self.results[ host ][ :warning ] = warnings.join(', ') unless warnings.empty?
@@ -84,7 +84,7 @@ class Arborist::Monitor::SNMP::Memory
84
84
  def gather_memory( host, snmp )
85
85
  info = self.system =~ /windows\s+/i ? self.get_windows( snmp ) : self.get_mem( snmp )
86
86
 
87
- config = identifiers[ host ].last || {}
87
+ config = self.identifiers[ host ].last['config'] || {}
88
88
  physical_warn_at = config[ 'physical_warn_at' ] || self.class.physical_warn_at
89
89
  swap_warn_at = config[ 'swap_warn_at' ] || self.class.swap_warn_at
90
90
 
@@ -71,7 +71,7 @@ class Arborist::Monitor::SNMP::Process
71
71
  #### +snmp+ connection.
72
72
  ###
73
73
  def gather_processlist( host, snmp )
74
- config = self.identifiers[ host ].last || {}
74
+ config = self.identifiers[ host ].last['config'] || {}
75
75
  errors = []
76
76
  procs = self.system =~ /windows\s+/i ? self.get_windows( snmp ) : self.get_procs( snmp )
77
77
 
@@ -104,7 +104,7 @@ class Arborist::Monitor::SNMP::UPS::Battery
104
104
  def check_battery( host, snmp )
105
105
  info = self.format_battery( snmp )
106
106
 
107
- config = identifiers[ host ].last || {}
107
+ config = self.identifiers[ host ].last['config'] || {}
108
108
  cap_warn = config[ 'capacity_warn_at' ] || self.class.capacity_warn_at
109
109
  temp_warn = config[ 'temperature_warn_at' ] || self.class.temperature_warn_at
110
110
 
@@ -14,7 +14,7 @@ module Arborist::SNMP
14
14
 
15
15
 
16
16
  # Package version
17
- VERSION = '0.6.1'
17
+ VERSION = '0.6.2'
18
18
 
19
19
  # Version control revision
20
20
  REVISION = %q$Revision$
metadata CHANGED
@@ -1,15 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arborist-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mahlon E. Smith <mahlon@martini.nu>
8
8
  - Michael Granger <ged@faeriemud.org>
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
12
- date: 2019-04-19 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdtYWhs
15
+ b24vREM9bWFydGluaS9EQz1udTAeFw0yMDAyMTkyMTU4NDBaFw0yMTAyMTgyMTU4
16
+ NDBaMCIxIDAeBgNVBAMMF21haGxvbi9EQz1tYXJ0aW5pL0RDPW51MIIBojANBgkq
17
+ hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA3cz7ILM8n+Y5nvz7mVRVqE8LusWdT8NX
18
+ nlnETynDndenI+a2S3j22DR+U4ooGUjuCHE3iR1CVmTDGbxFfNRfmnC1AN9Hybat
19
+ ewW+onvMBye7yfO0bJB5vkqaW5vd35rzquOffgBtJMo7rPRu6pX8RkL34Wnew4J7
20
+ POooUcYbWSAO934HSCUC8wVm6b4v/ejVF1Lk44Dz45jtMqtR7KTAtpipdbTXAarO
21
+ HQy3eVes/0oTqhk4CP50r1KP09nUHTn2lzVaCN9vmNE/Jwe0AuQ9ImvZXPpCsMMl
22
+ V03/tuJ++48sVmOIusJkASPupXcdI6zqsjYw2vLMFtuYNskRSvwbn6Wm6x9hLWWj
23
+ IRp5FvHPORLRCHFizXRmXZ3PyFHqbv6m4yG0SyfMzOXPk3Hn5dqqmK+BFCihTZIN
24
+ fqpBmuxyNEE21fSO9ALLlWeW9ffg9Ye5Sc1n3yEyv8rPb9VDvi1B5N6xIcDFMNVs
25
+ RiCamNbET4Sq9VIYwYtcB1f6EataqFEhAgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYD
26
+ VR0PBAQDAgSwMB0GA1UdDgQWBBR8KtAhZIhe2uPQHCgU5HurIG7crTAcBgNVHREE
27
+ FTATgRFtYWhsb25AbWFydGluaS5udTAcBgNVHRIEFTATgRFtYWhsb25AbWFydGlu
28
+ aS5udTANBgkqhkiG9w0BAQsFAAOCAYEAHXlLXIKQUjd0VYj2mPgMheMjLEtmhHu+
29
+ 7NdIv8Bz4rpKAdhypy30xjukGLTOKBp1C0TjfHXowW/icK0bv9CO9Chbc09/+Ed2
30
+ K5IsyENen+YLeLfE8dguq5tHlfocbFilRGHt8BHHO9BpPpAYoPt/76SCC2NaU5vN
31
+ 33YTCpaVP0raS6E4i+xtx5PNdKoeTdrgwCQtUBhGf3L9YbZy1UaSeAyng5keuOzV
32
+ Mu2osihEB0GE0pOZJNpI6ow+0emwN/XvBKHpN9D2bjbvKetyQSrm0OniaZBXIGzW
33
+ Bg0JmajxUaGYWnz+QFADT+HLPmekxF3mB4+0ymZCHKPC+04h6RDjvkEOji6Jm+VB
34
+ JHjnceUEejSXTkZAKAmiOAtnX4j1MM1DLiFMlZ5Wbt7hbiOiO5HoN9p9snZhYqSU
35
+ JyAQQloqY/KyzQqxPlKdMNmBxRU+Cdarp05lEI6Sfj9MdrndoIL6MT/f6PgoCWZQ
36
+ xEarK1Fn47yS4UZqRi6VgKc3JHscX9x4
37
+ -----END CERTIFICATE-----
38
+ date: 2020-04-28 00:00:00.000000000 Z
13
39
  dependencies:
14
40
  - !ruby/object:Gem::Dependency
15
41
  name: arborist
@@ -86,8 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
112
  - !ruby/object:Gem::Version
87
113
  version: '0'
88
114
  requirements: []
89
- rubyforge_project:
90
- rubygems_version: 2.7.6
115
+ rubygems_version: 3.1.2
91
116
  signing_key:
92
117
  specification_version: 4
93
118
  summary: SNMP support for Arborist monitors
Binary file