1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| >>> psutil.net_io_counters() snetio(bytes_sent=516102, bytes_recv=40080757, packets_sent=5633, packets_recv=30276, errin=0, errout=0, dropin=0, dropout=0)
>>> psutil.net_if_addrs() {'lo': [snicaddr(family=<AddressFamily.AF_INET: 2>, address='127.0.0.1', netmask='255.0.0.0', broadcast=None, ptp=None), snicaddr(family=<AddressFamily.AF_INET6: 10>, address='::1', netmask='ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', broadcast=None, ptp=None), snicaddr(family=<AddressFamily.AF_PACKET: 17>, address='00:00:00:00:00:00', netmask=None, broadcast=None, ptp=None)], 'ens33': [snicaddr(family=<AddressFamily.AF_INET: 2>, address='192.168.10.20', netmask='255.255.255.0', broadcast='192.168.10.255', ptp=None), snicaddr(family=<AddressFamily.AF_INET6: 10>, address='fe80::af1b:e785:a3f6:76ee%ens33', netmask='ffff:ffff:ffff:ffff::', broadcast=None, ptp=None), snicaddr(family=<AddressFamily.AF_PACKET: 17>, address='00:0c:29:ac:7b:d8', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]}
>>> psutil.net_if_stats() {'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536), 'ens33': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=1000, mtu=1500)}
>>> psutil.net_connections() [sconn(fd=13, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='127.0.0.1', port=25), raddr=(), status='LISTEN', pid=1728), sconn(fd=4, family=<AddressFamily.AF_INET6: 10>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='::', port=22), raddr=(), status='LISTEN', pid=1402), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='192.168.10.20', port=22), raddr=addr(ip='192.168.10.1', port=56457), status='ESTABLISHED', pid=10844), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='192.168.10.20', port=22), raddr=addr(ip='192.168.10.1', port=57415), status='ESTABLISHED', pid=10411), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='192.168.10.20', port=22), raddr=addr(ip='192.168.10.1', port=56456), status='ESTABLISHED', pid=10842), sconn(fd=6, family=<AddressFamily.AF_INET6: 10>, type=<SocketKind.SOCK_DGRAM: 2>, laddr=addr(ip='::1', port=323), raddr=(), status='NONE', pid=976), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='0.0.0.0', port=22), raddr=(), status='LISTEN', pid=1402), sconn(fd=14, family=<AddressFamily.AF_INET6: 10>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='::1', port=25), raddr=(), status='LISTEN', pid=1728), sconn(fd=5, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_DGRAM: 2>, laddr=addr(ip='127.0.0.1', port=323), raddr=(), status='NONE', pid=976), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='192.168.10.20', port=22), raddr=addr(ip='192.168.10.1', port=57325), status='ESTABLISHED', pid=25106), sconn(fd=3, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, laddr=addr(ip='192.168.10.20', port=22), raddr=addr(ip='192.168.10.1', port=57324), status='ESTABLISHED', pid=25104)]
>>> psutil.users() [suser(name='root', terminal='tty1', host='', started=1580717824.0, pid=987), suser(name='root', terminal='pts/0', host='192.168.10.1', started=1580717952.0, pid=10414), suser(name='root', terminal='pts/1', host='192.168.10.1', started=1598920704.0, pid=10846), suser(name='root', terminal='pts/2', host='192.168.10.1', started=1598921856.0, pid=25108)]
>>> psutil.boot_time() 1527819435.0
|