用于硬件和系统监控的python模块

statux的Python项目详细描述


statux是一个用于linux的python库,它提供了获取硬件的方法 以及系统信息。用于监视任务。

电池

MethodReturns
^{tt1}$Manufacturer, model and s/n
^{tt2}$Full, Charging or Discharging
^{tt3}$True if battery is present
^{tt4}$battery voltage (mV)
^{tt5}$battery current (mA)
^{tt6}$battery energy (mWh)
^{tt7}$battery power (mW)
^{tt8}$battery charge (mAh)
^{tt9}$current capacity percent
^{tt10}$Full, Normal, Low or Critical
^{tt11}$value set for low battery level
^{tt12}$value set for critical level
^{tt13}$value set for critical action
^{tt14}$PowerOff, Hibernate or HybridSleep
^{tt15}$Remaining battery life
^{tt16}$Battery health level
^{tt17}$Chemistry of battery
^{tt18}$Battery, Mains, UPS, etc
^{tt19}$Open or Close
^{tt20}$True if AC adapter is online

CPU

MethodReturns
^{tt21}$CPU Load percentage. Note: Needs to instantiate ^{tt22}$ class
^{tt23}$Number of logical processors
^{tt24}$Number of physical processor
^{tt25}$Current CPU frequency
^{tt26}$CPU max frequency
^{tt27}$Current CPU frequency percent
^{tt28}$True if CPU is AMD64 or Intel64 i.e. 64 bit capable
^{tt29}$CPU model name

磁盘

MethodReturns
^{tt30}$sda, sdb, nvmen1, hda, hdb, etc
^{tt31}$sda1,sda2, sdb1, nvmen1p1, hda1, hdb2, etc
^{tt32}$If block device is rotational
^{tt33}$If block device is removable
^{tt34}$Model name of the given device (sda, hdb..)
^{tt35}$a namedtuple with persistent names of a disk or a partition (id, label, path, uuid partlabel and partuuid)
^{tt36}$A dict with mounted partitions as key and a namedtuple with mount point, filesystem and mount options as value
^{tt37}$mounted partitions and mount points
^{tt38}$Total size of a partition
^{tt39}$Free space of a partition
^{tt40}$Used space of a partition
^{tt41}$Used space percent of a partition
^{tt42}$Bytes read in a partition
^{tt43}$Bytes written in a partition
^{tt44}$Bytes read and wirtten in a partition
^{tt45}$Bytes read and writen in several partitions

网络

MethodReturns
^{tt46}$All network interfaces
^{tt47}$total bytes downloaded in a interface
^{tt48}$total bytes uploaded in a interface
^{tt49}$total bytes up-downloaded in a interface
^{tt47}$average download speed per second
^{tt51}$average download speed per second
^{tt52}$average up-download speed per second

内存

MethodReturns
^{tt53}$Total RAM size
^{tt54}$Free RAM
^{tt55}$Free RAM percent
^{tt56}$Available RAM
^{tt57}$Available RAM percent
^{tt58}$Buffer, cached and slab memory
^{tt59}$Used RAM
^{tt60}$Used RAM percent

系统

MethodReturns
^{tt61}$Time at which the system booted
^{tt62}$Time elapsed since system boot time
^{tt63}$Init system name
^{tt64}$Hostname
^{tt65}$User name
^{tt66}$Kernel release
^{tt67}$Kernel version
^{tt68}$Machine type
^{tt69}$Current session id
^{tt70}$Distro short name
^{tt71}$Full distro description
^{tt72}$Distro version
^{tt73}$Distro url
^{tt74}$Distro info (id, version, codename)

温度

MethodReturns
^{tt75}$temperature of each core
^{tt76}$CPU temp
^{tt77}$maximum value of the temp sensors obtained

注:

这些方法基于proc和sys文件系统,并在linux 4.15中进行了测试。 有些方法可能在以前的内核版本中不可用

安装:

通过pip(可能不是最新版本):

pip install statux

克隆此回购:

git clone https://github.com/Arg0s1080/statux.git
cd statux
sudo python3 setup.py install

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用Selenium Java查找筛选器窗格“铅笔图标”的元素时出现问题   分布式缓存l2上使用infinispan和hibernate的java连接锁   使用Java的DOM XML API解析XML中的符号和   java是解析和操作字符串的有效方法   java发布NewRelicMeterRegistry时如何过滤仪表   多维数组在java中读取文件后将数据值分组   java如何将httpClient配置为jsoup   java BreakIterator在Android中是如何工作的?   找不到maven GAE类:原因:java。lang.ClassNotFoundException应用程序标识cRedential$AppenginecRedential包装   Jlabel调整java大小   调试如何在VScode中的java类依赖项中设置断点   java正在获取文件夹名,而不是。mp3文件{Android}   java如何将从DiffieHellman类生成的AES密钥添加到使用该密钥的类