Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running check-snmpt-disk.rb results in NoMethodError #38

Open
khourybrazil opened this issue Aug 4, 2020 · 0 comments
Open

Running check-snmpt-disk.rb results in NoMethodError #38

khourybrazil opened this issue Aug 4, 2020 · 0 comments

Comments

@khourybrazil
Copy link

When I run check-snmpt-disk.rb it fails:

check-snmp-disk.rb -h 192.168.1.1 -C community -m /data/somemount -w 80 -c 95
CheckSNMP UNKNOWN: An unknown error occured: #<NoMethodError: undefined method `/' for #<SNMP::Integer:0x0000555abd4a2730 @value=364993517>>

When I change dev_used.value to dev_used.value.to_f (or .to_i) on this line it returns the expected output:

CheckSNMP OK: All disk usage under 80%

I was going to open a quick PR but I noticed this line was changed intentionally in the past:
0a657ad

I've verified this behavior on Alpine using ruby 2.4.4p296 and macOS using ruby 2.3.7p456.

Thanks,
Khoury

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant