Skip to content

Instantly share code, notes, and snippets.

@kylegato
Created July 11, 2013 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylegato/72b54366dfc5557e5d68 to your computer and use it in GitHub Desktop.
Save kylegato/72b54366dfc5557e5d68 to your computer and use it in GitHub Desktop.
def loadavg():
'''
Return the load averages for this minion
CLI Example::
salt '*' status.loadavg
'''
comps = "%.2f %.2f %.2f" % os.getloadavg()
load_avg = comps.split()
return {'1-min': _number(load_avg[0]),
'5-min': _number(load_avg[1]),
'15-min': _number(load_avg[2])}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment