From 021ac4cea906977b448af2e3ff861715ee0892c2 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 20 Mar 2022 09:13:02 +0100 Subject: [PATCH 01/16] Format code thanks to Black --- Makefile | 4 ++-- glances/__init__.py | 16 +++++++------- glances/client.py | 2 +- glances/compat.py | 1 - glances/main.py | 18 ++++----------- glances/outputs/glances_curses.py | 22 +++++++++---------- glances/outputs/glances_stdout_apidoc.py | 1 - glances/outputs/glances_unicode.py | 1 + glances/plugins/glances_docker.py | 4 +++- glances/plugins/glances_help.py | 9 +++++--- glances/plugins/glances_processlist.py | 12 +++++----- glances/plugins/sensors/glances_batpercent.py | 4 ++-- glances/programs.py | 4 +++- 13 files changed, 45 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 1f3dab03..442c56e6 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,10 @@ test: venv ./venv/bin/python ./unitest.py ./venv/bin/python ./unitest-restful.py ./venv/bin/python ./unitest-xmlrpc.py - ./venv/bin/python -m black ./glances --check + ./venv/bin/python -m black ./glances --check --exclude outputs/static format: venv - ./venv/bin/python -m black ./glances + ./venv/bin/python -m black ./glances --exclude outputs/static docs: venv-dev ./venv/bin/python -m glances -C ./conf/glances.conf --api-doc > ./docs/api.rst diff --git a/glances/__init__.py b/glances/__init__.py index b0051a2b..569447bb 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -69,6 +69,7 @@ if psutil_version_info < psutil_min_version: if PY3: import tracemalloc + def __signal_handler(signal, frame): """Callback for CTRL-C.""" end() @@ -85,8 +86,6 @@ def end(): logger.info("Glances stopped (key pressed: CTRL-C)") - - # The end... sys.exit(0) @@ -121,12 +120,14 @@ def start(config, args): # Start the main loop logger.debug("Glances started in {} seconds".format(start_duration.get())) if args.stop_after: - logger.info('Glances will be stopped in ~{} seconds'.format( - args.stop_after * args.time * args.memory_leak * 2)) + logger.info('Glances will be stopped in ~{} seconds'.format(args.stop_after * args.time * args.memory_leak * 2)) if args.memory_leak: - print('Memory leak detection, please wait ~{} seconds...'.format( - args.stop_after * args.time * args.memory_leak * 2)) + print( + 'Memory leak detection, please wait ~{} seconds...'.format( + args.stop_after * args.time * args.memory_leak * 2 + ) + ) # First run without dump to fill the memory mode.serve_n(args.stop_after) # Then start the memory-leak loop @@ -143,8 +144,7 @@ def start(config, args): snapshot_end = tracemalloc.take_snapshot() snapshot_diff = snapshot_end.compare_to(snapshot_begin, 'filename') memory_leak = sum([s.size_diff for s in snapshot_diff]) - print("Memory comsumption: {0:.1f}KB (see log for details)".format( - memory_leak / 1000)) + print("Memory comsumption: {0:.1f}KB (see log for details)".format(memory_leak / 1000)) logger.info("Memory consumption (top 5):") for stat in snapshot_diff[:5]: logger.info(stat) diff --git a/glances/client.py b/glances/client.py index bb804b4b..c70fe06d 100644 --- a/glances/client.py +++ b/glances/client.py @@ -269,7 +269,7 @@ class GlancesClient(object): self.stats, duration=adapted_refresh, cs_status=cs_status, - return_to_browser=self.return_to_browser + return_to_browser=self.return_to_browser, ) else: # In quiet mode, we only wait adapated_refresh seconds diff --git a/glances/compat.py b/glances/compat.py index a1822c02..8adf68c7 100644 --- a/glances/compat.py +++ b/glances/compat.py @@ -129,7 +129,6 @@ if PY3: res = '' return res.rstrip() - else: from future.utils import bytes_to_native_str as n import Queue as queue diff --git a/glances/main.py b/glances/main.py index 2f71b9cd..5b8d63a9 100644 --- a/glances/main.py +++ b/glances/main.py @@ -123,16 +123,10 @@ Examples of use: help='display modules (plugins & exports) list and exit', ) parser.add_argument( - '--disable-plugin', - '--disable-plugins', - dest='disable_plugin', - help='disable plugin (comma separed list)' + '--disable-plugin', '--disable-plugins', dest='disable_plugin', help='disable plugin (comma separed list)' ) parser.add_argument( - '--enable-plugin', - '--enable-plugins', - dest='enable_plugin', - help='enable plugin (comma separed list)' + '--enable-plugin', '--enable-plugins', dest='enable_plugin', help='enable plugin (comma separed list)' ) parser.add_argument( '--disable-process', @@ -225,11 +219,7 @@ Examples of use: help='disable background colors in the terminal', ) parser.add_argument( - '--enable-irq', - action='store_true', - default=False, - dest='enable_irq', - help='enable IRQ module' + '--enable-irq', action='store_true', default=False, dest='enable_irq', help='enable IRQ module' ), parser.add_argument( '--enable-process-extended', @@ -244,7 +234,7 @@ Examples of use: action='store_true', default=False, dest='enable_separator', - help='enable separator in the UI' + help='enable separator in the UI', ), # Sort processes list parser.add_argument( diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index 092c6968..2afc9151 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -542,10 +542,13 @@ class _GlancesCurses(object): self.new_line() self.line -= 1 line_width = self.term_window.getmaxyx()[1] - self.column - self.term_window.addnstr(self.line, self.column, - unicode_message('MEDIUM_LINE', self.args) * line_width, - line_width, - self.colors_list[color]) + self.term_window.addnstr( + self.line, + self.column, + unicode_message('MEDIUM_LINE', self.args) * line_width, + line_width, + self.colors_list[color], + ) def __get_stat_display(self, stats, layer): """Return a dict of dict with all the stats display. @@ -721,7 +724,7 @@ class _GlancesCurses(object): confirm = self.display_popup( 'Kill process: {} (pid: {}) ?\n\nConfirm ([y]es/[n]o): '.format( process['name'], - ', '.join(map(str,pid_to_kill)), + ', '.join(map(str, pid_to_kill)), ), popup_type='yesno', ) @@ -733,11 +736,7 @@ class _GlancesCurses(object): except Exception as e: logger.error('Can not kill process {} ({})'.format(pid, e)) else: - logger.info( - 'Kill signal has been sent to process {} (return code: {})'.format( - pid, ret_kill - ) - ) + logger.info('Kill signal has been sent to process {} (return code: {})'.format(pid, ret_kill)) def __display_header(self, stat_display): """Display the firsts lines (header) in the Curses interface. @@ -759,8 +758,7 @@ class _GlancesCurses(object): self.display_plugin(stat_display["ip"]) self.new_column() self.display_plugin( - stat_display["uptime"], - add_space=-(self.get_stats_display_width(stat_display["cloud"]) != 0) + stat_display["uptime"], add_space=-(self.get_stats_display_width(stat_display["cloud"]) != 0) ) self.init_column() if self.get_stats_display_width(stat_display["cloud"]) != 0: diff --git a/glances/outputs/glances_stdout_apidoc.py b/glances/outputs/glances_stdout_apidoc.py index 77873fbb..b8ccd8d6 100644 --- a/glances/outputs/glances_stdout_apidoc.py +++ b/glances/outputs/glances_stdout_apidoc.py @@ -68,7 +68,6 @@ def print_api_status(): print('') - def print_plugins_list(stat): sub_title = 'GET plugins list' print(sub_title) diff --git a/glances/outputs/glances_unicode.py b/glances/outputs/glances_unicode.py index 89ba896a..f018ae2b 100644 --- a/glances/outputs/glances_unicode.py +++ b/glances/outputs/glances_unicode.py @@ -30,6 +30,7 @@ _unicode_message = { 'LOW_LINE': [u'\u2581', u'_'], } + def unicode_message(key, args=None): """Return the unicode message for the given key.""" if args and hasattr(args, 'disable_unicode') and args.disable_unicode: diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index 5c55ae26..cab23065 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -292,7 +292,9 @@ class Plugin(GlancesPlugin): container_stats['network_rx'] = container_stats['network'].get('rx', None) container_stats['network_tx'] = container_stats['network'].get('tx', None) # Uptime - container_stats['Uptime'] = pretty_date(parser.parse(container.attrs['State']['StartedAt']).replace(tzinfo=None)) + container_stats['Uptime'] = pretty_date( + parser.parse(container.attrs['State']['StartedAt']).replace(tzinfo=None) + ) else: container_stats['cpu'] = {} container_stats['cpu_percent'] = None diff --git a/glances/plugins/glances_help.py b/glances/plugins/glances_help.py index 7cb66f2e..7a02f2d6 100644 --- a/glances/plugins/glances_help.py +++ b/glances/plugins/glances_help.py @@ -101,7 +101,9 @@ class Plugin(GlancesPlugin): self.view_data['enable_disable_gpu'] = msg_col.format('G', 'Enable/disable gpu plugin') self.view_data['enable_disable_mean_gpu'] = msg_col2.format('6', 'Enable/disable mean gpu') self.view_data['edit_pattern_filter'] = 'ENTER: Edit the process filter pattern' - self.view_data['enable_disable_application_monitor_process'] = msg_col2.format('A','Enable/disable application monitoring process' ) + self.view_data['enable_disable_application_monitor_process'] = msg_col2.format( + 'A', 'Enable/disable application monitoring process' + ) self.view_data['erase_current_process_filter'] = msg_col.format('E', 'Erase current process filter') self.view_data['show_hide_tcp_connection'] = msg_col.format('K', 'Show/hide TCP connections') self.view_data['kill_process'] = msg_col2.format('k', 'Kill process') @@ -109,10 +111,11 @@ class Plugin(GlancesPlugin): self.view_data['show_hide_current_time'] = msg_col2.format('N', 'Show/hide current time') self.view_data['show_hide_raid_plugin'] = msg_col.format('R', 'Show/hide RAID plugin') self.view_data['show_hide_wifi_module'] = msg_col2.format('W', 'Show/hide Wifi module') - self.view_data['enable_disable_all_but_quick_look_and_load_module'] = msg_col2.format('4', 'Enable/disable all but quick look and load module') + self.view_data['enable_disable_all_but_quick_look_and_load_module'] = msg_col2.format( + '4', 'Enable/disable all but quick look and load module' + ) self.view_data['programs'] = msg_col2.format('j', 'Accumulate processes by program') - def get_view_data(self, args=None): """Return the view.""" return self.view_data diff --git a/glances/plugins/glances_processlist.py b/glances/plugins/glances_processlist.py index 29d0602d..71516ef1 100644 --- a/glances/plugins/glances_processlist.py +++ b/glances/plugins/glances_processlist.py @@ -160,7 +160,6 @@ class Plugin(GlancesPlugin): if self.args.programs: stats = processes_to_programs(stats) - elif self.input_method == 'snmp': # No SNMP grab for processes pass @@ -368,8 +367,7 @@ class Plugin(GlancesPlugin): # * display a special character at the beginning of the line # * underline the command name if args.is_standalone: - ret.append(self.curse_add_line(unicode_message('PROCESS_SELECTOR') if selected else ' ', - 'SELECTED')) + ret.append(self.curse_add_line(unicode_message('PROCESS_SELECTOR') if selected else ' ', 'SELECTED')) # CPU ret.append(self._get_process_curses_cpu(p, selected, args)) @@ -382,13 +380,13 @@ class Plugin(GlancesPlugin): # PID if not self.args.programs: # Display processes, so the PID should be displayed - msg = self.layout_stat['pid'].format(p['pid'], - width=self.__max_pid_size()) + msg = self.layout_stat['pid'].format(p['pid'], width=self.__max_pid_size()) else: # Display programs, so the PID should not be displayed # Instead displays the number of childrens - msg = self.layout_stat['pid'].format(len(p['childrens']) if 'childrens' in p else '_', - width=self.__max_pid_size()) + msg = self.layout_stat['pid'].format( + len(p['childrens']) if 'childrens' in p else '_', width=self.__max_pid_size() + ) ret.append(self.curse_add_line(msg)) # USER diff --git a/glances/plugins/sensors/glances_batpercent.py b/glances/plugins/sensors/glances_batpercent.py index 57ccb27a..b378641f 100644 --- a/glances/plugins/sensors/glances_batpercent.py +++ b/glances/plugins/sensors/glances_batpercent.py @@ -123,7 +123,7 @@ class GlancesGrabBat(object): 'label': 'BAT {}'.format(b.path.split('/')[-1]), 'value': b.capacity, 'unit': '%', - 'status': b.status + 'status': b.status, } ) elif psutil_tag and hasattr(self.bat.sensors_battery(), 'percent'): @@ -134,7 +134,7 @@ class GlancesGrabBat(object): 'label': 'Battery', 'value': int(self.bat.sensors_battery().percent), 'unit': '%', - 'status': 'Charging' if self.bat.sensors_battery().power_plugged else 'Discharging' + 'status': 'Charging' if self.bat.sensors_battery().power_plugged else 'Discharging', } ] diff --git a/glances/programs.py b/glances/programs.py index bd818574..c31ef73d 100644 --- a/glances/programs.py +++ b/glances/programs.py @@ -59,7 +59,9 @@ def processes_to_programs(processes): programs_dict[p[key]]['io_counters'] += p['io_counters'] programs_dict[p[key]]['childrens'].append(p['pid']) # If all the subprocess has the same value, display it - programs_dict[p[key]]['username'] = p['username'] if p['username'] == programs_dict[p[key]]['username'] else '_' + programs_dict[p[key]]['username'] = ( + p['username'] if p['username'] == programs_dict[p[key]]['username'] else '_' + ) programs_dict[p[key]]['nice'] = p['nice'] if p['nice'] == programs_dict[p[key]]['nice'] else '_' programs_dict[p[key]]['status'] = p['status'] if p['status'] == programs_dict[p[key]]['status'] else '_' From 99da85906b4cfff5d1cfb9f6c591fbbdde38b2d7 Mon Sep 17 00:00:00 2001 From: RazCrimson <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 27 Mar 2022 02:09:35 +0530 Subject: [PATCH 02/16] fix: `N` key (un)freezing time instead show/hide --- glances/plugins/glances_now.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glances/plugins/glances_now.py b/glances/plugins/glances_now.py index 20ffd9d7..cf094e0e 100644 --- a/glances/plugins/glances_now.py +++ b/glances/plugins/glances_now.py @@ -69,6 +69,9 @@ class Plugin(GlancesPlugin): # Init the return message ret = [] + if not self.stats or self.is_disabled(): + return ret + # Build the string message # 23 is the padding for the process list msg = '{:23}'.format(self.stats) From c74297ef9ffdd1c54e2bc49ff197f902b8ad014d Mon Sep 17 00:00:00 2001 From: RazCrimson <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 27 Mar 2022 02:10:00 +0530 Subject: [PATCH 03/16] add: `N` key description in help menu --- glances/plugins/glances_help.py | 1 + 1 file changed, 1 insertion(+) diff --git a/glances/plugins/glances_help.py b/glances/plugins/glances_help.py index 7a02f2d6..b4db9ca1 100644 --- a/glances/plugins/glances_help.py +++ b/glances/plugins/glances_help.py @@ -83,6 +83,7 @@ class Plugin(GlancesPlugin): self.view_data['show_hide_filesystem'] = msg_col.format('f', 'Show/hide filesystem stats') self.view_data['view_cumulative_network'] = msg_col2.format('U', 'View cumulative network I/O') self.view_data['show_hide_network'] = msg_col.format('n', 'Show/hide network stats') + self.view_data['show_hide_time'] = msg_col.format('N', 'Show/hide current time') self.view_data['show_hide_filesytem_freespace'] = msg_col2.format('F', 'Show filesystem free space') self.view_data['show_hide_sensors'] = msg_col.format('s', 'Show/hide sensors stats') self.view_data['generate_graphs'] = msg_col2.format('g', 'Generate graphs for current history') From 320a1ffcae267ab55b7c5c17882f4b357b8a1525 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 15:41:23 +0200 Subject: [PATCH 04/16] Clear-text logging of sensitive information --- glances/password_list.py | 1 - 1 file changed, 1 deletion(-) diff --git a/glances/password_list.py b/glances/password_list.py index 4f6cbb46..81115dad 100644 --- a/glances/password_list.py +++ b/glances/password_list.py @@ -51,7 +51,6 @@ class GlancesPasswordList(GlancesPassword): # Password list loaded logger.info("%s password(s) loaded from the configuration file" % len(password_dict)) - logger.debug("Password dictionary: %s" % password_dict) return password_dict From 7003028f9ebc4772402d9ce5ec37708d730a595f Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 15:50:39 +0200 Subject: [PATCH 05/16] Amp with pipe do not work #1976 --- docs/aoa/amps.rst | 22 +- docs/api.rst | 974 ++++++++++++++++++++------------------------- docs/man/glances.1 | 2 +- 3 files changed, 462 insertions(+), 536 deletions(-) diff --git a/docs/aoa/amps.rst b/docs/aoa/amps.rst index 5de564ab..f6ead33b 100644 --- a/docs/aoa/amps.rst +++ b/docs/aoa/amps.rst @@ -50,7 +50,7 @@ less than countmin): .. image:: ../_static/amp-python-warning.png If the regex option is not defined, the AMP will be executed every refresh -time and the process count will not be displayed (countmin and countmax will +time and the process count will not be displayed (countmin and countmax will be ignored). For example: @@ -63,6 +63,26 @@ For example: one_line=false command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max +For security reason, pipe is not directly allowed in a AMP command but you create a sheel +script with your command: + +.. code-block:: ini + + $ cat /usr/local/bin/mycommand.sh + #!/bin/sh + ps -aux | wc -l + +and use it in the amps: + +.. code-block:: ini + + [amp_amptest] + enable=true + regex=.* + refresh=15 + one_line=false + command=/usr/local/bin/mycommand.sh + User defined AMP ---------------- diff --git a/docs/api.rst b/docs/api.rst index 6828ab92..cffbe370 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -66,14 +66,14 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/3/alert - [[1647162518.0, + [[1649598627.0, -1, 'WARNING', 'MEM', - 83.56908770208635, - 83.56908770208635, - 83.56908770208635, - 83.56908770208635, + 87.0247252460522, + 87.0247252460522, + 87.0247252460522, + 87.0247252460522, 1, [], '', @@ -93,7 +93,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.21807169914245605}, + 'timer': 0.1502704620361328}, {'count': 0, 'countmax': 20.0, 'countmin': None, @@ -102,7 +102,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.21755433082580566}] + 'timer': 0.15010571479797363}] Get a specific field:: @@ -120,7 +120,7 @@ Get a specific item when field matchs the given value:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.21807169914245605}]} + 'timer': 0.1502704620361328}]} GET core -------- @@ -150,19 +150,19 @@ Get plugin stats:: 'ctx_switches': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 50.1, + 'idle': 56.7, 'interrupts': 0, - 'iowait': 0.2, + 'iowait': 0.0, 'irq': 0.0, - 'nice': 0.0, + 'nice': 0.5, 'soft_interrupts': 0, - 'softirq': 2.1, + 'softirq': 0.0, 'steal': 0.0, 'syscalls': 0, - 'system': 10.5, + 'system': 12.1, 'time_since_update': 1, - 'total': 47.4, - 'user': 37.1} + 'total': 43.9, + 'user': 30.7} Fields descriptions: @@ -184,7 +184,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {'total': 47.4} + {'total': 43.9} GET diskio ---------- @@ -223,41 +223,6 @@ Get a specific item when field matchs the given value:: 'write_bytes': 0, 'write_count': 0}]} -GET docker ----------- - -Get plugin stats:: - - # curl http://localhost:61208/api/3/docker - [{'Command': ['/run.sh'], - 'Id': 'c5db5cb8ee2e24116afba117052906a4fe48332ead4c127c976f5830a29bde8b', - 'Image': ['grafana/grafana:latest'], - 'Names': ['grafana'], - 'Status': 'running', - 'Uptime': '2 hours', - 'cpu_percent': 0.0, - 'io_r': None, - 'io_w': None, - 'key': 'name', - 'memory_usage': 26775552, - 'name': 'grafana', - 'network_rx': None, - 'network_tx': None}, - {'Command': ['/entrypoint.sh', 'telegraf'], - 'Id': '5ccd463cb46e92731f791e5f2ff8f99e892aefe1c1cefedf8b95e4543b157048', - 'Image': ['telegraf:latest'], - 'Names': ['telegraf'], - 'Status': 'running', - 'Uptime': '2 hours', - 'cpu_percent': 0.0, - 'io_r': None, - 'io_w': None, - 'key': 'name', - 'memory_usage': None, - 'name': 'telegraf', - 'network_rx': None, - 'network_tx': None}] - GET fs ------ @@ -265,38 +230,30 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79357321216, + 'free': 79636443136, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', - 'percent': 65.6, + 'percent': 65.5, 'size': 243396149248, - 'used': 151651373056}, - {'device_name': '/dev/loop31', - 'free': 0, - 'fs_type': 'squashfs', - 'key': 'mnt_point', - 'mnt_point': '/media/nicolargo/disk', - 'percent': 100.0, - 'size': 115867648, - 'used': 115867648}] + 'used': 151372251136}] Get a specific field:: # curl http://localhost:61208/api/3/fs/mnt_point - {'mnt_point': ['/', '/media/nicolargo/disk']} + {'mnt_point': ['/']} Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {'/': [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79357321216, + 'free': 79636443136, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', - 'percent': 65.6, + 'percent': 65.5, 'size': 243396149248, - 'used': 151651373056}]} + 'used': 151372251136}]} GET ip ------ @@ -304,16 +261,16 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {'address': '192.168.0.33', + {'address': '192.168.0.49', 'gateway': '192.168.0.254', 'mask': '255.255.255.0', 'mask_cidr': 24, - 'public_address': '91.166.228.228'} + 'public_address': '88.165.169.242'} Get a specific field:: # curl http://localhost:61208/api/3/ip/address - {'address': '192.168.0.33'} + {'address': '192.168.0.49'} GET load -------- @@ -321,7 +278,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {'cpucore': 4, 'min1': 1.09, 'min15': 0.95, 'min5': 0.82} + {'cpucore': 4, 'min1': 0.85, 'min15': 1.7, 'min5': 1.39} Fields descriptions: @@ -333,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {'min1': 1.09} + {'min1': 0.85} GET mem ------- @@ -341,16 +298,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {'active': 5110333440, - 'available': 1289662464, - 'buffers': 140845056, - 'cached': 1429409792, - 'free': 1289662464, - 'inactive': 1382371328, - 'percent': 83.6, - 'shared': 616169472, + {'active': 3496165376, + 'available': 1018429440, + 'buffers': 201367552, + 'cached': 1473327104, + 'free': 1018429440, + 'inactive': 1198579712, + 'percent': 87.0, + 'shared': 496037888, 'total': 7849000960, - 'used': 6559338496} + 'used': 6830571520} Fields descriptions: @@ -377,13 +334,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {'free': 4778168320, - 'percent': 40.9, - 'sin': 1458257920, - 'sout': 5037838336, + {'free': 7899197440, + 'percent': 2.3, + 'sin': 17911808, + 'sout': 202194944, 'time_since_update': 1, 'total': 8082419712, - 'used': 3304251392} + 'used': 183222272} Fields descriptions: @@ -407,11 +364,11 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{'alias': None, - 'cumulative_cx': 0, - 'cumulative_rx': 0, - 'cumulative_tx': 0, + 'cumulative_cx': 243100, + 'cumulative_rx': 6357, + 'cumulative_tx': 236743, 'cx': 0, - 'interface_name': 'mpqemubr0', + 'interface_name': 'docker0', 'is_up': False, 'key': 'interface_name', 'rx': 0, @@ -419,15 +376,15 @@ Get plugin stats:: 'time_since_update': 1, 'tx': 0}, {'alias': None, - 'cumulative_cx': 9913133, - 'cumulative_rx': 6761848, - 'cumulative_tx': 3151285, + 'cumulative_cx': 102490, + 'cumulative_rx': 0, + 'cumulative_tx': 102490, 'cx': 0, - 'interface_name': 'veth8c6e5a5', + 'interface_name': 'vboxnet0', 'is_up': True, 'key': 'interface_name', 'rx': 0, - 'speed': 10485760000, + 'speed': 10485760, 'time_since_update': 1, 'tx': 0}] @@ -446,32 +403,30 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/network/interface_name - {'interface_name': ['mpqemubr0', - 'veth8c6e5a5', - 'veth7a2d408', + {'interface_name': ['docker0', + 'vboxnet0', + 'br-87386b77b676', 'lo', 'br-119e6ee04e05', - 'wlp2s0', - 'veth363497d', - 'br-87386b77b676', - 'docker0', - 'br_grafana']} + 'br_grafana', + 'mpqemubr0', + 'wlp2s0']} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/network/interface_name/mpqemubr0 - {'mpqemubr0': [{'alias': None, - 'cumulative_cx': 0, - 'cumulative_rx': 0, - 'cumulative_tx': 0, - 'cx': 0, - 'interface_name': 'mpqemubr0', - 'is_up': False, - 'key': 'interface_name', - 'rx': 0, - 'speed': 0, - 'time_since_update': 1, - 'tx': 0}]} + # curl http://localhost:61208/api/3/network/interface_name/docker0 + {'docker0': [{'alias': None, + 'cumulative_cx': 243100, + 'cumulative_rx': 6357, + 'cumulative_tx': 236743, + 'cx': 0, + 'interface_name': 'docker0', + 'is_up': False, + 'key': 'interface_name', + 'rx': 0, + 'speed': 0, + 'time_since_update': 1, + 'tx': 0}]} GET now ------- @@ -479,7 +434,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - '2022-03-13 10:08:38 CET' + '2022-04-10 15:50:27 CEST' GET percpu ---------- @@ -490,29 +445,29 @@ Get plugin stats:: [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 66.4, + 'idle': 54.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 6.5, - 'total': 33.6, - 'user': 27.1}, + 'system': 6.0, + 'total': 46.0, + 'user': 21.0}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 22.5, + 'idle': 61.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 0.0, + 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 9.0, - 'total': 77.5, - 'user': 68.5}] + 'system': 12.0, + 'total': 39.0, + 'user': 9.0}] Get a specific field:: @@ -531,7 +486,7 @@ Get plugin stats:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.008873, + 'status': 0.006071, 'timeout': 3}] Get a specific field:: @@ -548,7 +503,7 @@ Get a specific item when field matchs the given value:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.008873, + 'status': 0.006071, 'timeout': 3}]} GET processcount @@ -557,12 +512,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {'pid_max': 0, 'running': 1, 'sleeping': 290, 'thread': 1581, 'total': 348} + {'pid_max': 0, 'running': 1, 'sleeping': 260, 'thread': 1307, 'total': 321} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {'total': 348} + {'total': 321} GET processlist --------------- @@ -570,64 +525,41 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{'cmdline': ['/usr/share/code/code', - '--ms-enable-electron-run-as-node', - '--inspect-port=0', - '/usr/share/code/resources/app/out/bootstrap-fork', - '--type=extensionHost', - '--skipWorkspaceStorageLock'], + [{'cmdline': ['/usr/lib/virtualbox/VBoxHeadless', + '--comment', + 'minikube', + '--startvm', + '74869efd-ada3-41eb-98e3-b7d2901c8e39', + '--vrde', + 'config'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=2002.32, system=1061.65, children_user=641.32, children_system=1247.82, iowait=1.97), + 'cpu_times': pcputimes(user=82.82, system=951.49, children_user=0.0, children_system=0.0, iowait=0.0), 'gids': pgids(real=1000, effective=1000, saved=1000), - 'io_counters': [2013077504, 40714240, 0, 0, 0], + 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=609710080, vms=49765212160, shared=21921792, text=125038592, lib=0, data=3049295872, dirty=0), - 'memory_percent': 7.767995992193126, - 'name': 'code', + 'memory_info': pmem(rss=964993024, vms=4202561536, shared=926556160, text=53248, lib=0, data=98004992, dirty=0), + 'memory_percent': 12.29446943525409, + 'name': 'VBoxHeadless', 'nice': 0, - 'num_threads': 14, - 'pid': 224688, - 'ppid': 224567, + 'num_threads': 28, + 'pid': 9872, + 'ppid': 9690, 'status': 'S', 'time_since_update': 1, 'username': 'nicolargo'}, - {'cmdline': ['/usr/share/code/code', - '--type=renderer', - '--disable-color-correct-rendering', - '--field-trial-handle=13126869943429715366,5011544368131150611,131072', - '--disable-features=CookiesWithoutSameSiteMustBeSecure,SameSiteByDefaultCookies,SpareRendererForSitePerProcess', - '--lang=en-US', - '--enable-crash-reporter=7c06f526-63e8-47aa-8c08-b95f6ad2ec2d,no_channel', - '--global-crash-keys=7c06f526-63e8-47aa-8c08-b95f6ad2ec2d,no_channel,_companyName=Microsoft,_productName=VSCode,_version=1.63.2', - '--user-data-dir=/home/nicolargo/.config/Code', - '--standard-schemes=vscode-webview,vscode-file', - '--secure-schemes=vscode-webview,vscode-file', - '--bypasscsp-schemes', - '--cors-schemes=vscode-webview,vscode-file', - '--fetch-schemes=vscode-webview,vscode-file', - '--service-worker-schemes=vscode-webview', - '--streaming-schemes', - '--app-path=/usr/share/code/resources/app', - '--no-sandbox', - '--no-zygote', - '--num-raster-threads=2', - '--enable-main-frame-before-activation', - '--renderer-client-id=5', - '--no-v8-untrusted-code-mitigations', - '--shared-files=v8_context_snapshot_data:100', - '--vscode-window-config=vscode:955bffb8-751b-45c3-a3c6-d5f7e223b9f9'], + {'cmdline': ['/usr/lib/firefox/firefox', '-new-window'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=5910.05, system=517.86, children_user=0.0, children_system=0.0, iowait=5.43), + 'cpu_times': pcputimes(user=520.8, system=165.6, children_user=325.1, children_system=45.16, iowait=1.73), 'gids': pgids(real=1000, effective=1000, saved=1000), - 'io_counters': [669085696, 3588096, 0, 0, 0], + 'io_counters': [701751296, 859406336, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=557174784, vms=54381596672, shared=60043264, text=125038592, lib=0, data=862715904, dirty=0), - 'memory_percent': 7.098671370273345, - 'name': 'code', + 'memory_info': pmem(rss=450969600, vms=4304453632, shared=112594944, text=643072, lib=0, data=817766400, dirty=0), + 'memory_percent': 5.745566885495705, + 'name': 'GeckoMain', 'nice': 0, - 'num_threads': 20, - 'pid': 224633, - 'ppid': 224567, + 'num_threads': 135, + 'pid': 4964, + 'ppid': 3777, 'status': 'S', 'time_since_update': 1, 'username': 'nicolargo'}] @@ -635,201 +567,173 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {'pid': [224688, - 224633, - 221818, - 221861, - 221571, - 221865, - 225097, - 387438, - 3912, - 411872, - 387437, - 585767, - 431380, - 425921, - 224601, - 507794, - 224567, - 522296, - 429894, - 224696, - 587068, - 221653, - 387461, - 406478, - 225045, - 585026, - 223803, - 1863, - 597605, - 586935, - 585163, - 579379, - 585656, - 3729, - 585202, - 1812, - 3754, - 224770, - 368467, - 3674, - 408027, - 296602, - 224733, - 242690, - 224619, - 368421, - 583455, - 2115, - 1261, - 4004, - 4200, - 348, - 3672, - 4748, - 4084, - 1, - 583459, - 222129, - 4058, - 3972, - 1114, - 4925, - 3978, - 221247, - 1155, - 3942, - 583481, - 4077, - 1132, - 583482, - 3947, - 221222, - 4085, - 1239, - 1822, - 3658, - 3684, - 4083, - 1110, - 3302, - 3989, - 223820, - 3677, - 4112, - 585813, - 3707, - 1818, - 221629, - 585176, - 4107, - 1156, - 2063, - 341631, - 4081, - 2025, - 4097, - 3986, - 3898, - 1119, - 3642, - 4104, - 1096, - 224571, - 341616, - 1129, - 1493, - 4076, - 994, - 1150, - 260255, - 585005, - 3954, - 3951, - 224835, - 3779, - 4091, - 3695, - 224572, - 3963, - 4106, - 4157, - 585125, - 4108, - 1104, - 381, - 3752, - 1105, - 260268, - 1147, - 260265, - 4080, - 4020, - 1140, - 3870, - 3746, - 1157, - 597592, - 1121, - 4087, - 3702, - 995, - 4203, - 4231, - 1106, - 1153, - 224971, - 227435, - 221232, - 993, - 301112, - 4164, - 4976, - 1160, - 3310, - 584991, - 4088, - 3892, - 3946, - 1138, - 584954, - 1247, - 3721, - 1108, - 260277, - 3740, + {'pid': [9872, + 4964, + 5235, + 16062, + 5294, + 16229, + 5305, + 15998, + 5894, + 4033, + 17438, + 16038, + 15933, + 15053, + 15966, + 16111, + 18604, + 17492, + 5648, + 17565, + 5060, + 16075, + 16242, + 8850, + 2185, + 15983, 3875, - 1291, - 1255, - 4069, + 14178, + 2410, + 15938, + 15937, + 19004, + 3789, + 2233, + 3846, + 4305, + 1332, + 7066, + 5595, + 5563, + 4119, + 14256, + 5024, + 4193, + 349, + 9690, + 1160, + 4192, + 2380, + 4094, + 3787, + 4187, + 1173, + 4627, + 1315, + 1320, + 2197, + 4088, + 4232, + 14247, + 1, + 4130, + 4191, + 1199, + 4213, + 4167, + 1175, + 3531, + 9684, + 4064, + 2189, + 4308, + 1039, + 14266, + 4062, + 10484, + 4589, + 4019, + 4188, + 1584, + 14265, + 4198, + 4194, + 3777, + 2386, + 3762, + 1326, + 15940, + 3824, + 4105, + 1365, + 4057, + 4276, + 1196, + 1142, + 3900, + 16135, + 3831, + 4203, + 3813, + 1195, + 1158, + 3855, + 1201, + 8860, + 9177, + 3797, + 2384, + 4209, + 4190, + 383, + 4301, + 4179, + 1166, + 4269, + 4068, + 1192, + 3872, + 4229, + 4061, + 4600, + 4079, + 3988, + 2385, + 4102, + 1186, + 4186, + 3791, + 4200, + 3998, + 3817, + 3861, + 3842, + 3536, + 1040, + 4197, + 3836, + 4195, + 1182, + 1202, + 16161, + 1150, + 1168, + 1151, + 1380, + 4083, + 4013, + 4003, + 1038, + 1155, + 1446, + 1230, + 18958, + 3778, + 4546, + 1143, + 19003, 2062, - 2061, - 1368, - 584966, - 4103, - 3883, - 584978, - 3967, - 3725, - 585151, - 1097, - 597604, - 2304, - 3716, - 1835, - 1864, - 1849, - 509862, - 3662, - 2265, - 1164, - 1295, - 3849, - 965, - 224574, - 375, + 2201, + 2112, + 2218, + 2203, + 1235, + 1015, + 377, + 1153, + 3970, 2, 3, 4, @@ -844,15 +748,16 @@ Get a specific field:: 16, 17, 18, - 20, 21, 22, 23, 24, + 26, 27, 28, 29, 30, + 32, 33, 34, 35, @@ -866,12 +771,12 @@ Get a specific field:: 90, 91, 92, + 93, 94, 95, 96, 97, 98, - 99, 102, 103, 105, @@ -879,9 +784,10 @@ Get a specific field:: 108, 110, 119, - 136, - 181, - 190, + 122, + 137, + 188, + 189, 191, 192, 193, @@ -894,126 +800,126 @@ Get a specific field:: 204, 207, 208, - 237, - 257, - 288, - 290, + 238, + 280, + 286, + 289, + 291, + 307, 363, - 365, - 392, + 368, + 388, 396, - 397, + 398, 399, 400, 401, - 468, - 491, - 519, - 724, - 725, - 726, - 727, - 728, - 729, - 730, - 731, - 732, - 733, - 735, - 736, - 832, - 849, - 861, - 863, - 864, - 867, - 876, - 877, - 882, - 887, - 889, - 893, - 897, - 901, - 905, - 908, - 911, + 469, + 495, + 520, + 636, + 766, + 767, + 768, + 769, + 771, + 772, + 773, + 774, + 775, + 776, + 785, + 786, + 881, + 910, + 912, 913, - 918, - 923, - 926, - 931, - 1303, - 1388, - 1390, - 1391, - 1392, - 1393, - 1394, - 1395, - 1396, - 1911, - 1917, - 2069, - 3732, - 4442, - 4619, - 7988, - 22299, - 198660, - 242630, - 243136, - 304416, - 310251, - 353156, - 438092, - 503067, - 516417, - 516662, - 579203, - 579204, - 579241, - 583317, - 583319, - 588492, - 592386, - 594712, - 594934, - 595021, - 595228, - 595330, - 597538]} + 915, + 917, + 922, + 929, + 933, + 935, + 938, + 942, + 945, + 951, + 954, + 956, + 957, + 965, + 969, + 973, + 976, + 978, + 1384, + 1458, + 1459, + 1461, + 1462, + 1464, + 1465, + 1466, + 1467, + 2257, + 2279, + 3847, + 6489, + 6712, + 7008, + 7325, + 7549, + 7739, + 7999, + 9904, + 13281, + 13643, + 13786, + 13855, + 14103, + 14107, + 14128, + 14134, + 14135, + 16158, + 16256, + 16973, + 17132, + 17385, + 18159, + 18550]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/processlist/pid/224688 - {'224688': [{'cmdline': ['/usr/share/code/code', - '--ms-enable-electron-run-as-node', - '--inspect-port=0', - '/usr/share/code/resources/app/out/bootstrap-fork', - '--type=extensionHost', - '--skipWorkspaceStorageLock'], - 'cpu_percent': 0.0, - 'cpu_times': [2002.32, 1061.65, 641.32, 1247.82, 1.97], - 'gids': [1000, 1000, 1000], - 'io_counters': [2013077504, 40714240, 0, 0, 0], - 'key': 'pid', - 'memory_info': [609710080, - 49765212160, - 21921792, - 125038592, - 0, - 3049295872, - 0], - 'memory_percent': 7.767995992193126, - 'name': 'code', - 'nice': 0, - 'num_threads': 14, - 'pid': 224688, - 'ppid': 224567, - 'status': 'S', - 'time_since_update': 1, - 'username': 'nicolargo'}]} + # curl http://localhost:61208/api/3/processlist/pid/9872 + {'9872': [{'cmdline': ['/usr/lib/virtualbox/VBoxHeadless', + '--comment', + 'minikube', + '--startvm', + '74869efd-ada3-41eb-98e3-b7d2901c8e39', + '--vrde', + 'config'], + 'cpu_percent': 0.0, + 'cpu_times': [82.82, 951.49, 0.0, 0.0, 0.0], + 'gids': [1000, 1000, 1000], + 'io_counters': [0, 0, 0, 0, 0], + 'key': 'pid', + 'memory_info': [964993024, + 4202561536, + 926556160, + 53248, + 0, + 98004992, + 0], + 'memory_percent': 12.29446943525409, + 'name': 'VBoxHeadless', + 'nice': 0, + 'num_threads': 28, + 'pid': 9872, + 'ppid': 9690, + 'status': 'S', + 'time_since_update': 1, + 'username': 'nicolargo'}]} GET psutilversion ----------------- @@ -1021,7 +927,7 @@ GET psutilversion Get plugin stats:: # curl http://localhost:61208/api/3/psutilversion - (5, 8, 0) + (5, 9, 0) GET quicklook ------------- @@ -1029,69 +935,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {'cpu': 47.4, + {'cpu': 43.9, 'cpu_hz': 3000000000.0, - 'cpu_hz_current': 2412950500.0, + 'cpu_hz_current': 2582499.9999999995, 'cpu_name': 'Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz', - 'mem': 83.6, + 'mem': 87.0, 'percpu': [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 66.4, + 'idle': 54.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 6.5, - 'total': 33.6, - 'user': 27.1}, + 'system': 6.0, + 'total': 46.0, + 'user': 21.0}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 22.5, + 'idle': 61.0, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 1.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 12.0, + 'total': 39.0, + 'user': 9.0}, + {'cpu_number': 2, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 43.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 9.0, - 'total': 77.5, - 'user': 68.5}, - {'cpu_number': 2, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 54.5, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 3.6, - 'steal': 0.0, - 'system': 2.7, - 'total': 45.5, - 'user': 39.1}, + 'system': 11.0, + 'total': 57.0, + 'user': 27.0}, {'cpu_number': 3, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 67.5, + 'idle': 26.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 6.8, + 'nice': 1.0, + 'softirq': 0.0, 'steal': 0.0, - 'system': 6.8, - 'total': 32.5, - 'user': 18.8}], - 'swap': 40.9} + 'system': 7.0, + 'total': 74.0, + 'user': 49.0}], + 'swap': 2.3} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {'cpu': 47.4} + {'cpu': 43.9} GET sensors ----------- @@ -1162,7 +1068,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - {'seconds': 2655317} + {'seconds': 197853} GET all stats ------------- @@ -1178,33 +1084,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {'system': [['2022-03-13T10:08:38.665608', 10.5], - ['2022-03-13T10:08:39.754416', 10.5], - ['2022-03-13T10:08:40.870300', 4.4]], - 'user': [['2022-03-13T10:08:38.665598', 37.1], - ['2022-03-13T10:08:39.754413', 37.1], - ['2022-03-13T10:08:40.870295', 12.4]]} + {'system': [['2022-04-10T15:50:28.031262', 12.1], + ['2022-04-10T15:50:29.075471', 12.1], + ['2022-04-10T15:50:30.175356', 12.1]], + 'user': [['2022-04-10T15:50:28.031256', 30.7], + ['2022-04-10T15:50:29.075468', 30.7], + ['2022-04-10T15:50:30.175351', 5.8]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {'system': [['2022-03-13T10:08:39.754416', 10.5], - ['2022-03-13T10:08:40.870300', 4.4]], - 'user': [['2022-03-13T10:08:39.754413', 37.1], - ['2022-03-13T10:08:40.870295', 12.4]]} + {'system': [['2022-04-10T15:50:29.075471', 12.1], + ['2022-04-10T15:50:30.175356', 12.1]], + 'user': [['2022-04-10T15:50:29.075468', 30.7], + ['2022-04-10T15:50:30.175351', 5.8]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-03-13T10:08:38.665608', 10.5], - ['2022-03-13T10:08:39.754416', 10.5], - ['2022-03-13T10:08:40.870300', 4.4]]} + {'system': [['2022-04-10T15:50:28.031262', 12.1], + ['2022-04-10T15:50:29.075471', 12.1], + ['2022-04-10T15:50:30.175356', 12.1]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-03-13T10:08:39.754416', 10.5], - ['2022-03-13T10:08:40.870300', 4.4]]} + {'system': [['2022-04-10T15:50:29.075471', 12.1], + ['2022-04-10T15:50:30.175356', 12.1]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 5c6bb674..36da8516 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GLANCES" "1" "Mar 13, 2022" "3.2.5_beta01" "Glances" +.TH "GLANCES" "1" "Apr 10, 2022" "3.2.5_beta01" "Glances" .SH NAME glances \- An eye on your system . From ed85bc43edde70e76e3ea960f0f7a87d8aafd959 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 15:53:22 +0200 Subject: [PATCH 06/16] Glances reports different amounts of used memory than free -m or top #1924 --- docs/aoa/memory.rst | 2 + docs/api.rst | 293 ++++++++++++++++++++++---------------------- 2 files changed, 147 insertions(+), 148 deletions(-) diff --git a/docs/aoa/memory.rst b/docs/aoa/memory.rst index 1df04d06..8d68250a 100644 --- a/docs/aoa/memory.rst +++ b/docs/aoa/memory.rst @@ -18,6 +18,8 @@ Stats description: - **total**: total physical memory available. - **used**: memory used, calculated differently depending on the platform and designed for informational purposes only. + It's compute as following: + used memory = total - free (with free = available + buffers + cached) - **free**: memory not being used at all (zeroed) that is readily available; note that this doesn’t reflect the actual memory available (use ‘available’ instead). diff --git a/docs/api.rst b/docs/api.rst index cffbe370..476b7b72 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -66,14 +66,14 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/3/alert - [[1649598627.0, + [[1649598784.0, -1, 'WARNING', 'MEM', - 87.0247252460522, - 87.0247252460522, - 87.0247252460522, - 87.0247252460522, + 87.7440430839239, + 87.7440430839239, + 87.7440430839239, + 87.7440430839239, 1, [], '', @@ -93,7 +93,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.1502704620361328}, + 'timer': 0.17049384117126465}, {'count': 0, 'countmax': 20.0, 'countmin': None, @@ -102,7 +102,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.15010571479797363}] + 'timer': 0.17037177085876465}] Get a specific field:: @@ -120,7 +120,7 @@ Get a specific item when field matchs the given value:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.1502704620361328}]} + 'timer': 0.17049384117126465}]} GET core -------- @@ -150,19 +150,19 @@ Get plugin stats:: 'ctx_switches': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 56.7, + 'idle': 51.4, 'interrupts': 0, 'iowait': 0.0, 'irq': 0.0, - 'nice': 0.5, + 'nice': 0.9, 'soft_interrupts': 0, - 'softirq': 0.0, + 'softirq': 0.2, 'steal': 0.0, 'syscalls': 0, - 'system': 12.1, + 'system': 14.2, 'time_since_update': 1, - 'total': 43.9, - 'user': 30.7} + 'total': 44.9, + 'user': 33.3} Fields descriptions: @@ -184,7 +184,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {'total': 43.9} + {'total': 44.9} GET diskio ---------- @@ -230,13 +230,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79636443136, + 'free': 79636021248, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151372251136}] + 'used': 151372673024}] Get a specific field:: @@ -247,13 +247,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {'/': [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79636443136, + 'free': 79636021248, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151372251136}]} + 'used': 151372673024}]} GET ip ------ @@ -278,7 +278,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {'cpucore': 4, 'min1': 0.85, 'min15': 1.7, 'min5': 1.39} + {'cpucore': 4, 'min1': 1.74, 'min15': 1.64, 'min5': 1.41} Fields descriptions: @@ -290,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {'min1': 0.85} + {'min1': 1.74} GET mem ------- @@ -298,16 +298,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {'active': 3496165376, - 'available': 1018429440, - 'buffers': 201367552, - 'cached': 1473327104, - 'free': 1018429440, - 'inactive': 1198579712, - 'percent': 87.0, - 'shared': 496037888, + {'active': 3487096832, + 'available': 961970176, + 'buffers': 188796928, + 'cached': 1438552064, + 'free': 961970176, + 'inactive': 1171030016, + 'percent': 87.7, + 'shared': 523972608, 'total': 7849000960, - 'used': 6830571520} + 'used': 6887030784} Fields descriptions: @@ -334,13 +334,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {'free': 7899197440, - 'percent': 2.3, - 'sin': 17911808, - 'sout': 202194944, + {'free': 7891595264, + 'percent': 2.4, + 'sin': 18165760, + 'sout': 209731584, 'time_since_update': 1, 'total': 8082419712, - 'used': 183222272} + 'used': 190824448} Fields descriptions: @@ -376,9 +376,9 @@ Get plugin stats:: 'time_since_update': 1, 'tx': 0}, {'alias': None, - 'cumulative_cx': 102490, + 'cumulative_cx': 111659, 'cumulative_rx': 0, - 'cumulative_tx': 102490, + 'cumulative_tx': 111659, 'cx': 0, 'interface_name': 'vboxnet0', 'is_up': True, @@ -434,7 +434,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - '2022-04-10 15:50:27 CEST' + '2022-04-10 15:53:04 CEST' GET percpu ---------- @@ -445,29 +445,29 @@ Get plugin stats:: [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 54.0, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 6.0, - 'total': 46.0, - 'user': 21.0}, - {'cpu_number': 1, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 61.0, + 'idle': 40.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 12.0, - 'total': 39.0, - 'user': 9.0}] + 'system': 8.0, + 'total': 60.0, + 'user': 46.0}, + {'cpu_number': 1, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 55.0, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 1.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 6.0, + 'total': 45.0, + 'user': 29.0}] Get a specific field:: @@ -486,7 +486,7 @@ Get plugin stats:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.006071, + 'status': 0.007309, 'timeout': 3}] Get a specific field:: @@ -503,7 +503,7 @@ Get a specific item when field matchs the given value:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.006071, + 'status': 0.007309, 'timeout': 3}]} GET processcount @@ -512,12 +512,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {'pid_max': 0, 'running': 1, 'sleeping': 260, 'thread': 1307, 'total': 321} + {'pid_max': 0, 'running': 1, 'sleeping': 260, 'thread': 1303, 'total': 318} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {'total': 321} + {'total': 318} GET processlist --------------- @@ -533,12 +533,12 @@ Get plugin stats:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=82.82, system=951.49, children_user=0.0, children_system=0.0, iowait=0.0), + 'cpu_times': pcputimes(user=88.06, system=1004.53, children_user=0.0, children_system=0.0, iowait=0.0), 'gids': pgids(real=1000, effective=1000, saved=1000), 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=964993024, vms=4202561536, shared=926556160, text=53248, lib=0, data=98004992, dirty=0), - 'memory_percent': 12.29446943525409, + 'memory_info': pmem(rss=964915200, vms=4202561536, shared=926478336, text=53248, lib=0, data=98004992, dirty=0), + 'memory_percent': 12.293477920532704, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -549,15 +549,15 @@ Get plugin stats:: 'username': 'nicolargo'}, {'cmdline': ['/usr/lib/firefox/firefox', '-new-window'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=520.8, system=165.6, children_user=325.1, children_system=45.16, iowait=1.73), + 'cpu_times': pcputimes(user=531.42, system=169.72, children_user=329.51, children_system=45.83, iowait=1.73), 'gids': pgids(real=1000, effective=1000, saved=1000), - 'io_counters': [701751296, 859406336, 0, 0, 0], + 'io_counters': [702185472, 866934784, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=450969600, vms=4304453632, shared=112594944, text=643072, lib=0, data=817766400, dirty=0), - 'memory_percent': 5.745566885495705, + 'memory_info': pmem(rss=469880832, vms=4312092672, shared=119783424, text=643072, lib=0, data=817766400, dirty=0), + 'memory_percent': 5.986504962792106, 'name': 'GeckoMain', 'nice': 0, - 'num_threads': 135, + 'num_threads': 134, 'pid': 4964, 'ppid': 3777, 'status': 'S', @@ -574,17 +574,17 @@ Get a specific field:: 5294, 16229, 5305, - 15998, 5894, + 15998, 4033, - 17438, + 17492, 16038, 15933, 15053, 15966, 16111, 18604, - 17492, + 19240, 5648, 17565, 5060, @@ -598,7 +598,7 @@ Get a specific field:: 2410, 15938, 15937, - 19004, + 19494, 3789, 2233, 3846, @@ -610,46 +610,46 @@ Get a specific field:: 4119, 14256, 5024, - 4193, 349, + 4193, 9690, 1160, - 4192, 2380, 4094, 3787, - 4187, - 1173, + 4192, 4627, + 1173, + 4187, 1315, 1320, 2197, 4088, - 4232, 14247, 1, + 4232, 4130, - 4191, 1199, - 4213, + 4191, 4167, 1175, + 4213, 3531, 9684, 4064, 2189, 4308, - 1039, 14266, + 1039, 4062, 10484, 4589, 4019, + 14265, + 4194, 4188, 1584, - 14265, 4198, - 4194, 3777, 2386, 3762, @@ -659,14 +659,14 @@ Get a specific field:: 4105, 1365, 4057, - 4276, 1196, 1142, 3900, 16135, 3831, - 4203, 3813, + 4203, + 4276, 1195, 1158, 3855, @@ -675,27 +675,26 @@ Get a specific field:: 9177, 3797, 2384, - 4209, 4190, + 4209, 383, - 4301, 4179, 1166, - 4269, 4068, 1192, 3872, - 4229, + 4301, 4061, 4600, 4079, + 4229, 3988, 2385, 4102, + 4269, 1186, 4186, 3791, - 4200, 3998, 3817, 3861, @@ -705,25 +704,26 @@ Get a specific field:: 4197, 3836, 4195, + 4200, 1182, 1202, 16161, 1150, 1168, 1151, - 1380, - 4083, 4013, + 4083, + 1380, 4003, 1038, 1155, 1446, + 19463, 1230, - 18958, 3778, 4546, 1143, - 19003, + 19493, 2062, 2201, 2112, @@ -877,17 +877,14 @@ Get a specific field:: 13786, 13855, 14103, - 14107, 14128, 14134, 14135, 16158, 16256, 16973, - 17132, - 17385, 18159, - 18550]} + 19193]} Get a specific item when field matchs the given value:: @@ -900,18 +897,18 @@ Get a specific item when field matchs the given value:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': [82.82, 951.49, 0.0, 0.0, 0.0], + 'cpu_times': [88.06, 1004.53, 0.0, 0.0, 0.0], 'gids': [1000, 1000, 1000], 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': [964993024, + 'memory_info': [964915200, 4202561536, - 926556160, + 926478336, 53248, 0, 98004992, 0], - 'memory_percent': 12.29446943525409, + 'memory_percent': 12.293477920532704, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -935,69 +932,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {'cpu': 43.9, + {'cpu': 44.9, 'cpu_hz': 3000000000.0, - 'cpu_hz_current': 2582499.9999999995, + 'cpu_hz_current': 2472500.0, 'cpu_name': 'Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz', - 'mem': 87.0, + 'mem': 87.7, 'percpu': [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 54.0, + 'idle': 40.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 0.0, + 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 6.0, - 'total': 46.0, - 'user': 21.0}, + 'system': 8.0, + 'total': 60.0, + 'user': 46.0}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 61.0, + 'idle': 55.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 12.0, - 'total': 39.0, - 'user': 9.0}, + 'system': 6.0, + 'total': 45.0, + 'user': 29.0}, {'cpu_number': 2, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 43.0, + 'idle': 70.0, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 1.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 8.0, + 'total': 30.0, + 'user': 13.0}, + {'cpu_number': 3, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 39.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, - 'softirq': 0.0, + 'softirq': 1.0, 'steal': 0.0, - 'system': 11.0, - 'total': 57.0, - 'user': 27.0}, - {'cpu_number': 3, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 26.0, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 1.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 7.0, - 'total': 74.0, - 'user': 49.0}], - 'swap': 2.3} + 'system': 19.0, + 'total': 61.0, + 'user': 33.0}], + 'swap': 2.4} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {'cpu': 43.9} + {'cpu': 44.9} GET sensors ----------- @@ -1068,7 +1065,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - {'seconds': 197853} + {'seconds': 198010} GET all stats ------------- @@ -1084,33 +1081,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {'system': [['2022-04-10T15:50:28.031262', 12.1], - ['2022-04-10T15:50:29.075471', 12.1], - ['2022-04-10T15:50:30.175356', 12.1]], - 'user': [['2022-04-10T15:50:28.031256', 30.7], - ['2022-04-10T15:50:29.075468', 30.7], - ['2022-04-10T15:50:30.175351', 5.8]]} + {'system': [['2022-04-10T15:53:04.470357', 14.2], + ['2022-04-10T15:53:05.515631', 14.2], + ['2022-04-10T15:53:06.601141', 11.0]], + 'user': [['2022-04-10T15:53:04.470351', 33.3], + ['2022-04-10T15:53:05.515624', 33.3], + ['2022-04-10T15:53:06.601136', 13.3]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {'system': [['2022-04-10T15:50:29.075471', 12.1], - ['2022-04-10T15:50:30.175356', 12.1]], - 'user': [['2022-04-10T15:50:29.075468', 30.7], - ['2022-04-10T15:50:30.175351', 5.8]]} + {'system': [['2022-04-10T15:53:05.515631', 14.2], + ['2022-04-10T15:53:06.601141', 11.0]], + 'user': [['2022-04-10T15:53:05.515624', 33.3], + ['2022-04-10T15:53:06.601136', 13.3]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T15:50:28.031262', 12.1], - ['2022-04-10T15:50:29.075471', 12.1], - ['2022-04-10T15:50:30.175356', 12.1]]} + {'system': [['2022-04-10T15:53:04.470357', 14.2], + ['2022-04-10T15:53:05.515631', 14.2], + ['2022-04-10T15:53:06.601141', 11.0]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T15:50:29.075471', 12.1], - ['2022-04-10T15:50:30.175356', 12.1]]} + {'system': [['2022-04-10T15:53:05.515631', 14.2], + ['2022-04-10T15:53:06.601141', 11.0]]} GET limits (used for thresholds) -------------------------------- From 0d42dd906852f06596865c055ad39d41b6686888 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 16:12:34 +0200 Subject: [PATCH 07/16] Update release note for Glances 3.2.5 --- NEWS.rst | 27 ++- docs/api.rst | 455 +++++++++++++++++++++++++++------------------------ 2 files changed, 267 insertions(+), 215 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index c881dfd2..9d1c36c3 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,9 +6,32 @@ Version 3.2.5 =============== -Version under development, see roadmap here: +Enhancement requests: - https://github.com/nicolargo/glances/milestone/55 + * Add a Accumulated per program function to the Glances process list needs test new feature plugin/ps #2015 + * Including battery and AC adapter health in Glances enhancement new feature #1049 + * Display uptime of a docker container enhancement plugin/docker #2004 + * Add a code formatter enhancement #1964 + +Bugs corrected: + + * Threading.Event.isSet is deprecated in Python 3.10 #2017 + * Fix code scanning alert - Clear-text logging of sensitive information security #2006 + * The gpu temperature unit are displayed incorrectly in web ui bug #2002 + * Doc for 'alert' Restfull/JSON API response documentation #1994 + * Show the spinning state of a disk documentation #1993 + * Web server status check endpoint enhancement #1988 + * --time parameter being ignored for client/server mode bug #1978 + * Amp with pipe do not work documentation #1976 + * glances_ip.py plugin relies on low rating / malicious site domain bug security #1975 + * "N" command freezes/unfreezes the current time instead of show/hide bug #1974 + * Missing commands in help "h" screen enhancement needs contributor #1973 + * Grafana dashboards not displayed with influxdb2 enhancement needs contributor #1960 + * Glances reports different amounts of used memory than free -m or top documentation #1924 + * Missing: Help command doesn't have info on TCP Connections bug documentation enhancement needs contributor #1675 + * Docstring convention documentation enhancement #940 + +Thanks for the bug report and the patch: @RazCrimson, @Karthikeyan Singaravelan, @Moldavite, @ledwards =============== Version 3.2.4.1 diff --git a/docs/api.rst b/docs/api.rst index 476b7b72..99483776 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -66,14 +66,14 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/3/alert - [[1649598784.0, + [[1649599304.0, -1, 'WARNING', 'MEM', - 87.7440430839239, - 87.7440430839239, - 87.7440430839239, - 87.7440430839239, + 86.1119576675399, + 86.1119576675399, + 86.1119576675399, + 86.1119576675399, 1, [], '', @@ -93,7 +93,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.17049384117126465}, + 'timer': 0.30304670333862305}, {'count': 0, 'countmax': 20.0, 'countmin': None, @@ -102,7 +102,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.17037177085876465}] + 'timer': 0.3028125762939453}] Get a specific field:: @@ -120,7 +120,7 @@ Get a specific item when field matchs the given value:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.17049384117126465}]} + 'timer': 0.30304670333862305}]} GET core -------- @@ -150,19 +150,19 @@ Get plugin stats:: 'ctx_switches': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 51.4, + 'idle': 65.2, 'interrupts': 0, - 'iowait': 0.0, + 'iowait': 1.6, 'irq': 0.0, - 'nice': 0.9, + 'nice': 0.4, 'soft_interrupts': 0, - 'softirq': 0.2, + 'softirq': 2.8, 'steal': 0.0, 'syscalls': 0, - 'system': 14.2, + 'system': 8.7, 'time_since_update': 1, - 'total': 44.9, - 'user': 33.3} + 'total': 32.7, + 'user': 21.3} Fields descriptions: @@ -184,7 +184,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {'total': 44.9} + {'total': 32.7} GET diskio ---------- @@ -230,13 +230,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79636021248, + 'free': 79634972672, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151372673024}] + 'used': 151373721600}] Get a specific field:: @@ -247,13 +247,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {'/': [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79636021248, + 'free': 79634972672, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151372673024}]} + 'used': 151373721600}]} GET ip ------ @@ -278,7 +278,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {'cpucore': 4, 'min1': 1.74, 'min15': 1.64, 'min5': 1.41} + {'cpucore': 4, 'min1': 0.89, 'min15': 1.54, 'min5': 1.36} Fields descriptions: @@ -290,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {'min1': 1.74} + {'min1': 0.89} GET mem ------- @@ -298,16 +298,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {'active': 3487096832, - 'available': 961970176, - 'buffers': 188796928, - 'cached': 1438552064, - 'free': 961970176, - 'inactive': 1171030016, - 'percent': 87.7, - 'shared': 523972608, + {'active': 3203149824, + 'available': 1090072576, + 'buffers': 96894976, + 'cached': 1220718592, + 'free': 1090072576, + 'inactive': 1164439552, + 'percent': 86.1, + 'shared': 490676224, 'total': 7849000960, - 'used': 6887030784} + 'used': 6758928384} Fields descriptions: @@ -334,13 +334,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {'free': 7891595264, - 'percent': 2.4, - 'sin': 18165760, - 'sout': 209731584, + {'free': 7773106176, + 'percent': 3.8, + 'sin': 21295104, + 'sout': 329736192, 'time_since_update': 1, 'total': 8082419712, - 'used': 190824448} + 'used': 309313536} Fields descriptions: @@ -376,9 +376,9 @@ Get plugin stats:: 'time_since_update': 1, 'tx': 0}, {'alias': None, - 'cumulative_cx': 111659, + 'cumulative_cx': 139634, 'cumulative_rx': 0, - 'cumulative_tx': 111659, + 'cumulative_tx': 139634, 'cx': 0, 'interface_name': 'vboxnet0', 'is_up': True, @@ -434,7 +434,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - '2022-04-10 15:53:04 CEST' + '2022-04-10 16:01:44 CEST' GET percpu ---------- @@ -445,29 +445,29 @@ Get plugin stats:: [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 40.0, - 'iowait': 0.0, + 'idle': 83.8, + 'iowait': 1.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 8.0, - 'total': 60.0, - 'user': 46.0}, + 'system': 6.7, + 'total': 16.2, + 'user': 7.6}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 55.0, - 'iowait': 0.0, + 'idle': 81.6, + 'iowait': 0.9, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 1.0, - 'softirq': 0.0, + 'nice': 0.0, + 'softirq': 7.9, 'steal': 0.0, - 'system': 6.0, - 'total': 45.0, - 'user': 29.0}] + 'system': 6.1, + 'total': 18.4, + 'user': 3.5}] Get a specific field:: @@ -486,7 +486,7 @@ Get plugin stats:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.007309, + 'status': 0.007046, 'timeout': 3}] Get a specific field:: @@ -503,7 +503,7 @@ Get a specific item when field matchs the given value:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.007309, + 'status': 0.007046, 'timeout': 3}]} GET processcount @@ -512,12 +512,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {'pid_max': 0, 'running': 1, 'sleeping': 260, 'thread': 1303, 'total': 318} + {'pid_max': 0, 'running': 1, 'sleeping': 261, 'thread': 1335, 'total': 330} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {'total': 318} + {'total': 330} GET processlist --------------- @@ -533,12 +533,12 @@ Get plugin stats:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=88.06, system=1004.53, children_user=0.0, children_system=0.0, iowait=0.0), + 'cpu_times': pcputimes(user=106.02, system=1191.75, children_user=0.0, children_system=0.0, iowait=0.0), 'gids': pgids(real=1000, effective=1000, saved=1000), 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=964915200, vms=4202561536, shared=926478336, text=53248, lib=0, data=98004992, dirty=0), - 'memory_percent': 12.293477920532704, + 'memory_info': pmem(rss=963092480, vms=4204658688, shared=924655616, text=53248, lib=0, data=98004992, dirty=0), + 'memory_percent': 12.270255602058176, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -547,19 +547,36 @@ Get plugin stats:: 'status': 'S', 'time_since_update': 1, 'username': 'nicolargo'}, - {'cmdline': ['/usr/lib/firefox/firefox', '-new-window'], + {'cmdline': ['/usr/lib/firefox/firefox', + '-contentproc', + '-childID', + '4', + '-isForBrowser', + '-prefsLen', + '4855', + '-prefMapSize', + '253021', + '-jsInitLen', + '278884', + '-parentBuildID', + '20211215221728', + '-appDir', + '/usr/lib/firefox/browser', + '4964', + 'true', + 'tab'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=531.42, system=169.72, children_user=329.51, children_system=45.83, iowait=1.73), + 'cpu_times': pcputimes(user=148.98, system=25.6, children_user=0.0, children_system=0.0, iowait=0.03), 'gids': pgids(real=1000, effective=1000, saved=1000), - 'io_counters': [702185472, 866934784, 0, 0, 0], + 'io_counters': [9154560, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=469880832, vms=4312092672, shared=119783424, text=643072, lib=0, data=817766400, dirty=0), - 'memory_percent': 5.986504962792106, - 'name': 'GeckoMain', + 'memory_info': pmem(rss=411983872, vms=3211755520, shared=44138496, text=643072, lib=0, data=648302592, dirty=0), + 'memory_percent': 5.248870195067475, + 'name': 'WebExtensions', 'nice': 0, - 'num_threads': 134, - 'pid': 4964, - 'ppid': 3777, + 'num_threads': 21, + 'pid': 5235, + 'ppid': 4964, 'status': 'S', 'time_since_update': 1, 'username': 'nicolargo'}] @@ -568,168 +585,169 @@ Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid {'pid': [9872, - 4964, 5235, - 16062, + 4964, 5294, - 16229, + 16062, 5305, 5894, - 15998, + 16229, 4033, - 17492, - 16038, - 15933, + 15998, + 20039, 15053, - 15966, - 16111, - 18604, - 19240, - 5648, - 17565, + 20161, + 15933, + 16038, 5060, - 16075, - 16242, + 15966, + 20727, + 20793, + 20685, + 5648, + 16111, 8850, 2185, - 15983, - 3875, + 16075, 14178, + 21174, + 3875, + 2233, + 15983, + 16242, + 3789, + 3846, 2410, + 7066, + 5563, + 1332, 15938, 15937, - 19494, - 3789, - 2233, - 3846, - 4305, - 1332, - 7066, 5595, - 5563, 4119, + 14247, 14256, - 5024, - 349, - 4193, 9690, 1160, - 2380, - 4094, 3787, - 4192, - 4627, - 1173, + 4305, + 4094, + 4193, + 2380, 4187, 1315, - 1320, 2197, + 1320, + 4192, 4088, - 14247, + 349, 1, - 4232, - 4130, - 1199, - 4191, - 4167, + 1173, 1175, - 4213, + 5024, + 1199, 3531, 9684, - 4064, - 2189, - 4308, - 14266, - 1039, 4062, - 10484, - 4589, - 4019, - 14265, - 4194, - 4188, - 1584, - 4198, - 3777, + 4130, 2386, + 10484, + 4627, + 4191, + 14266, + 2189, + 4232, + 4019, + 4194, + 14265, + 4213, + 4589, + 1039, + 4167, + 15940, + 4308, + 1584, + 4188, + 4105, + 4198, + 4064, 3762, 1326, - 15940, + 3777, 3824, - 4105, + 1196, 1365, 4057, - 1196, + 3831, 1142, 3900, - 16135, - 3831, - 3813, - 4203, - 4276, - 1195, 1158, - 3855, + 3813, 1201, - 8860, + 4276, + 4203, 9177, - 3797, + 16135, + 8860, + 1195, 2384, + 3797, 4190, 4209, - 383, - 4179, 1166, - 4068, - 1192, + 3855, 3872, - 4301, - 4061, - 4600, + 2385, + 1192, + 4068, 4079, 4229, - 3988, - 2385, 4102, - 4269, - 1186, + 4179, + 3988, 4186, + 4061, 3791, - 3998, - 3817, - 3861, - 3842, + 4600, 3536, - 1040, + 1186, + 3861, + 3998, + 4301, 4197, + 3817, 3836, + 4269, 4195, + 3842, + 1040, + 383, 4200, 1182, - 1202, - 16161, - 1150, 1168, - 1151, + 1202, + 1150, 4013, - 4083, - 1380, 4003, + 4083, + 1151, 1038, 1155, 1446, - 19463, + 16161, + 21157, 1230, - 3778, + 1380, 4546, 1143, - 19493, + 3778, 2062, - 2201, + 21173, 2112, 2218, - 2203, + 2201, 1235, + 2203, 1015, 377, 1153, @@ -883,8 +901,19 @@ Get a specific field:: 16158, 16256, 16973, - 18159, - 19193]} + 19931, + 19932, + 19999, + 20344, + 20357, + 20572, + 20631, + 20632, + 20724, + 20826, + 20850, + 20851, + 21047]} Get a specific item when field matchs the given value:: @@ -897,18 +926,18 @@ Get a specific item when field matchs the given value:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': [88.06, 1004.53, 0.0, 0.0, 0.0], + 'cpu_times': [106.02, 1191.75, 0.0, 0.0, 0.0], 'gids': [1000, 1000, 1000], 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': [964915200, - 4202561536, - 926478336, + 'memory_info': [963092480, + 4204658688, + 924655616, 53248, 0, 98004992, 0], - 'memory_percent': 12.293477920532704, + 'memory_percent': 12.270255602058176, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -932,69 +961,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {'cpu': 44.9, + {'cpu': 32.7, 'cpu_hz': 3000000000.0, - 'cpu_hz_current': 2472500.0, + 'cpu_hz_current': 2071000.0000000002, 'cpu_name': 'Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz', - 'mem': 87.7, + 'mem': 86.1, 'percpu': [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 40.0, - 'iowait': 0.0, + 'idle': 83.8, + 'iowait': 1.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 8.0, - 'total': 60.0, - 'user': 46.0}, + 'system': 6.7, + 'total': 16.2, + 'user': 7.6}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 55.0, - 'iowait': 0.0, + 'idle': 81.6, + 'iowait': 0.9, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 1.0, - 'softirq': 0.0, + 'nice': 0.0, + 'softirq': 7.9, 'steal': 0.0, - 'system': 6.0, - 'total': 45.0, - 'user': 29.0}, + 'system': 6.1, + 'total': 18.4, + 'user': 3.5}, {'cpu_number': 2, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 70.0, - 'iowait': 0.0, + 'idle': 51.4, + 'iowait': 6.3, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 1.0, - 'softirq': 0.0, + 'nice': 0.0, + 'softirq': 1.8, 'steal': 0.0, - 'system': 8.0, - 'total': 30.0, - 'user': 13.0}, + 'system': 11.7, + 'total': 48.6, + 'user': 28.8}, {'cpu_number': 3, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 39.0, + 'idle': 44.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, - 'softirq': 1.0, + 'softirq': 0.9, 'steal': 0.0, - 'system': 19.0, - 'total': 61.0, - 'user': 33.0}], - 'swap': 2.4} + 'system': 5.5, + 'total': 56.0, + 'user': 49.5}], + 'swap': 3.8} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {'cpu': 44.9} + {'cpu': 32.7} GET sensors ----------- @@ -1065,7 +1094,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - {'seconds': 198010} + {'seconds': 198530} GET all stats ------------- @@ -1081,33 +1110,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {'system': [['2022-04-10T15:53:04.470357', 14.2], - ['2022-04-10T15:53:05.515631', 14.2], - ['2022-04-10T15:53:06.601141', 11.0]], - 'user': [['2022-04-10T15:53:04.470351', 33.3], - ['2022-04-10T15:53:05.515624', 33.3], - ['2022-04-10T15:53:06.601136', 13.3]]} + {'system': [['2022-04-10T16:01:44.535906', 8.7], + ['2022-04-10T16:01:45.577607', 8.7], + ['2022-04-10T16:01:46.684425', 11.6]], + 'user': [['2022-04-10T16:01:44.535900', 21.3], + ['2022-04-10T16:01:45.577603', 21.3], + ['2022-04-10T16:01:46.684420', 5.3]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {'system': [['2022-04-10T15:53:05.515631', 14.2], - ['2022-04-10T15:53:06.601141', 11.0]], - 'user': [['2022-04-10T15:53:05.515624', 33.3], - ['2022-04-10T15:53:06.601136', 13.3]]} + {'system': [['2022-04-10T16:01:45.577607', 8.7], + ['2022-04-10T16:01:46.684425', 11.6]], + 'user': [['2022-04-10T16:01:45.577603', 21.3], + ['2022-04-10T16:01:46.684420', 5.3]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T15:53:04.470357', 14.2], - ['2022-04-10T15:53:05.515631', 14.2], - ['2022-04-10T15:53:06.601141', 11.0]]} + {'system': [['2022-04-10T16:01:44.535906', 8.7], + ['2022-04-10T16:01:45.577607', 8.7], + ['2022-04-10T16:01:46.684425', 11.6]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T15:53:05.515631', 14.2], - ['2022-04-10T15:53:06.601141', 11.0]]} + {'system': [['2022-04-10T16:01:45.577607', 8.7], + ['2022-04-10T16:01:46.684425', 11.6]]} GET limits (used for thresholds) -------------------------------- From 128504097b8c369c448a4838d41782466a3b7899 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 16:14:09 +0200 Subject: [PATCH 08/16] Update release note for Glances 3.2.5 --- docs/api.rst | 309 +++++++++++++++++++++----------------------- docs/man/glances.1 | 2 +- glances/__init__.py | 2 +- 3 files changed, 151 insertions(+), 162 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 99483776..cf45dc46 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -66,14 +66,14 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/3/alert - [[1649599304.0, + [[1649600032.0, -1, 'WARNING', 'MEM', - 86.1119576675399, - 86.1119576675399, - 86.1119576675399, - 86.1119576675399, + 87.2703077870435, + 87.2703077870435, + 87.2703077870435, + 87.2703077870435, 1, [], '', @@ -93,7 +93,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.30304670333862305}, + 'timer': 0.14095854759216309}, {'count': 0, 'countmax': 20.0, 'countmin': None, @@ -102,7 +102,7 @@ Get plugin stats:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.3028125762939453}] + 'timer': 0.14076852798461914}] Get a specific field:: @@ -120,7 +120,7 @@ Get a specific item when field matchs the given value:: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.30304670333862305}]} + 'timer': 0.14095854759216309}]} GET core -------- @@ -150,19 +150,19 @@ Get plugin stats:: 'ctx_switches': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 65.2, + 'idle': 59.6, 'interrupts': 0, - 'iowait': 1.6, + 'iowait': 0.2, 'irq': 0.0, - 'nice': 0.4, + 'nice': 0.7, 'soft_interrupts': 0, - 'softirq': 2.8, + 'softirq': 0.9, 'steal': 0.0, 'syscalls': 0, - 'system': 8.7, + 'system': 10.1, 'time_since_update': 1, - 'total': 32.7, - 'user': 21.3} + 'total': 38.8, + 'user': 28.5} Fields descriptions: @@ -184,7 +184,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {'total': 32.7} + {'total': 38.8} GET diskio ---------- @@ -230,13 +230,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79634972672, + 'free': 79632797696, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151373721600}] + 'used': 151375896576}] Get a specific field:: @@ -247,13 +247,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {'/': [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root', - 'free': 79634972672, + 'free': 79632797696, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'percent': 65.5, 'size': 243396149248, - 'used': 151373721600}]} + 'used': 151375896576}]} GET ip ------ @@ -278,7 +278,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {'cpucore': 4, 'min1': 0.89, 'min15': 1.54, 'min5': 1.36} + {'cpucore': 4, 'min1': 1.76, 'min15': 1.61, 'min5': 1.69} Fields descriptions: @@ -290,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {'min1': 0.89} + {'min1': 1.76} GET mem ------- @@ -298,16 +298,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {'active': 3203149824, - 'available': 1090072576, - 'buffers': 96894976, - 'cached': 1220718592, - 'free': 1090072576, - 'inactive': 1164439552, - 'percent': 86.1, - 'shared': 490676224, + {'active': 3452456960, + 'available': 999153664, + 'buffers': 112189440, + 'cached': 1540894720, + 'free': 999153664, + 'inactive': 1303179264, + 'percent': 87.3, + 'shared': 497025024, 'total': 7849000960, - 'used': 6758928384} + 'used': 6849847296} Fields descriptions: @@ -334,13 +334,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {'free': 7773106176, - 'percent': 3.8, - 'sin': 21295104, - 'sout': 329736192, + {'free': 7769960448, + 'percent': 3.9, + 'sin': 21983232, + 'sout': 333402112, 'time_since_update': 1, 'total': 8082419712, - 'used': 309313536} + 'used': 312459264} Fields descriptions: @@ -376,9 +376,9 @@ Get plugin stats:: 'time_since_update': 1, 'tx': 0}, {'alias': None, - 'cumulative_cx': 139634, + 'cumulative_cx': 183333, 'cumulative_rx': 0, - 'cumulative_tx': 139634, + 'cumulative_tx': 183333, 'cx': 0, 'interface_name': 'vboxnet0', 'is_up': True, @@ -434,7 +434,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - '2022-04-10 16:01:44 CEST' + '2022-04-10 16:13:52 CEST' GET percpu ---------- @@ -445,29 +445,29 @@ Get plugin stats:: [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 83.8, - 'iowait': 1.0, + 'idle': 78.0, + 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 6.7, - 'total': 16.2, - 'user': 7.6}, + 'system': 9.0, + 'total': 22.0, + 'user': 9.0}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 81.6, - 'iowait': 0.9, + 'idle': 55.0, + 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 7.9, + 'nice': 1.0, + 'softirq': 2.0, 'steal': 0.0, - 'system': 6.1, - 'total': 18.4, - 'user': 3.5}] + 'system': 7.0, + 'total': 45.0, + 'user': 32.0}] Get a specific field:: @@ -486,7 +486,7 @@ Get plugin stats:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.007046, + 'status': 0.007151, 'timeout': 3}] Get a specific field:: @@ -503,7 +503,7 @@ Get a specific item when field matchs the given value:: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.007046, + 'status': 0.007151, 'timeout': 3}]} GET processcount @@ -512,12 +512,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {'pid_max': 0, 'running': 1, 'sleeping': 261, 'thread': 1335, 'total': 330} + {'pid_max': 0, 'running': 1, 'sleeping': 261, 'thread': 1317, 'total': 319} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {'total': 330} + {'total': 319} GET processlist --------------- @@ -533,12 +533,12 @@ Get plugin stats:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=106.02, system=1191.75, children_user=0.0, children_system=0.0, iowait=0.0), + 'cpu_times': pcputimes(user=128.45, system=1415.02, children_user=0.0, children_system=0.0, iowait=0.0), 'gids': pgids(real=1000, effective=1000, saved=1000), 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=963092480, vms=4204658688, shared=924655616, text=53248, lib=0, data=98004992, dirty=0), - 'memory_percent': 12.270255602058176, + 'memory_info': pmem(rss=963088384, vms=4204658688, shared=924651520, text=53248, lib=0, data=98004992, dirty=0), + 'memory_percent': 12.270203417072839, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -566,12 +566,12 @@ Get plugin stats:: 'true', 'tab'], 'cpu_percent': 0.0, - 'cpu_times': pcputimes(user=148.98, system=25.6, children_user=0.0, children_system=0.0, iowait=0.03), + 'cpu_times': pcputimes(user=157.91, system=26.98, children_user=0.0, children_system=0.0, iowait=0.03), 'gids': pgids(real=1000, effective=1000, saved=1000), 'io_counters': [9154560, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': pmem(rss=411983872, vms=3211755520, shared=44138496, text=643072, lib=0, data=648302592, dirty=0), - 'memory_percent': 5.248870195067475, + 'memory_info': pmem(rss=413597696, vms=3211755520, shared=44220416, text=643072, lib=0, data=648302592, dirty=0), + 'memory_percent': 5.269431079289866, 'name': 'WebExtensions', 'nice': 0, 'num_threads': 21, @@ -587,84 +587,85 @@ Get a specific field:: {'pid': [9872, 5235, 4964, - 5294, 16062, + 5294, 5305, - 5894, 16229, - 4033, 15998, - 20039, + 5894, + 4033, 15053, + 20039, 20161, 15933, 16038, - 5060, 15966, + 5060, 20727, 20793, 20685, 5648, - 16111, 8850, - 2185, + 16111, 16075, - 14178, - 21174, + 2185, + 22482, 3875, 2233, 15983, - 16242, + 22458, 3789, + 16242, 3846, 2410, 7066, 5563, - 1332, 15938, + 1332, 15937, 5595, 4119, 14247, 14256, 9690, + 349, 1160, 3787, 4305, - 4094, 4193, + 4094, 2380, 4187, 1315, 2197, 1320, 4192, - 4088, - 349, 1, + 4088, 1173, 1175, - 5024, + 4627, 1199, + 5024, 3531, 9684, 4062, + 2189, 4130, 2386, 10484, - 4627, 4191, 14266, - 2189, 4232, + 3777, 4019, 4194, - 14265, 4213, 4589, - 1039, 4167, + 14265, 15940, + 1039, 4308, 1584, 4188, @@ -673,7 +674,6 @@ Get a specific field:: 4064, 3762, 1326, - 3777, 3824, 1196, 1365, @@ -683,12 +683,12 @@ Get a specific field:: 3900, 1158, 3813, - 1201, 4276, 4203, 9177, 16135, 8860, + 1201, 1195, 2384, 3797, @@ -701,8 +701,8 @@ Get a specific field:: 1192, 4068, 4079, - 4229, 4102, + 4229, 4179, 3988, 4186, @@ -734,15 +734,15 @@ Get a specific field:: 1038, 1155, 1446, + 22470, 16161, - 21157, 1230, 1380, 4546, 1143, 3778, + 22481, 2062, - 21173, 2112, 2218, 2201, @@ -892,28 +892,17 @@ Get a specific field:: 9904, 13281, 13643, - 13786, 13855, - 14103, 14128, - 14134, - 14135, 16158, 16256, 16973, - 19931, 19932, - 19999, 20344, - 20357, 20572, - 20631, - 20632, 20724, - 20826, - 20850, - 20851, - 21047]} + 21047, + 22267]} Get a specific item when field matchs the given value:: @@ -926,18 +915,18 @@ Get a specific item when field matchs the given value:: '--vrde', 'config'], 'cpu_percent': 0.0, - 'cpu_times': [106.02, 1191.75, 0.0, 0.0, 0.0], + 'cpu_times': [128.45, 1415.02, 0.0, 0.0, 0.0], 'gids': [1000, 1000, 1000], 'io_counters': [0, 0, 0, 0, 0], 'key': 'pid', - 'memory_info': [963092480, + 'memory_info': [963088384, 4204658688, - 924655616, + 924651520, 53248, 0, 98004992, 0], - 'memory_percent': 12.270255602058176, + 'memory_percent': 12.270203417072839, 'name': 'VBoxHeadless', 'nice': 0, 'num_threads': 28, @@ -961,69 +950,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {'cpu': 32.7, + {'cpu': 38.8, 'cpu_hz': 3000000000.0, - 'cpu_hz_current': 2071000.0000000002, + 'cpu_hz_current': 2543000.0, 'cpu_name': 'Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz', - 'mem': 86.1, + 'mem': 87.3, 'percpu': [{'cpu_number': 0, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 83.8, - 'iowait': 1.0, + 'idle': 78.0, + 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 1.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 6.7, - 'total': 16.2, - 'user': 7.6}, + 'system': 9.0, + 'total': 22.0, + 'user': 9.0}, {'cpu_number': 1, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 81.6, - 'iowait': 0.9, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 7.9, - 'steal': 0.0, - 'system': 6.1, - 'total': 18.4, - 'user': 3.5}, - {'cpu_number': 2, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 51.4, - 'iowait': 6.3, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 1.8, - 'steal': 0.0, - 'system': 11.7, - 'total': 48.6, - 'user': 28.8}, - {'cpu_number': 3, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 44.0, + 'idle': 55.0, 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.9, + 'nice': 1.0, + 'softirq': 2.0, 'steal': 0.0, - 'system': 5.5, - 'total': 56.0, - 'user': 49.5}], - 'swap': 3.8} + 'system': 7.0, + 'total': 45.0, + 'user': 32.0}, + {'cpu_number': 2, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 78.0, + 'iowait': 1.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 9.0, + 'total': 22.0, + 'user': 10.0}, + {'cpu_number': 3, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 27.0, + 'iowait': 1.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 1.0, + 'steal': 0.0, + 'system': 3.0, + 'total': 73.0, + 'user': 66.0}], + 'swap': 3.9} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {'cpu': 32.7} + {'cpu': 38.8} GET sensors ----------- @@ -1094,7 +1083,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - {'seconds': 198530} + {'seconds': 199257} GET all stats ------------- @@ -1110,33 +1099,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {'system': [['2022-04-10T16:01:44.535906', 8.7], - ['2022-04-10T16:01:45.577607', 8.7], - ['2022-04-10T16:01:46.684425', 11.6]], - 'user': [['2022-04-10T16:01:44.535900', 21.3], - ['2022-04-10T16:01:45.577603', 21.3], - ['2022-04-10T16:01:46.684420', 5.3]]} + {'system': [['2022-04-10T16:13:53.155669', 10.1], + ['2022-04-10T16:13:54.194594', 10.1], + ['2022-04-10T16:13:55.280474', 10.9]], + 'user': [['2022-04-10T16:13:53.155662', 28.5], + ['2022-04-10T16:13:54.194590', 28.5], + ['2022-04-10T16:13:55.280470', 4.2]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {'system': [['2022-04-10T16:01:45.577607', 8.7], - ['2022-04-10T16:01:46.684425', 11.6]], - 'user': [['2022-04-10T16:01:45.577603', 21.3], - ['2022-04-10T16:01:46.684420', 5.3]]} + {'system': [['2022-04-10T16:13:54.194594', 10.1], + ['2022-04-10T16:13:55.280474', 10.9]], + 'user': [['2022-04-10T16:13:54.194590', 28.5], + ['2022-04-10T16:13:55.280470', 4.2]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T16:01:44.535906', 8.7], - ['2022-04-10T16:01:45.577607', 8.7], - ['2022-04-10T16:01:46.684425', 11.6]]} + {'system': [['2022-04-10T16:13:53.155669', 10.1], + ['2022-04-10T16:13:54.194594', 10.1], + ['2022-04-10T16:13:55.280474', 10.9]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {'system': [['2022-04-10T16:01:45.577607', 8.7], - ['2022-04-10T16:01:46.684425', 11.6]]} + {'system': [['2022-04-10T16:13:54.194594', 10.1], + ['2022-04-10T16:13:55.280474', 10.9]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 36da8516..45a41aff 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GLANCES" "1" "Apr 10, 2022" "3.2.5_beta01" "Glances" +.TH "GLANCES" "1" "Apr 10, 2022" "3.2.5" "Glances" .SH NAME glances \- An eye on your system . diff --git a/glances/__init__.py b/glances/__init__.py index 569447bb..a31313f5 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -29,7 +29,7 @@ import sys # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.2.5_beta01' +__version__ = '3.2.5' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' From abb6f178feb01d5ec7ee0bc3c69359ee354da6a2 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 10 Apr 2022 16:25:37 +0200 Subject: [PATCH 09/16] On the road of Glances 3..2.6 --- NEWS.rst | 6 ++++++ glances/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.rst b/NEWS.rst index 9d1c36c3..a855952a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,12 @@ Glances changelog ============================================================================== +=============== +Version 3.2.6 +=============== + +Under development: see roadmap here https://github.com/nicolargo/glances/milestone/58 + =============== Version 3.2.5 =============== diff --git a/glances/__init__.py b/glances/__init__.py index a31313f5..c759ed3d 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -29,7 +29,7 @@ import sys # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.2.5' +__version__ = '3.2.6_beta01' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' From 4ea4e4bec581319af2d56d1b8b06a68ce8fdb6b0 Mon Sep 17 00:00:00 2001 From: RazCrimson <52282402+RazCrimson@users.noreply.github.com> Date: Mon, 11 Apr 2022 01:29:53 +0530 Subject: [PATCH 10/16] plugin: ip - update public address every `t` seconds --- glances/plugins/glances_ip.py | 39 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/glances/plugins/glances_ip.py b/glances/plugins/glances_ip.py index 17714286..cb27e947 100644 --- a/glances/plugins/glances_ip.py +++ b/glances/plugins/glances_ip.py @@ -24,7 +24,7 @@ from json import loads from glances.compat import iterkeys, urlopen, queue from glances.logger import logger -from glances.timer import Timer +from glances.timer import Timer, getTimeSinceLastUpdate from glances.plugins.glances_plugin import GlancesPlugin # Import plugin specific dependency @@ -56,6 +56,8 @@ class Plugin(GlancesPlugin): stats is a dict """ + _default_public_refresh_interval = 300 + def __init__(self, args=None, config=None): """Init the plugin.""" super(Plugin, self).__init__(args=args, config=config) @@ -63,9 +65,11 @@ class Plugin(GlancesPlugin): # We want to display the stat in the curse interface self.display_curse = True - # Get the public IP address once (not for each refresh) - if not import_error_tag: - self.public_address = PublicIpAddress().get() + # For public IP address + self.public_address = "" + self.public_address_refresh_interval = self.get_conf_value( + "public_refresh_interval", default=self._default_public_refresh_interval + ) @GlancesPlugin._check_decorator @GlancesPlugin._log_result_decorator @@ -83,15 +87,24 @@ class Plugin(GlancesPlugin): default_gw = netifaces.gateways()['default'][netifaces.AF_INET] except (KeyError, AttributeError) as e: logger.debug("Cannot grab the default gateway ({})".format(e)) + return {} + + try: + address = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['addr'] + mask = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask'] + + time_since_update = getTimeSinceLastUpdate('public-ip') + if self.stats.get('address') != address or time_since_update > self.public_address_refresh_interval: + self.public_address = PublicIpAddress().get() + except (KeyError, AttributeError) as e: + logger.debug("Cannot grab IP information: {}".format(e)) else: - try: - stats['address'] = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['addr'] - stats['mask'] = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask'] - stats['mask_cidr'] = self.ip_to_cidr(stats['mask']) - stats['gateway'] = netifaces.gateways()['default'][netifaces.AF_INET][0] - stats['public_address'] = self.public_address - except (KeyError, AttributeError) as e: - logger.debug("Cannot grab IP information: {}".format(e)) + stats['address'] = address + stats['mask'] = mask + stats['mask_cidr'] = self.ip_to_cidr(stats['mask']) + stats['gateway'] = default_gw[0] + stats['public_address'] = self.public_address + elif self.input_method == 'snmp': # Not implemented yet pass @@ -138,7 +151,7 @@ class Plugin(GlancesPlugin): # Add KeyError exception (see https://github.com/nicolargo/glances/issues/1469) pass else: - if self.stats['public_address'] is not None: + if self.stats['public_address']: msg = ' Pub ' ret.append(self.curse_add_line(msg, 'TITLE')) ret.append(self.curse_add_line(msg_pub)) From 0a9b9f5f360840b6a47eaf73027db993aa46ece6 Mon Sep 17 00:00:00 2001 From: RazCrimson <52282402+RazCrimson@users.noreply.github.com> Date: Mon, 11 Apr 2022 01:44:06 +0530 Subject: [PATCH 11/16] docs: header - update public address every `t` seconds --- docs/aoa/header.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/aoa/header.rst b/docs/aoa/header.rst index f5e7ada8..07819967 100644 --- a/docs/aoa/header.rst +++ b/docs/aoa/header.rst @@ -11,6 +11,17 @@ Additionally, on GNU/Linux, it also shows the kernel version. In client mode, the server connection status is also displayed. +It is possible to define time interval to be used for refreshing the +public IP address (default is 300 seconds) from the configuration +file under the ``[ip]`` section: + +.. code-block:: ini + [ip] + public_refresh_interval=240 + +**NOTE:** Setting low values will result in frequent HTTP request to +the IP detection servers. Recommended range: 120-600 seconds + **Connected**: .. image:: ../_static/connected.png From 2bbb3e49f7e0498f7caba33452613ffda27037da Mon Sep 17 00:00:00 2001 From: RazCrimson <52282402+RazCrimson@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:24:12 +0530 Subject: [PATCH 12/16] plugin: ip - Optionally disable displaying public ip --- docs/aoa/header.rst | 7 ++++--- glances/plugins/glances_ip.py | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/aoa/header.rst b/docs/aoa/header.rst index 07819967..2e723413 100644 --- a/docs/aoa/header.rst +++ b/docs/aoa/header.rst @@ -11,16 +11,17 @@ Additionally, on GNU/Linux, it also shows the kernel version. In client mode, the server connection status is also displayed. -It is possible to define time interval to be used for refreshing the +It is possible to disable or define time interval to be used for refreshing the public IP address (default is 300 seconds) from the configuration file under the ``[ip]`` section: .. code-block:: ini [ip] public_refresh_interval=240 + public_ip_disabled=True -**NOTE:** Setting low values will result in frequent HTTP request to -the IP detection servers. Recommended range: 120-600 seconds +**NOTE:** Setting low values for `public_refresh_interval` will result in frequent +HTTP requests to the IP detection servers. Recommended range: 120-600 seconds **Connected**: diff --git a/glances/plugins/glances_ip.py b/glances/plugins/glances_ip.py index cb27e947..e5c77296 100644 --- a/glances/plugins/glances_ip.py +++ b/glances/plugins/glances_ip.py @@ -57,6 +57,7 @@ class Plugin(GlancesPlugin): """ _default_public_refresh_interval = 300 + _default_public_ip_disabled = ["False"] def __init__(self, args=None, config=None): """Init the plugin.""" @@ -71,6 +72,9 @@ class Plugin(GlancesPlugin): "public_refresh_interval", default=self._default_public_refresh_interval ) + public_ip_disabled = self.get_conf_value("public_ip_disabled", default=self._default_public_ip_disabled) + self.public_ip_disabled = True if public_ip_disabled == ["True"] else False + @GlancesPlugin._check_decorator @GlancesPlugin._log_result_decorator def update(self): @@ -94,7 +98,9 @@ class Plugin(GlancesPlugin): mask = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask'] time_since_update = getTimeSinceLastUpdate('public-ip') - if self.stats.get('address') != address or time_since_update > self.public_address_refresh_interval: + if not self.public_ip_disabled and ( + self.stats.get('address') != address or time_since_update > self.public_address_refresh_interval + ): self.public_address = PublicIpAddress().get() except (KeyError, AttributeError) as e: logger.debug("Cannot grab IP information: {}".format(e)) From 27b5db4d79b4d3faeb58577c05c9d6514cda6438 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Apr 2022 13:44:38 +0000 Subject: [PATCH 13/16] Bump minimist from 1.2.5 to 1.2.6 in /glances/outputs/static Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- glances/outputs/static/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glances/outputs/static/package-lock.json b/glances/outputs/static/package-lock.json index 83fa5d9b..90984dac 100644 --- a/glances/outputs/static/package-lock.json +++ b/glances/outputs/static/package-lock.json @@ -2091,9 +2091,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "minimist-options": { From df7d8163e184d576a7cd8852fb1fad5cc66ebe70 Mon Sep 17 00:00:00 2001 From: Nicolas Hennion Date: Sun, 17 Apr 2022 10:21:13 +0200 Subject: [PATCH 14/16] Add social icons --- docs/_static/reddit.png | Bin 0 -> 6362 bytes docs/_static/twitter-icon.png | Bin 0 -> 6395 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/_static/reddit.png create mode 100644 docs/_static/twitter-icon.png diff --git a/docs/_static/reddit.png b/docs/_static/reddit.png new file mode 100644 index 0000000000000000000000000000000000000000..bc90a7480c5730932d0c866f3ed8cd697cc2da22 GIT binary patch literal 6362 zcmd6s)mM}Ox5i%(VH6oa0i{v8Mv)L0N;(|6OGFy!u3;1b1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x@X-0M-NNx|SwahW$}L=QrxhGCs1Ua*BjqZIX8P2dfES^nX<-0H*KsPPJK zw3OSO{oWa68D8y|!AyoRgHe9>AZtq{Pj&6@-k$1M#;t3CPcAg-bO8!iSrf1s?I{DN z-Gjjf(>ngBgvInZ=l7c}YBFweoeMF3)9%)+2L}VziK%i(MaxP5M69-%5D**NCDQ;; zP@-iUKjzGRvuCnm!Orq3+sEWfC1koH|FVdq#uqbggu=B3u9&B}eGpg-i5R_s?5(!| zDELUHwYy}ZtLhHNthmO|t}LWb|AwTSCu}aSZb!7y{4G7VkX0XBFD}i7Dfms#>T%CD z6h zEAyt+%F;rj@_lbg5k5zDKz-(hmyvO_F|YD9Yo@A6GuWhaG7&HPTdb^}7T|eF+WEPJ z)X47ppa`P5ss4V|242ZLYge?no-R@?F~)02oIgp9C~LN!X&x1bY8Kf0l@8>F`_AzK zvEznOS1#2(&Lxn#wrX0%h4(!yZbQiXVhdNI3E^a9UNG?Cw_fUI3^yL#Cb?b@_wQv2z2iu8q;RMLj zUM7kesNG&4Rmn*S`y^W<7#ZRHukig1Z7mUaFn&;e z%Czob@+L}rMXyC+{`$AaP;}C@=+=QtrHV=K;g*$E0;MrKhQaw^3De@%91(%Z9bs~| z0FB1Sum%p6Jgd!zPb0^xpnP2#kN+5I1h;nXcAw00hOs5!921Gesh)B3vnDLbR?Q?Z zp@u%2r7uPlWk(2Rb;k$Mr398F4XpHXSTuJ5Aime{#D_QgC{b4S5#4F2rhNBqSnGl^`b*lv-5yb z#(AYI_(bGwS?0vnBzPw6f5 z1qH|@wUawm)#>R;!Y6vsVX@?CoXJIoqY>FPA*fkOl)DZiEa3RK^VKp!s_rqtbbEa? nV$+C=>;FrF{=fPKm*5RQs**#Gr?S^g4dBTmJ Date: Sun, 17 Apr 2022 10:26:53 +0200 Subject: [PATCH 15/16] Update README.rst --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index 7759168a..453f6224 100644 --- a/README.rst +++ b/README.rst @@ -54,6 +54,15 @@ Glances is written in Python and uses libraries to grab information from your system. It is based on an open architecture where developers can add new plugins or exports modules. +Social networks +=============== + +.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/twitter-icon.png + :target: https://twitter.com/nicolargo + +.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/reddit.png + :target: https://www.reddit.com/r/glances/ + Requirements ============ From 96c6faf4738976b62c9497ec78879ac76610dd66 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 17 Apr 2022 10:29:22 +0200 Subject: [PATCH 16/16] Add an alias to get stats as json --- glances/plugins/glances_plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glances/plugins/glances_plugin.py b/glances/plugins/glances_plugin.py index 10f9c08d..4bce83ed 100644 --- a/glances/plugins/glances_plugin.py +++ b/glances/plugins/glances_plugin.py @@ -425,6 +425,10 @@ class GlancesPlugin(object): """Return the stats object in JSON format.""" return self._json_dumps(self.stats) + def get_json(self): + """Return the stats object in JSON format.""" + return self.get_stats() + def get_stats_item(self, item): """Return the stats object for a specific item in JSON format.