In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to build the operating system security monitoring platform Glances, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Glances is a cross-platform security monitoring tool that can help researchers complete large-scale data monitoring through a curse or Web interface, all of which are dynamically adapted according to the user interface.
It can also run in client / server mode, and remote monitoring can be realized through terminal, Web interface or API (XML-RPC and RESTful). In addition, data can be exported to a file or to an external database.
Glances is developed in Python and uses external libraries to collect data from the target system. The tool is implemented based on open source architecture, and developers can add new plug-ins or export modules according to their own needs.
Tool requirements
1. Python 2.7, > = 3.4
2. Psutil > = 5.3.0
Optional dependency
Bernhard (Riemann Export Module)
Bottle (Web server mode)
Cassandra-driver (Cassandra Export Module)
Couchdb (CouchDB Export Module)
Docker (Docker Monitoring support) [Linux/macOS-only]
Elasticsearch (Elastic search Export Module)
Hddtemp (HDD temperature monitoring support) [Linux-only]
Influxdb (InfluxDB Export Module)
Kafka-python (Kafka Export Module)
Netifaces (IP plug-in)
Nvidia-ml-py3 (GPU plug-in)
Pika (RabbitMQ/ActiveMQ Export Module)
Potsdb (OpenTSDB Export Module)
Prometheus_client (Prometheus Export Module)
Py-cpuinfo (Quicklook CPU Information Module)
Pygal (graph Export Module)
Pymdstat (RAID support) [Linux-only]
PySMART.smartx (HDD Smart support) [Linux-only]
Pysnmp (SNMP support)
Pystache (scripting function)
Pyzmq (ZeroMQ Export Module)
Requests (Ports, Cloud plug-in and RESTful export module)
Scandir (Folders plug-in) [Python < 3.5]
Statsd (StatsD Export Module)
Wifi (wifi plug-in) [Linux-only]
Zeroconf (Auto Discovery Mode)
Tool installation Glances automatic installation script
To install dependent components and the latest version of the Glances product, run the following command:
Curl-L https://bit.ly/glances | / bin/bash
Or
Wget-O-https://bit.ly/glances | / bin/bashPyPI installation method
Glances is currently hosted on PyPI, and we can use PyPI to install the latest stable version:
Pip install glances
If you need to use optional features, we need to install the following libraries (such as Web interface and export module, etc.):
Pip install 'glances [action,browser,cloud,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]'
Update Glances to the latest version:
Pip install-- upgrade glancespip install-- upgrade glances [...]
If you need to install Glances in a specific path, run the following command:
Export PYTHONUSERBASE=~/mylocalpathpip install-user glancesDocker installation
Glances provides the Docker container, which contains the latest version of the development version of HEAD, which we can use to monitor servers or other containers.
Get the Glances container:
Docker pull nicolargo/glances
Run the container in console mode:
Docker run-- rm-v / var/run/docker.sock:/var/run/docker.sock:ro-- pid host-- network host-it docker.io/nicolargo/glances
In addition, if you want to use your own glances.conf file, you need to create your own Docker file:
FROM nicolargo/glancesCOPY glances.conf / glances/conf/glances.confCMD python-m glances-C / glances/conf/glances.conf $GLANCES_OPT
Of course, you can also add the running parameters of Docker to the same command:
Docker run-v `pwd` / glances.conf:/glances/conf/glances.conf-v / var/run/docker.sock:/var/run/docker.sock:ro-- pid host-it docker.io/nicolargo/glances
Run the container in Web server mode:
Docker run-d-- restart= "always"-p 61208-61209 GLANCES_OPT= 61208-61209-e GLANCES_OPT= "- w"-v / var/run/docker.sock:/var/run/docker.sock:ro-- pid host docker.io/nicolargo/glancesFreeBSD
Install the source package:
# pkg install py27-glances
Port installation:
# cd / usr/ports/sysutils/py-glances/# make install cleanmacOS installation
If you do not need to use the glances automatic installation script, please follow these installation steps. MacOS users can use Homebrew or MacPorts to install Glances:
Homebrew$ brew install glancesMacPorts$ sudo port install glancesWindows installation
Install Python on the Windows platform and run the following command:
$pip install glances
Or use the following command to clone the project locally:
$git clone https://github.com/nicolargo/glances.git$ cd glances$ python setup.py installAndroid
Open Termux on the device and run the following command:
$apt update$ apt upgrade$ apt install clang python python-dev$ pip install bottle$ pip install glances
Enable Glances:
$glances source code installation $wget https://github.com/nicolargo/glances/archive/vX.Y.tar.gz-O-| use of the tar xz$ cd glances-*# python setup.py install tool
Single mode operation:
$glances
Web server mode runs:
$glances-w http://:61208
Run in client mode:
$glances-s
Server mode operation:
$glances-c
Detect and view all Glances servers:
$glances-browser
We can also view the raw stats data:
$glances-- stdout cpu.user,mem.used,loadcpu.user: 30.7mem.used: 3278204928load: {'cpucore': 4,' min1': 0.21, 'min5': 0.4,' min15': 0.27} cpu.user: 3.4mem.used: 3275251712load: {'cpucore': 4,' min1': 0.19, 'min5': 0.39,' min15': 0.27}.
Export data in CSV format:
$glances-- stdout-csv now,cpu.user,mem.used,loadnow,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min152018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.042018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04... The above content is how to build the operating system security monitoring platform Glances. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.