Fix up the docs, make the default disk exclusion list more useful. v0.5.0
authorMahlon E. Smith <mahlon@martini.nu>
Wed, 13 Jun 2018 08:54:19 -0700
changeset 17 e4f0fd44734d
parent 16 d6773db8469c
child 18 cedffd6652d3
Fix up the docs, make the default disk exclusion list more useful.
.ruby-version
README.md
lib/arborist/monitor/snmp/disk.rb
lib/arborist/snmp.rb
--- a/.ruby-version	Mon Apr 09 18:51:52 2018 -0700
+++ b/.ruby-version	Wed Jun 13 08:54:19 2018 -0700
@@ -1,1 +1,1 @@
-2.4
+2.5
--- a/README.md	Mon Apr 09 18:51:52 2018 -0700
+++ b/README.md	Wed Jun 13 08:54:19 2018 -0700
@@ -51,28 +51,30 @@
 ```
 arborist:
   snmp:
-	timeout: 2
-	retries: 1
-	community: public
-	version: 2c
-	port: 161
-	batchsize: 25
-	cpu:
-	  warn_at: 80
-	disk:
-	  warn_at: 90
-	  include: ~
-	  exclude:
-	  - "^/dev(/.+)?$"
-	  - "^/net(/.+)?$"
-	  - "^/proc$"
-	  - "^/run$"
-	  - "^/sys/"
-	memory:
-	  physical_warn_at: ~
-	  swap_warn_at: 60
-	processes:
-	  check: []
+    timeout: 2
+    retries: 1
+    community: public
+    version: 2c
+    port: 161
+    batchsize: 25
+    cpu:
+      warn_at: 80
+    disk:
+      warn_at: 90
+      include: 
+      exclude:
+      - "^/dev(/.+)?$"
+      - "/dev$"
+      - "^/net(/.+)?$"
+      - "/proc$"
+      - "^/run$"
+      - "^/sys/"
+      - "/sys$"
+    processes:
+      check: []
+    memory:
+      physical_warn_at: 
+      swap_warn_at: 60
 ```
 
 The `warn_at` keys imply usage capacity as a percentage. ie:  "Warn me
--- a/lib/arborist/monitor/snmp/disk.rb	Mon Apr 09 18:51:52 2018 -0700
+++ b/lib/arborist/monitor/snmp/disk.rb	Wed Jun 13 08:54:19 2018 -0700
@@ -60,7 +60,7 @@
 		# Paths to exclude from checks
 		#
 		setting :exclude,
-			default: [ '^/dev(/.+)?$', '^/net(/.+)?$', '^/proc$', '^/run$', '^/sys/' ] do |val|
+			default: [ '^/dev(/.+)?$', '/dev$', '^/net(/.+)?$', '/proc$', '^/run$', '^/sys/', '/sys$' ] do |val|
 			mounts = Array( val ).map{|m| Regexp.new(m) }
 			Regexp.union( mounts )
 		end
@@ -114,12 +114,10 @@
 		warnings = []
 		mounts.each_pair do |path, percentage|
 
-			warn = begin
-			  if warn_at.is_a?( Hash )
-				  warn_at[ path ] || WARN_AT
-			  else
-				  warn_at
-			  end
+			warn = if warn_at.is_a?( Hash )
+				warn_at[ path ] || WARN_AT
+			else
+				warn_at
 			end
 
 			self.log.debug "%s:%s -> at %d, warn at %d" % [ host, path, percentage, warn ]
--- a/lib/arborist/snmp.rb	Mon Apr 09 18:51:52 2018 -0700
+++ b/lib/arborist/snmp.rb	Wed Jun 13 08:54:19 2018 -0700
@@ -14,7 +14,7 @@
 
 
 	# Package version
-	VERSION = '0.4.0'
+	VERSION = '0.5.0'
 
 	# Version control revision
 	REVISION = %q$Revision$