hdtemp - monitorowanie temperatury dysku

Cytat z gielo data 2024-11-02, 13:55Moduł kontroluje temperaturę dysku twardego. Jest to bardzo ważny parametr w przypadku dysków NVMe, dla których zbyt wysoka temperatura prowadzi do ich zbyt wczesnego zużycia.
Moduł po przekroczeniu ustalonej temperatury, wysyła odpowiedni alert na adres email.Paczka do pobrania hdtemp_v1.3
Module Setup
1. Extract the package to /etc/monit/custommodules/. If the custommodules directory does not exist, create it.
2. Modify the settings in the config.cpp file if needed.
3. Run the autogen.sh script. This will create the executable file for the module.
4. Add the following entry to the /etc/monit/monitrc file:# hdtemp
check program nvme_temperature with path "/etc/monit/custommodules/hdtemp/hdtemp"
every 5 cycles
if status !=0 then alert
group health5. Reload Monit with the command:
$ systemctl reload monitModule Update
1. Replace the module files with the newer version.
2. Run the autogen.sh script.
3. Reload Monit with the command:
$ systemctl reload monitUruchomienie modułu
1. Rozpakuj paczkę do /etc/monit/custrommodules/ Jeśli nie masz katalogu custommodules, utwórz go
2. Zmień ustawienia w pliku config.cpp jeśli masz taką potrzebę
3. Uruchom plik autogen.sh. Spowoduje to utworzenie pliku wykonywalnego modułu
4. Dodaj do pliku /etc/monit/monitrc poniższy wpis:# hdtemp
check program nvme_temperature with path "/etc/monit/custommodules/hdtemp/hdtemp"
every 5 cycles
if status !=0 then alert
group health5. przeładuj monit poleceniem:
$ systemctl reload monitAktualizacja modułu
1. Zastąp pliki modułu, jego nowszą wersją
2. Uruchom plik autogen.sh
3. przeładuj monit poleceniem:
$ systemctl reload monit-- chanelog --
v1.3
- I added the option to display messages in English
- Dodałem możliwość wyświetlenia komunikatów po angielsku
v1.2
- I improved the code readability.
- I enhanced the display of disk temperature information and added a message for when the disk reaches or exceeds the maximum temperature.
- I added the ability to define the disk's maximum temperature (default is set to 40 degrees Celsius), upon reaching or exceeding which an alert is sent.
- I introduced a logging mode that records information about incidents of reaching the maximum temperature along with the incident's timestamp. The log can be disabled in the source code file, requiring the module to be recompiled.
- I added a variable at the beginning of the program, allowing the monitored drive's name to be easily defined.
- I modified the monitoring method in the
monitrc
configuration file. Now, an appropriate email alert is sent when the code returns a non-zero value (either when the temperature exceeds the maximum or if an error occurs for any reason).
- poprawiłem czytelność kodu
- poprawiłem wyświetlanie informacji o temperaturze dysku. Dodałem odpowiedni komunikat, gdy dysk osiągnie lub przekroczy temperaturę maksymalną.
- dodałem możliwość zdefiniowania temperatury maksymalnej dysku (standardowo ustawiłem 40 stopni celcjusza), po której osiągnięciu lub przekroczeniu wysyłany jest alert.
- dodałem tryb dziennika, w którym zapisywana jest informacja o incydencie osiągnięcia maksymalnej temperatury wraz z datą wystąpienia incydentu. Dziennik można wyłączyć w pliku z kodem źródłowym. Wymagana powtórna kompilacja modułu.
- dodałem zmienną na początku programu, w której w prosty sposób można zdefiniować nazwę monitorowanego napędu.
- zmieniłem sposób monitorowania w pliku konfiguracyjnym monitrc. Obecnie odpowiedni monit na maila jest wysyłany, gdy kod zwróci wartość różną od 0 (gdy temperatura przekroczy maksymalną lub z jakiegoś powodu wystąpił błąd)
Test obciążeniowy
% time seconds usecs/call calls errors syscall
0.00 0.000000 0 1 fcntl
0.00 0.000000 0 1 1 faccessat
0.00 0.000000 0 5 openat
0.00 0.000000 0 7 close
0.00 0.000000 0 1 pipe2
0.00 0.000000 0 9 read
0.00 0.000000 0 1 write
0.00 0.000000 0 7 newfstatat
0.00 0.000000 0 1 set_tid_address
0.00 0.000000 0 1 futex
0.00 0.000000 0 1 set_robust_list
0.00 0.000000 0 2 rt_sigprocmask
0.00 0.000000 0 3 brk
0.00 0.000000 0 9 munmap
0.00 0.000000 0 1 clone
0.00 0.000000 0 1 execve
0.00 0.000000 0 17 mmap
0.00 0.000000 0 10 mprotect
0.00 0.000000 0 1 wait4
0.00 0.000000 0 3 prlimit64
0.00 0.000000 0 1 getrandom
0.00 0.000000 0 1 rseq100.00 0.000000 0 84 1 total
Moduł kontroluje temperaturę dysku twardego. Jest to bardzo ważny parametr w przypadku dysków NVMe, dla których zbyt wysoka temperatura prowadzi do ich zbyt wczesnego zużycia.
Moduł po przekroczeniu ustalonej temperatury, wysyła odpowiedni alert na adres email.
Paczka do pobrania hdtemp_v1.3
Module Setup
1. Extract the package to /etc/monit/custommodules/. If the custommodules directory does not exist, create it.
2. Modify the settings in the config.cpp file if needed.
3. Run the autogen.sh script. This will create the executable file for the module.
4. Add the following entry to the /etc/monit/monitrc file:
# hdtemp
check program nvme_temperature with path "/etc/monit/custommodules/hdtemp/hdtemp"
every 5 cycles
if status !=0 then alert
group health
5. Reload Monit with the command:
$ systemctl reload monit
Module Update
1. Replace the module files with the newer version.
2. Run the autogen.sh script.
3. Reload Monit with the command:
$ systemctl reload monit
Uruchomienie modułu
1. Rozpakuj paczkę do /etc/monit/custrommodules/ Jeśli nie masz katalogu custommodules, utwórz go
2. Zmień ustawienia w pliku config.cpp jeśli masz taką potrzebę
3. Uruchom plik autogen.sh. Spowoduje to utworzenie pliku wykonywalnego modułu
4. Dodaj do pliku /etc/monit/monitrc poniższy wpis:
# hdtemp
check program nvme_temperature with path "/etc/monit/custommodules/hdtemp/hdtemp"
every 5 cycles
if status !=0 then alert
group health
5. przeładuj monit poleceniem:
$ systemctl reload monit
Aktualizacja modułu
1. Zastąp pliki modułu, jego nowszą wersją
2. Uruchom plik autogen.sh
3. przeładuj monit poleceniem:
$ systemctl reload monit
-- chanelog --
v1.3
- I added the option to display messages in English
- Dodałem możliwość wyświetlenia komunikatów po angielsku
v1.2
- I improved the code readability.
- I enhanced the display of disk temperature information and added a message for when the disk reaches or exceeds the maximum temperature.
- I added the ability to define the disk's maximum temperature (default is set to 40 degrees Celsius), upon reaching or exceeding which an alert is sent.
- I introduced a logging mode that records information about incidents of reaching the maximum temperature along with the incident's timestamp. The log can be disabled in the source code file, requiring the module to be recompiled.
- I added a variable at the beginning of the program, allowing the monitored drive's name to be easily defined.
- I modified the monitoring method in the
monitrc
configuration file. Now, an appropriate email alert is sent when the code returns a non-zero value (either when the temperature exceeds the maximum or if an error occurs for any reason).
- poprawiłem czytelność kodu
- poprawiłem wyświetlanie informacji o temperaturze dysku. Dodałem odpowiedni komunikat, gdy dysk osiągnie lub przekroczy temperaturę maksymalną.
- dodałem możliwość zdefiniowania temperatury maksymalnej dysku (standardowo ustawiłem 40 stopni celcjusza), po której osiągnięciu lub przekroczeniu wysyłany jest alert.
- dodałem tryb dziennika, w którym zapisywana jest informacja o incydencie osiągnięcia maksymalnej temperatury wraz z datą wystąpienia incydentu. Dziennik można wyłączyć w pliku z kodem źródłowym. Wymagana powtórna kompilacja modułu.
- dodałem zmienną na początku programu, w której w prosty sposób można zdefiniować nazwę monitorowanego napędu.
- zmieniłem sposób monitorowania w pliku konfiguracyjnym monitrc. Obecnie odpowiedni monit na maila jest wysyłany, gdy kod zwróci wartość różną od 0 (gdy temperatura przekroczy maksymalną lub z jakiegoś powodu wystąpił błąd)
Test obciążeniowy
% time seconds usecs/call calls errors syscall
0.00 0.000000 0 1 fcntl
0.00 0.000000 0 1 1 faccessat
0.00 0.000000 0 5 openat
0.00 0.000000 0 7 close
0.00 0.000000 0 1 pipe2
0.00 0.000000 0 9 read
0.00 0.000000 0 1 write
0.00 0.000000 0 7 newfstatat
0.00 0.000000 0 1 set_tid_address
0.00 0.000000 0 1 futex
0.00 0.000000 0 1 set_robust_list
0.00 0.000000 0 2 rt_sigprocmask
0.00 0.000000 0 3 brk
0.00 0.000000 0 9 munmap
0.00 0.000000 0 1 clone
0.00 0.000000 0 1 execve
0.00 0.000000 0 17 mmap
0.00 0.000000 0 10 mprotect
0.00 0.000000 0 1 wait4
0.00 0.000000 0 3 prlimit64
0.00 0.000000 0 1 getrandom
0.00 0.000000 0 1 rseq
100.00 0.000000 0 84 1 total