Add support for systems with German language (#111)

This commit is contained in:
Masoko
2024-05-08 18:53:03 +03:00
committed by GitHub
parent 0d1ae214e3
commit a64c63113d
2 changed files with 7 additions and 4 deletions

View File

@@ -200,15 +200,15 @@ You need to edit the service file and update the path to the script and the user
Then copy the service file to ```/etc/systemd/system/``` and enable it:
```bash
sudo cp rpi-cpu2mqtt.service /etc/systemd/system/
sudo systemctl enable rpi-cpu2mqtt.service
sudo cp rpi-mqtt-monitor.service /etc/systemd/system/
sudo systemctl enable rpi-mqtt-monitor.service
```
To test that the service is working you can run:
```bash
sudo service rpi-cpu2mqtt start
sudo service rpi-cpu2mqtt status
sudo service rpi-mqtt-monitor start
sudo service rpi-mqtt-monitor status
```
## Schedule Raspberry Pi MQTT Monitor execution with a cron

View File

@@ -81,6 +81,9 @@ def check_swap():
def check_memory():
full_cmd = "free | grep -i mem | awk 'NR == 1 {print $3/$2*100}'"
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
if memory == '':
full_cmd = "free | grep -i speicher | awk 'NR == 1 {print $3/$2*100}'"
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
memory = round(float(memory.decode("utf-8").replace(",", ".")))
return memory