Server : Apache System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : andertr9 ( 1047) PHP Version : 8.2.18 Disable Function : NONE Directory : /usr/share/dstat/ |
Upload File : |
### Author: Dag Wieers <dag@wieers.com> class dstat_plugin(dstat): def __init__(self): self.name = 'wifi' self.nick = ('lnk', 's/n') self.type = 'd' self.width = 3 self.scale = 34 self.cols = 2 def check(self): global iwlibs from pythonwifi import iwlibs def vars(self): return iwlibs.getNICnames() def extract(self): for name in self.vars: wifi = iwlibs.Wireless(name) stat, qual, discard, missed_beacon = wifi.getStatistics() # print qual.quality, qual.signallevel, qual.noiselevel if qual.quality == 0 or qual.signallevel == -101 or qual.noiselevel == -101 or qual.signallevel == -256 or qual.noiselevel == -256: self.val[name] = ( -1, -1 ) else: self.val[name] = ( qual.quality, qual.signallevel * 100 / qual.noiselevel ) # vim:ts=4:sw=4:et