-
Notifications
You must be signed in to change notification settings - Fork 79
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
nhc_common_parse_size
doesn't support decimal values
#120
Comments
This is a known limitation of Bash; it supports integer arithmetic only. The "converse" function, One possible workaround that's still readable involves some creative variable naming: # In /etc/sysconfig/nhc
KB=1024 ; MB=$((1024*KB)) ; GB=$((1024*MB)) ; TB=$((1024*GB)) ; PB=$((1024*TB)) ; EB=$((1024*PB)) This allows for the command-line args or config files to contain something like this: check_hw_physmem $((15*TB/10)) $((15*TB/10)) 10% Alternatively, you can employ a similar technique to the code I referenced above, reverting to the next lower size unit: check_hw_physmem 1536GB 1536GB 10% That said, if this is actually intended to be a request for adding some level of decimal-parsing support to |
Using decimal values in checks that use
nhc_common_parse_size
fail with an arithmetic operator error.For instance:
The text was updated successfully, but these errors were encountered: