1

I'm very new to Ubuntu. In my brief experience, I've been increasingly impressed with whats available. Currently, I'm trying to log some system information periodically. I'm trying to figure out if there's a way I can do this from the command-line.

I know from the command line I can use the command landscape-sysinfo and it will display:

  • System Load
  • RAM memory Used
  • RAM memory Available
  • Hard Drive Space Used
  • Hard Drive Space Available
  • SWAP Usage

Is there a way that I can automatically write this stuff to a file called /logs/system-info.log every minute? If so, how?

Thank you!

user312840
  • 15
  • 1
  • 4

2 Answers2

2

Here is a relatively simple solution in principle:

  1. Cron job that runs landscape-sysinfo >> /logs/system-info.log every minute
  2. Configure logrotate for your /logs/system-info.log (so that your log file doesn't take over your server

Good luck!

David
  • 2,362
0

sudo passwd root (passwort)

sudo nano /etc/netplan/01-netcfg.yaml

Stelle sicher, dass die Konfiguration auf DHCP eingestellt ist:

network: version: 2 ethernets: eth0: dhcp4: true

Datei speichern und dann anwenden

sudo netplan apply

sudo hostnamectl set-hostname (Hostnamen deiner Wahl)

sudo useradd -m Anton.Steiner sudo passwd Anton.Steiner

Deaktivieren:

sudo usermod -L Anton.Steiner

echo "Netzwerkkonfiguration:" > ~/Linux_Sysinfos.txt ip a >> ~/Linux_Sysinfos.txt echo "Gateway:" >> ~/Linux_Sysinfos.txt ip route | grep default >> ~/Linux_Sysinfos.txt

echo "Arbeitsspeichergröße:" >> ~/Linux_Sysinfos.txt free -h >> ~/Linux_Sysinfos.txt

echo "Freier Festplattenspeicher:" >> ~/Linux_Sysinfos.txt df -h >> ~/Linux_Sysinfos.txt

echo "Netzwerkkonfiguration:" > ~/Linux_Sysinfos.txt && ip a >> ~/Linux_Sysinfos.txt && echo "Gateway:" >> ~/Linux_Sysinfos.txt && ip route | grep default >> ~/Linux_Sysinfos.txt && echo "Arbeitsspeichergröße:" >> ~/Linux_Sysinfos.txt && free -h >> ~/Linux_Sysinfos.txt && echo "Freier Festplattenspeicher:" >> ~/Linux_Sysinfos.txt && df -h >> ~/Linux_Sysinfos.txt