5 from datetime import datetime
6 from optparse import OptionParser
7 from geni.util.rspec import Rspec
9 sfi_dir = os.path.expanduser("~/.sfi/")
14 usage = "%(command)s [options]" % locals()
15 description = """getNodes will query comon and generate a list of nodes
16 (plain or rspec) that meet the specified crieteria. If no criteria is
17 specified, the default action is to return node comon considers 'alive'
20 cmp_options = ['rwfs', 'uptime', 'loads', 'meminfo', 'kernver', 'cpuspeed', 'txrate', 'rxrate', 'numslices', 'liveslices']
23 parser = OptionParser(usage=usage,description=description)
25 parser.add_option("--%s" % opt, dest="%s" % opt, action="store_true",
26 help = "available options [%s]" % ",".join(cmp_options))
32 month = str(date.month)
34 for num in [year, month, day]:
38 comon_data_file = sfi_dir + os.sep + "comon_data.dat"
39 comon_url = "http://comon.cs.princeton.edu/status/dump_comon_%s%s%s" % (year, month, day)
41 # wget comon data and save it
46 parser = create_parser()
51 if __name__ == '__main__':