-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Bug] When having 12+ drives, the regex's don't capture properly #20
Comments
Yeah, this is definitely the case. if I put an echo statement in the check:
I get this output:
Meaning the $id==1 pass is matching $line from 10 and 11 as well I don't have a whole lot of shell experience so trying to figure it out |
My guess would be to add a space between $id and the * If having the space after the number is an issue, then you can use other bash commands to filter out any spaces from the string. |
so i only have a system with 9x drives, so i cannot 100% test this, but i replaced all instances of the lines like this old: new this forces the system to interpret the entire string section and with the added space and equals sign, it should ensure the entire ID number and not just the first digit is verified. also, i have a more capable version of this script here this version supports a web admin page, supports DSM7 specific / added IODs, supports email notifications/alerts, supports GPU monitoring (for DVA units) and more. years ago i started with kernelkaribou's script and kept adding to it |
Specifically, Drive 2, which comes in with $id=1, get overwritten by Drive 12 which comes in with $id=11
Output capture form running the script. You can see that for Disk 2, it actually captures the id.11 entry because its only grabbing the first digit, not both, but then it fails because later regexs capture the 11 properly and now the id doesnt match and so the final output fails, is my guess.
Running the SNMP walk commands manually generates the correct result
I suspect these lines are not capturing the regexs properly, specifically the $id*, will play around with it
The text was updated successfully, but these errors were encountered: