loadavg function contrib to process module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've added the following to my process.py module to retrieve the loadavg of my minions. 

   def loadavg(self):
        return open("/proc/loadavg", "r").readline().strip().split(" ")

    def register_method_args(self):
         .
         .
         .
      'loadavg':{
                    'args':{}, 
                    'description':"Returns a list of loadavg details."
                    },
        .
        . 
        .


Usage:

# func * call process loadavg

{'HOST': ['0.58', '0.30', '0.30', '6/145', '32295']}

Perhaps others will find this simple method useful.

Phil

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux