picputemp - temperatura procesora

Cytat z gielo data 2024-11-01, 16:07Moduł monitoruje temperaturę procesora (cpu) serwera. Po przekroczeniu ustalonej wartości wysyła odpowiednią informację na maila.
Paczka do pobrania picputemp_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 script. This will create the executable file for the module.
4. Add the following entry to the /etc/monit/monitrc file:# picputemp
check program cpu_temperature with path "/etc/monit/custommodules/picputemp/picputemp"
with timeout 5 seconds
if status != 0 then alert5. Reload Monit with the command:
$ systemctl reload monitModule Update
1. Replace the module files with the newer version.
2. Run the autogen 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. Spowoduje to utworzenie pliku wykonywalnego modułu
4. Dodaj do pliku /etc/monit/monitrc poniższy wpis:# picputemp
check program cpu_temperature with path "/etc/monit/custommodules/picputemp/picputemp"
with timeout 5 seconds
if status != 0 then alert5. przeładuj monit poleceniem:
$ systemctl reload monitAktualizacja modułu
1. Zastąp pliki modułu, jego nowszą wersją
2. Uruchom plik autogen
3. przeładuj monit poleceniem:
$ systemctl reload monit-- chanelog --
v1.3
- I added the ability to define and display messages in English.
- I shortened, optimized, and improved the readability of the code.
- Dodałem możliwość zdefiniowania i wyświetlenia komunikatów w j. angielskim.
- Skróciłem, zoptymalizowałem i poprawiłem czytelności kodu.
v1.2
- I added a date to the journal entries; without it, they were not very useful. :]
- dodałem datę do wpisów dziennika, bez niej były one mało użyteczne :]
v1.1
- I improved the readability of the source code and added a journal file where information about exceeding the allowable CPU temperature is logged. The journal can be disabled in the module's config.cpp file. You can also define the maximum. allowable CPU temperature there. By default, the journal is enabled, and the maximum CPU temperature is set to 70 degrees.
- poprawiłem czytelność kodu źródłowego oraz dodałem plik dziennika,.
do którego wpisywane są informacje o przekroczeniu dopuszczalnej temperatury cpu. Dziennik można wyłączyć w pliku config.cpp modułu. Można tam też zdefiniować wartość maksymalną dla temperatury cpu. Domyślnie plik dziennika jest włączony, a wartość maksymalna dla temperatury cpu, jest ustawiona na 70 stopni.Uwaga: Moduł skutecznie monitoruje temperaturę procesora. Zbyt niska wartość ustawiona w pliku z kodem źródłowym, może skutkować nadmiernym rozdęciem pliku dziennika. Należy więc dostosować tą wartość jak najdokładniej (najczęściej będzie to 70-80 stopni w zależności od procesora). Można także dodać odpowiedni wpis do crona, aby np. raz na tydzień kompresował nam plik dziennika. Moduł sam utworzy odpowiedni plik w przypadku jego braku po takiej kompresji.
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 6 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 81 1 total
Moduł monitoruje temperaturę procesora (cpu) serwera. Po przekroczeniu ustalonej wartości wysyła odpowiednią informację na maila.
Paczka do pobrania picputemp_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 script. This will create the executable file for the module.
4. Add the following entry to the /etc/monit/monitrc file:
# picputemp
check program cpu_temperature with path "/etc/monit/custommodules/picputemp/picputemp"
with timeout 5 seconds
if status != 0 then alert
5. Reload Monit with the command:
$ systemctl reload monit
Module Update
1. Replace the module files with the newer version.
2. Run the autogen 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. Spowoduje to utworzenie pliku wykonywalnego modułu
4. Dodaj do pliku /etc/monit/monitrc poniższy wpis:
# picputemp
check program cpu_temperature with path "/etc/monit/custommodules/picputemp/picputemp"
with timeout 5 seconds
if status != 0 then alert
5. przeładuj monit poleceniem:
$ systemctl reload monit
Aktualizacja modułu
1. Zastąp pliki modułu, jego nowszą wersją
2. Uruchom plik autogen
3. przeładuj monit poleceniem:
$ systemctl reload monit
-- chanelog --
v1.3
- I added the ability to define and display messages in English.
- I shortened, optimized, and improved the readability of the code.
- Dodałem możliwość zdefiniowania i wyświetlenia komunikatów w j. angielskim.
- Skróciłem, zoptymalizowałem i poprawiłem czytelności kodu.
v1.2
- I added a date to the journal entries; without it, they were not very useful. :]
- dodałem datę do wpisów dziennika, bez niej były one mało użyteczne :]
v1.1
- I improved the readability of the source code and added a journal file where information about exceeding the allowable CPU temperature is logged. The journal can be disabled in the module's config.cpp file. You can also define the maximum. allowable CPU temperature there. By default, the journal is enabled, and the maximum CPU temperature is set to 70 degrees.
- poprawiłem czytelność kodu źródłowego oraz dodałem plik dziennika,.
do którego wpisywane są informacje o przekroczeniu dopuszczalnej temperatury cpu. Dziennik można wyłączyć w pliku config.cpp modułu. Można tam też zdefiniować wartość maksymalną dla temperatury cpu. Domyślnie plik dziennika jest włączony, a wartość maksymalna dla temperatury cpu, jest ustawiona na 70 stopni.
Uwaga: Moduł skutecznie monitoruje temperaturę procesora. Zbyt niska wartość ustawiona w pliku z kodem źródłowym, może skutkować nadmiernym rozdęciem pliku dziennika. Należy więc dostosować tą wartość jak najdokładniej (najczęściej będzie to 70-80 stopni w zależności od procesora). Można także dodać odpowiedni wpis do crona, aby np. raz na tydzień kompresował nam plik dziennika. Moduł sam utworzy odpowiedni plik w przypadku jego braku po takiej kompresji.
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 6 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 81 1 total