-
Notifications
You must be signed in to change notification settings - Fork 50
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
check-swap-percent.rb fails on FreeBSD #43
Comments
@inferiorhumanorgans I see that we rewrote that check anyways, can you test it against master? |
might be fixed with just a release which has been requested in #54 |
2.0.0 has the rewritten swap check. Can you try that and feel free to reopen if still a problem. |
Well free(1) is Linux only, so I can't imagine it works. |
@inferiorhumanorgans correct sorry I didnt look inside to see that it was simply shelling out for free to get that, we should look into a cross platform way to do this. |
@eheydrick please repopen |
This might be a good way to go: |
@inferiorhumanorgans I used that one for cross platform ram checking, looks like there was some stuff just merged using |
procfs is pretty much always guaranteed to be platform dependent. |
- switches `free` to read from `/proc/swaps` which is more platform agnostic
- switches `free` to read from `/proc/swaps` which is more platform agnostic
@inferiorhumanorgans can you check out #57 and see if that works for you? Its certainly rough around the edges but wanted to see if I could just get something working for you. |
I'd suggest using an existing abstraction layer. Procfs is inherently operating system dependent and rarely (if ever) considered cross-platform. ruby-vmstat that I linked to above is MIT licensed and claims explicit support for:
|
@inferiorhumanorgans sorry I misread your initial comment. Agreed, however I checked and the vmstat did not look like it had swap support unless I am missing something. |
Ah, true. However, the same problems apply to the other memory checks in this repo as it looks like they rely on |
I did find this: https://github.com/djberg96/sys-filesystem that does work except that it does not detect swap so if we can detect all the swap paths/devices then we could use that. I will dig more when I have some more free time. |
@inferiorhumanorgans check-ram uses vmstat gem and does not rely on |
Yeah, I'd go for some/more coverage especially as the vmstat gem is already being used here and checking swap info is well within scope per their readme. |
yup it looks like its on the todo list |
The text was updated successfully, but these errors were encountered: