N
N
Nikolai2020-10-26 11:33:01
linux
Nikolai, 2020-10-26 11:33:01

Where is log in linux with low memory entries?

You need to see how many times the level of disk space has dropped.
There must be some kind of magazine. Where is he located?

5f9689b8cd7c1396473629.png

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Victor Taran, 2020-10-26
Demidovets @Nik_o_lay

5f96b6379ceda424899904.png

test "90" -gt "$(df -h |grep /dev/vzfs | awk {'print $5'} | sed 's/\%//g')"

if there is no test on the server or you don’t want to put it, you can change it to if, well, and brackets there, we
track everything by the return code
0 - everything is fine
1 - no
)
-gt- more
90- percentage on the disk
df -h- size information about the filling of the disk
grep /dev/vzfs- here you need to substitute your disk
awk {'print $5'}-5 column
sed 's/\%//g'- remove the percentage to compare the number.
And what you have on the screen is some kind of widget or whatever it is called in your shell.
Perhaps this miracle even keeps some logs, but you need to watch it.
suse is not at hand, so here it is ;*(
Linux itself does not keep such logs by default.

A
Adamos, 2020-10-26
@Adamos

"The level of disk space went down", for example, with each write to any log.

S
Saboteur, 2020-10-26
@saboteur_kiev

There is no such journal. There may be errors in the log if the disk space has completely run out.
And to follow - you need to put some kind of monitoring.

U
unseriously, 2020-10-26
@unseriously

Maybe the dmesg command will help. In general, all the logs in / val / log

C
ComodoHacker, 2020-10-26
@ComodoHacker

Of course, there are logs (/val/log), but such information is not written there by default. If you need such monitoring, write a script and run it with cron.

S
Sergey Pankov, 2020-10-26
@trapwalker

Not suitable for everyone. but if you already use python, then you can give out any info like this:

py "(lambda t, u, f: f'Total: {t}; Used: {u} ({100*u/t:.0f}%); Free: {f} ({100*f/t:.0f}%)')(*shutil.disk_usage('/'))"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question