#Glancesenlinux
Explore tagged Tumblr posts
Text
Instalar y configurar Glances en linux
Instalar y configurar Glances en linux. Si como yo, eres de HTOP; la herramienta de monitoreo Glances te va a encantar. Con una estructura visual similar a HTOP, está aplicaron basada en Python te cautivará. Aprovechándose de las bondades de Python, Glances nos proporciona mucha información del sistema de forma amena y fácilmente comprensible. Procesos de ejecución E / S, memoria, etc. Todo tiene cabida en Glances. Glances no solo permite monitorizar nuestro sistema a través de la terminal, también podemos usarlo en remoto a través de su potente API o incluso en otras interfaces como Grafana o Prometheus. En este artículo, veremos cómo instalar y usar Glances para monitorear sistemas locales y remotos.
Instalar y configurar Glances en linux
Glances viene en los repositorios de la mayoría de distribuciones linux actuales, por ejemplo en Ubuntu y derivados lo puedes instalar con... sudo apt install glances También puedes ejecutar su propio instalador. wget -O- https://bit.ly/glances | bash o curl -L https://bit.ly/glances | bash Una vez instalado ejecuta el siguiente comando para iniciar la herramienta. glances Te mostrara información sobre tu sistema, en un formato similar al de la imagen que tienes a continuación.
Monitorizar linux con Glances Puedes cambiar la visualización con las teclas 1 y 3, con la tecla 2 ocultas el apartado de la izquierda. También puedes filtrar procesos de una forma tan simple como pulsar la tecla enter, y escribir el proceso.
Filtrar procesos en Glances Glances nos ofrece varias opciones con un solo comando, para verlos todos pulsa la techa h.
Opciones de Glances Modo cliente / servidor Para monitorizar un sistema linux en modo remoto debes instalar Glances en los dos sistemas, local y remoto. Una vez instalado en los dos puntos, ejecuta en el sitio remoto el siguiente comando. glances -s En el sistema local... glances -c ip-remota # /tmp/memory.alert warning=70 critical=90 disable=False # Define SWAP thresholds in % # Default values if not defined: 50/70/90 careful=50 warning=70 critical=90 disable=False # Define LOAD thresholds # Value * number of cores # Default values if not defined: 0.7/1.0/5.0 per number of cores # Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages # http://www.linuxjournal.com/article/9001 careful=0.7 warning=1.0 critical=5.0 #log=False disable=False # Default bitrate thresholds in % of the network interface speed # Default values if not defined: 70/80/90 rx_careful=70 rx_warning=80 rx_critical=90 tx_careful=70 tx_warning=80 tx_critical=90 # Define the list of hidden network interfaces (comma-separated regexp) #hide=docker.*,lo # WLAN 0 alias #wlan0_alias=Wireless IF # It is possible to overwrite the bitrate thresholds per interface # WLAN 0 Default limits (in bits per second aka bps) for interface bitrate #wlan0_rx_careful=4000000 #wlan0_rx_warning=5000000 #wlan0_rx_critical=6000000 #wlan0_rx_log=True #wlan0_tx_careful=700000 #wlan0_tx_warning=900000 #wlan0_tx_critical=1000000 #wlan0_tx_log=True # Display additional information about TCP connections # This plugin is disabled by default disable=True # nf_conntrack thresholds in % nf_conntrack_percent_careful=70 nf_conntrack_percent_warning=80 nf_conntrack_percent_critical=90 disable=False # Define the list of hidden wireless network interfaces (comma-separated regexp) hide=lo,docker.* # Define SIGNAL thresholds in db (lower is better...) # Based on: http://serverfault.com/questions/501025/industry-standard-for-minimum-wifi-signal-strength careful=-65 warning=-75 critical=-85 disable=False # Define the list of hidden disks (comma-separated regexp) #hide=sda2,sda5,loop.* hide=loop.*,/dev/loop* # Alias for sda1 #sda1_alias=IntDisk disable=False # Define the list of hidden file system (comma-separated regexp) hide=/boot.*,/snap.* # Define filesystem space thresholds in % # Default values if not defined: 50/70/90 # It is also possible to define per mount point value # Example: /_careful=40 careful=50 warning=70 critical=90 # Allow additional file system types (comma-separated FS type) #allow=zfs disable=False # Define a folder list to monitor # The list is composed of items (list_#nb foo.cpu # => foo.mem # You can also use dynamic values #prefix=`hostname` prefix=localhost # Tags will be added for all measurements #tags=foo:bar,spam:eggs # You can also use dynamic values #tags=system:`uname -s` # Configuration for the --export cassandra option # Also works for the ScyllaDB # https://influxdb.com/ or http://www.scylladb.com/ host=localhost port=9042 protocol_version=3 keyspace=glances replication_factor=2 # If not define, table name is set to host key table=localhost # If not define, username and password will not be used #username=cassandra #password=password # Configuration for the --export opentsdb option # http://opentsdb.net/ host=localhost port=4242 #prefix=glances #tags=foo:bar,spam:eggs # Configuration for the --export statsd option # https://github.com/etsy/statsd host=localhost port=8125 #prefix=glances # Configuration for the --export elasticsearch option # Data are available via the ES RESTful API. ex: URL//cpu/system # https://www.elastic.co host=localhost port=9200 index=glances # Configuration for the --export riemann option # http://riemann.io host=localhost port=5555 # Configuration for the --export rabbitmq option host=localhost port=5672 user=guest password=guest queue=glances_queue # Configuration for the --export mqtt option host=localhost port=8883 user=guest password=guest topic=glances tls=true # Configuration for the --export couchdb option # https://www.couchdb.org host=localhost port=5984 db=glances # user and password are optional (comment if not configured on the server side) #user=root #password=root # Configuration for the --export kafka option # http://kafka.apache.org/ host=localhost port=9092 topic=glances #compression=gzip # Configuration for the --export zeromq option # http://www.zeromq.org # Use * to bind on all interfaces host=* port=5678 # Glances envelopes the stats in a publish message with two frames: # - First frame containing the following prefix (STRING) # - Second frame with the Glances plugin name (STRING) # - Third frame with the Glances plugin stats (JSON) prefix=G # Configuration for the --export prometheus option # https://prometheus.io # Create a Prometheus exporter listening on localhost:9091 (default configuration) # Metric are exporter using the following name: # __{labelkey:labelvalue} # Note: You should add this exporter to your Prometheus server configuration: # scrape_configs: # - job_name: 'glances_exporter' # scrape_interval: 5s # static_configs: # - targets: # # Labels will be added for all measurements (default is src:glances) # labels=foo:bar,spam:eggs # You can also use dynamic values # labels=system:`uname -s` # host=localhost port=9091 #prefix=glances labels=src:glances # Configuration for the --export RESTful option # Example, export to http://localhost:6789/ host=localhost port=6789 protocol=http path=/ ############################################################################## # AMPS # * enable: Enable (true) or disable (false) the AMP # * regex: Regular expression to filter the process(es) # * refresh: The AMP is executed every refresh seconds # * one_line: (optional) Force (if true) the AMP to be displayed in one line # * command: (optional) command to execute when the process is detected (thk to the regex) # * countmin: (optional) minimal number of processes # A warning will be displayed if number of process # * countmax: (optional) maximum number of processes # A warning will be displayed if number of process > count # * : Others variables can be defined and used in the AMP script ############################################################################## # Use the default AMP (no dedicated AMP Python script) # Check if the Dropbox daemon is running # Every 3 seconds, display the 'dropbox status' command line enable=false regex=.*dropbox.* refresh=3 one_line=false command=dropbox status countmin=1 # Use the default AMP (no dedicated AMP Python script) # Monitor all the Python scripts # Alert if more than 20 Python scripts are running enable=false regex=.*python.* refresh=3 countmax=20 # Use comma separated for multiple commands (no space around the comma) enable=false regex=\/sbin\/init refresh=30 one_line=false command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max # Use the NGinx AMP # Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/) enable=false regex=\/usr\/sbin\/nginx refresh=60 one_line=false status_url=http://localhost/nginx_status # Use the Systemd AMP enable=false regex=\/lib\/systemd\/systemd refresh=30 one_line=true systemctl_cmd=/bin/systemctl --plain # Use the Systemv AMP enable=false regex=\/sbin\/init refresh=30 one_line=true service_cmd=/usr/bin/service --status-all Conclusión final Glances nos ofrece más características y una mejor interfaz htop. Sin embargo, consume más recursos. Su punto fuerte es el montón de opciones que nos ofrece, y en excelente manual que puedes consultar aquí. Canales de Telegram: Canal SoloLinux – Canal SoloWordpress Espero que este articulo te sea de utilidad, puedes ayudarnos a mantener el servidor con una donación (paypal), o también colaborar con el simple gesto de compartir nuestros artículos en tu sitio web, blog, foro o redes sociales. Read the full article
#configurarGlances#glances#Glancesenlinux#glances.conf#grafana#htop#instalarGlances#monitoreoGlances#Monitorizarlinux#Prometheus#Python
0 notes