Re: loadavg function contrib to process module

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

 



func@xxxxxxxxxxxxx wrote:
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.
fo/func-list

Just merged this in. Working on the minion_name patch at the moment. Just trying to resist the urge to refactor that get_hostname code while I'm at it.

Adrian

_______________________________________________
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