insights-core
master
  • Red Hat Insights
  • Quickstart Insights Development
  • Insights API
  • Components and Exceptions
  • API Documentation
  • Datasource Catalog
  • Shared Parsers Catalog
  • Shared Combiners Catalog
    • Ansible Info
    • CephOsdTree
    • Ceph Version
    • Cloud Provider
    • CpuVulnsAll - combiner for CPU vulnerabilities
    • crio configuration
    • Dmesg
    • Disk Usage
    • GrubConf - The valid GRUB configuration
    • Hostname
    • Combiner for httpd configurations
    • IPCS Semaphores
    • IPCS Shared Memory Segments
    • IPv6 - Check whether IPv6 is disabled
    • Journald configuration
    • krb5 configuration
    • Limits configuration
    • LogrotateConfAll - Combiner for logrotate configuration
    • LsPci - Commands lspci
    • Lvm - Combiner for lvm information
    • NormalMD5 Combiner for the NormalMD5 Parser
    • Mlx4Port Combiner for the Mlx4Port Parser
    • ModInfo
    • Modprobe configuration
    • Mounts
    • Link Layer stats
    • Combined NFS exports
    • NginxConfTree - Combiner for nginx configuration
    • nmcli_dev_show command
    • PackageProvidesHttpdAll - Combiner for packages which provide httpd
    • PackageProvidesJavaAll - Combiner for packages which provide java
    • PS
    • Red Hat Release
    • Red Hat Subscription Manager Release
    • Sap
    • Satellite Version
    • SELinux
    • Services - check ChkConfig and systemd UnitFiles
    • Simultaneous Multithreading (SMT) combiner
    • Combiners for getting the earliest expiry date from a lot of SSL certificates
    • Sudoers - files /etc/sudoers or /etc/sudoers.d/*
    • VMBus device info
    • Sysctl configuration files
    • Tmpfilesd configuration
    • Uptime
    • UserNamespaces - Check whether user namespaces are enabled
    • VirtWhat
    • virt-who configuration
    • X86PageBranch - combiner for x86 kernel features:
  • Shared Components Catalog
  • Custom Datasources Catalog
  • Openshift 4 Analysis
  • Insights Shell
  • Documentation Guidelines
  • Components Cross-Reference
  • Embedded Content
  • Tools
  • Component Configuration
  • Examples
  • Jupyter Notebook Examples
  • MAN Pages
  • Insights Core Cheat Sheets
insights-core
  • »
  • Shared Combiners Catalog »
  • Link Layer stats
  • Edit on GitHub

Link Layer stats¶

Combiner for link layer stats. It uses the results of the netstat -i parser and the ip -s link parser to determine the network stats of link layer. ip -s link is the preferred source of data and return object which can be used to access group_by_iface.

Examples

>>> type(nstat)
<class 'insights.combiners.netstat.NetworkStats'>
>>> stats = nstat.group_by_iface
>>> stats["lo"]
{'RX-OK': 98, 'TX-OK': 100, 'MTU': 65536, 'RX-ERR': 0, 'TX-DRP': 0, 'TX-ERR': 0, 'RX-DRP': 0, 'RX-OVR': 0, 'Flg': 'LRU'}
>>> stats["enp0s8"]
{'RX-OK': 6, 'TX-DRP': 0, 'TX-OK': 4, 'MTU': 1500, 'RX-ERR': 0, 'TX-ERR': 0, 'RX-DRP': 0, 'RX-OVR': 0, 'Flg': 'BMRU'}
>>> print nstat.data[0]['Iface']
enp0s8
>>> for dev_item in nstat.data:
>>>     print dev_item
{'RX-OK': '842447', 'TX-OVR': '0', 'Iface': 'bond1', 'TX-OK': '4233', 'MTU': '1500', 'Met': '0', 'RX-ERR': '0', 'TX-DRP': '0', 'TX-ERR': '0', 'RX-DRP': '0', 'RX-OVR': '0', 'Flg': 'BMmRU'}
{'RX-OK': '422518', 'TX-OVR': '0', 'Iface': 'eth0', 'TX-OK': '1703', 'MTU': '1500', 'Met': '0', 'RX-ERR': '0', 'TX-DRP': '0', 'TX-ERR': '0', 'RX-DRP': '0', 'RX-OVR': '0', 'Flg': 'BMsRU'}
...
...
class insights.combiners.netstat.NetworkStats(net_stats, ip_stats)[source]¶

Bases: object

A combiner for working with both netstat -i and ip -s link That is if netstat -i gets deprecated then we can continue with ip -s link.

This interface closely follow interface Netstat_I it has following Attributes:

group_by_iface¶

This property returns network stats organised per interface in dict format.

Type

dict

data¶

List of network stats as per devices.

Type

list

Previous Next

© Copyright 2016, 2017, 2018, 2019, 2020 Red Hat, Inc. Revision f1398d25.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: master
Versions
master
latest
dev
Downloads
html
On Read the Docs
Project Home
Builds