-
Notifications
You must be signed in to change notification settings - Fork 156
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
_head.sh assumes uptime has same format all the time #576
Comments
definitely a bug, thanks for reporting! |
I'll find a developer for the task soon... |
thank you for the ticket reported, I topped your account for 15 mins, transaction |
@yegor256 please proceed, it's yours |
the problem is that |
In this case using |
I'm thinking how to unit test this problem first... |
@yegor256 the task is not yours any more,stop now |
Is it correct that
? |
I found a preliminary solution for this problem: On my machine (Windows, Git bash) both following commands return the expected result (
Are there any reasons not to use |
@dpisarenko looks correct (I would use different command, but there is nothing wrong with the one you used), let's see what the reviewer will say |
Thanks |
@dpisarenko Many thanks! 30 mins were added to your account in Transaction ID |
The line below:
Is not always correct.
On my system load average currently has such value:
as you can see it has only 11 values, not 12 like is assumed in the awk above.
12 value will appear when system is up for at least 1-2 days then it will look like this:
Now instead of
8:39
it is266 days
.So for instances that are younger than 1 day it will return empty string which will always pass load average check that is below and overload given machine.
I would propose to instead use
cat /proc/loadavg
and get value at third position (here number0.82
).The text was updated successfully, but these errors were encountered: