Glances는 시스템 모니터링을 위한 오픈소스 어플리케이션으로,
최신 버젼은 파이썬으로 만들어져 있다.
https://glances.readthedocs.io/en/latest/quickstart.html#web-server-mode
Linux에서는 apt install이 가능하지만, 예전버젼이 깔리므로 클라이언트와 버젼이 맞지 않으면 통신이 불가하다.
따라서 최신버젼은 pip 인스톨을 추천하고 있다.
최신 버젼의 리눅스에서는 파이썬 어플리케이션이 리눅스 시스템 디렉토리를 건드리는 것을 싫어 하므로 가상환경에서 실행하도록 강제하고 있다. 이게 싫다면 다음의 방법으로 설치하도록 하자.
sudo apt-get update
sudo apt-get install pipx
pipx install glances
glances
추가로 모듈도 설치해야 되는데, 아래와 같이 두가지를 추가
pipx inject glances fastapi uvicorn
pipx inject glances jinja2
실행화일은 ~/.local/bin/ 에 설치된다.
만약, 패스가 안잡혀서 에러가 난다면, 아래와 같이.
pipx ensurepath
source ~/.profile
glances
클리이언트 MAC에서는 brew를 사용하여 인스톨 한다.
이제 서버쪽에서 glance를 띄우는 것은 (http)
server$ glances -w
클라이언트 쪽에서는 아래와 같이 받는다.
http://@server:61208
http://@server:61208/10
참고로 glances는 SSH 정보를 포트 61209로 보낸다.
Glances에서, 실행환경 변경은 Configuration file을 조정할 수 있다. template가 제공되는데 보통 여기에 있다.
~/.local/share/pipx/venvs/glances/share/doc/glances/glances.conf
이걸 시스템 전체에 적용시키려면 복사를 해서
sudo cp ~/.local/share/pipx/venvs/glances/share/doc/glances/glances.conf \
/etc/glances/glances.conf
이 부분을 건드려 주면 된다.
[percpu]
# Define the maximum number of CPU display at a time
# If the number of CPU is higher than:
# - display the top 'max_cpu_display' (sorted by CPU consumption)
# - a last line will be added with the sum of all other CPUs
max_cpu_display=4
'Ubuntu' 카테고리의 다른 글
우분투에서 컴파일러, 실행파일 등의 여러 버전관리 방법 (0) | 2025.02.16 |
---|---|
클립보드 복사용 VIM (0) | 2025.02.05 |
Directories - 1 (0) | 2025.01.16 |
Directories 2 (0) | 2025.01.16 |
ldconfig (0) | 2024.12.13 |