Merge branch 'master' into vhs

This commit is contained in:
2024-06-02 05:27:58 +02:00
29 changed files with 460 additions and 404 deletions

24
system/monitoring.md Normal file
View File

@@ -0,0 +1,24 @@
---
title: "Monitoring"
tags: [ "Documentation", "System", "CPU", "Memory" ]
---
Print the average CPU load over 1 minute, 5 minutes, and 15 minutes:
```bash
watch -d cat /proc/loadavg
stress="$(cat /proc/loadavg | awk '{print "Usage:" $2"%"}')"
```
Show memory usage in Gibitytes.
```bash
free -g
```
Show low and high gigibtye usage on a *l*ine, and repeat the measurement every 5 seconds:
```bash
REP=5
free --lohi -g -s $REP | lolcat
```

View File

@@ -2,6 +2,18 @@
title: "journal"
tags: [ "Documentation", "systemd" ]
---
See a running log of all system messages:
```bash
journalctl -f
```
Or just one unit (`sshd`):
```bash
journalctl -f -u sshd
```
Find errors since November
@@ -14,3 +26,13 @@ Limit size to 2G.
```bash
journalctl --vacuum-size=2G
```
Log the fact that you've installed your own `dnsmasq` on your system to `journalctl`, so that you can notice why your system's broken:
```bash
logger "Installed new dnsmasq"
sudo journalctl -f
```