sensu-plugins / sensu-plugins-filesystem-checks

This plugin provides native instrumentation for monitoring and metrics collection, including:health, usage, and various metrics of filesystem attributes.
http://sensu-plugins.io
MIT License
8 stars 25 forks source link

Unnecessary ruby errors in check output #14

Open jaykumar-jnpr opened 8 years ago

jaykumar-jnpr commented 8 years ago

Unnecessary ruby errors in check output, need to sanitize it

/opt/sensu/embedded/bin/check-fs-writable.rb --dir '/b'

Check failed to run: No space left on device, ["/opt/sensu/embedded/lib/ruby/2.3.0/delegate.rb:341:in `read'", "/opt/sensu/embedded/lib/ruby/2.3.0/delegate.rb:341:in `block in delegating_block'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-filesystem-checks-0.2.0/bin/check-fs-writable.rb:142:in `block in manual_test'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-filesystem-checks-0.2.0/bin/check-fs-writable.rb:135:in `each'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-filesystem-checks-0.2.0/bin/check-fs-writable.rb:135:in `manual_test'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-filesystem-checks-0.2.0/bin/check-fs-writable.rb:151:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.3.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]

My workaround was (not elegant),

/opt/sensu/embedded/bin/check-fs-writable.rb --dir '/b' | awk -F , '{print $1}' ; exit ${PIPESTATUS[0]}
Savemech commented 8 years ago

this is very nice, any chances to get this embedded?

majormoses commented 7 years ago

ideally we could rescue (ideally on some condition) without looking at the code though I am not sure the feasibility of this.