lib/arborist/monitor/snmp/disk.rb
changeset 17 e4f0fd44734d
parent 14 d5cb8bd33170
child 26 54f2f57cc0b0
equal deleted inserted replaced
16:d6773db8469c 17:e4f0fd44734d
    58 		end
    58 		end
    59 
    59 
    60 		# Paths to exclude from checks
    60 		# Paths to exclude from checks
    61 		#
    61 		#
    62 		setting :exclude,
    62 		setting :exclude,
    63 			default: [ '^/dev(/.+)?$', '^/net(/.+)?$', '^/proc$', '^/run$', '^/sys/' ] do |val|
    63 			default: [ '^/dev(/.+)?$', '/dev$', '^/net(/.+)?$', '/proc$', '^/run$', '^/sys/', '/sys$' ] do |val|
    64 			mounts = Array( val ).map{|m| Regexp.new(m) }
    64 			mounts = Array( val ).map{|m| Regexp.new(m) }
    65 			Regexp.union( mounts )
    65 			Regexp.union( mounts )
    66 		end
    66 		end
    67 	end
    67 	end
    68 
    68 
   112 
   112 
   113 		errors   = []
   113 		errors   = []
   114 		warnings = []
   114 		warnings = []
   115 		mounts.each_pair do |path, percentage|
   115 		mounts.each_pair do |path, percentage|
   116 
   116 
   117 			warn = begin
   117 			warn = if warn_at.is_a?( Hash )
   118 			  if warn_at.is_a?( Hash )
   118 				warn_at[ path ] || WARN_AT
   119 				  warn_at[ path ] || WARN_AT
   119 			else
   120 			  else
   120 				warn_at
   121 				  warn_at
       
   122 			  end
       
   123 			end
   121 			end
   124 
   122 
   125 			self.log.debug "%s:%s -> at %d, warn at %d" % [ host, path, percentage, warn ]
   123 			self.log.debug "%s:%s -> at %d, warn at %d" % [ host, path, percentage, warn ]
   126 
   124 
   127 			if percentage >= warn.to_i
   125 			if percentage >= warn.to_i