Advertisement
rfmonk

sysinfoV26.py

Jan 16th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # A System Information Gathering Script
  3. import subprocess
  4.  
  5. # Command 1
  6. def uname_func():
  7.  
  8.     uname = "uname"
  9.     uname_arg = "-a"
  10.     print "Gathering system information with %s command:\n" % uname
  11.     subprocess.call([uname, uname_arg])
  12.  
  13.  
  14. # Command 2
  15. def disk_func():
  16.  
  17.     diskspace = "df"
  18.     diskspace_arg = "-h"
  19.     print "Gathering diskspace information %s command:\n" % diskspace
  20.     subprocess.call([diskspace, diskspace_arg])
  21.  
  22. # Main function that call other functions
  23. def main():
  24.     uname_func()
  25.     disk_func()
  26.  
  27. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement