From 0ba784b60d2ae0eef086afb0c7017c571322f152 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Mon, 22 May 2017 23:56:48 -0300 Subject: [PATCH 01/18] adding graph_csv --- graph_csv.py | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 graph_csv.py diff --git a/graph_csv.py b/graph_csv.py new file mode 100644 index 0000000..de45e8e --- /dev/null +++ b/graph_csv.py @@ -0,0 +1,96 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Copyright (C) 2017 Unicamp-OpenPower +Licensed under the Apache License, Version 2.0 (the “License”); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import argparse +import thread +import time +import os + +INTERVAL = 10 + +#function used to build the ipmi and csv commands +def build_commands(args): + year = time.strftime("%Y") + month = int(time.strftime("%m")) + # DO NOT FORGET TO CHANGE THIS AFTER TESTING + day = int(time.strftime("%d")) + 1 + date=str(year)+str(month)+str(day) + + csv_command = 'python2.7 csvcreator.py --name=last --date='+date+' --jsonfile=' + csv_command = csv_command + args.jsonfile + + ipmi_command = 'python2.7 powergraph.py' + if not args.host: + print "\nERROR: hostname is required.\n" + parser.print_help() + sys.exit(1) + else: + ipmi_command += ' --host='+args.host + if args.port: + ipmi_command += ' --port='+args.port + if not args.user: + print "\nERROR: username is required.\n" + parser.print_help() + sys.exit(1) + else: + ipmi_command += ' --user='+args.user + if args.passwd: + ipmi_command += ' --passwd='+args.passwd + if args.interval: + ipmi_command += ' --interval='+args.interval + else: + ipmi_command += ' --interval=1' + ipmi_command += ' --store' + + return ipmi_command,csv_command + +#function to get the arguments from the user +def get_input(): + parser = argparse.ArgumentParser(description='Parameters') + + parser.add_argument('--host', help='adress of the host') + parser.add_argument('--port', help='port of IPMI host') + parser.add_argument('--user', help='user allowed to acces IPMI') + parser.add_argument('--passwd', + help='password for the specific user') + parser.add_argument('--interval', + help='seconds between each data reading') + parser.add_argument('--nread', + help='number of time to collect data') + + parser.add_argument('--jsonfile', + help='jsonfile to be converted as csv') + return parser.parse_args() + +#function to run the collection of data +def run_collector(command): + os.system(command) + +#function to run the csv generator +def run_csv(command): + while 1: + time.sleep(300) + os.system(command) + os.system("tail -n 300 last.csv > aux.csv") + os.system("mv aux.csv last.csv") + +args = get_input() +ipmi_command, csv_command = build_commands(args) + +thread.start_new_thread(run_collector,(ipmi_command,)) +thread.start_new_thread(run_csv,(csv_command,)) + +while 1: + pass From 6d10297a7d11939547224aaa7c0c490e708dc0bd Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 23 May 2017 00:01:17 -0300 Subject: [PATCH 02/18] updating readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 86776be..c726698 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,12 @@ Run ```csvcreator.py``` like this: ``` python2.7 csvcreator.py --jsonfile="generated_json_name" ``` + +The ```graph_csv.py``` runs the ```powergraph.py``` and, from time +to time, creates a new csv file, with the latest measures. To run it, +type: + +``` +python2.7 powergraph.py --host="server address" --port="server port" --user="allowed user" --passwd="password for this user +--jsonfile="path to bd jsonfile" +``` From 52fe43963b5d2967d398a9fc58e3fe2ec4e9a547 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 23 May 2017 20:43:22 -0300 Subject: [PATCH 03/18] fixing the feedback problem while storing data --- powergraph.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/powergraph.py b/powergraph.py index 9cc89be..44a9bdc 100755 --- a/powergraph.py +++ b/powergraph.py @@ -25,7 +25,7 @@ NREAD = 10 INFINITY = False STORE = False - +FEEDBACK = False def savedb(input): """ @@ -97,6 +97,9 @@ def get_input(): parser.add_argument('--nread', help='number of time to collect data') parser.add_argument('--store', action='store_true', help='save the data collected in a nosql db') + parser.add_argument('--feedback', action='store_true', + help='print the collecting status') + args = parser.parse_args() return args, parser @@ -135,6 +138,9 @@ def build_command(args, parser): if args.store: global STORE STORE = True + if args.feedback: + global FEEDBACK + FEEDBACK = True return cmd @@ -161,7 +167,7 @@ def run(command, counter): infos['Year'] = aux[2][2:6] infos['Energy'] = energy info = create_string(counter + 1, infos) - if not STORE: + if not STORE or FEEDBACK: print info else: savedb(info.split('|')) From de5b2c41942050a4af37e0dd2f3ea8750840acb3 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 23 May 2017 20:46:09 -0300 Subject: [PATCH 04/18] updating readme with --feedback information --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c726698..30c4c94 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ python2.7 powergraph.py --host="server address" --port="server port" --user="all ``` You can use the optional parameter ```--store``` in order to save the infos as json on tinydb. Without this parameter, the script will -print on the terminal. +print on the terminal. Besides, you can use ```--feedback``` with store +in order to see the measures status. Run ```csvcreator.py``` like this: From 1bb4df60cc5cc17bd5015376e6813467b4c6794d Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Wed, 24 May 2017 19:17:04 -0300 Subject: [PATCH 05/18] fixing pull request --- graph_csv.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/graph_csv.py b/graph_csv.py index de45e8e..dc41c6d 100644 --- a/graph_csv.py +++ b/graph_csv.py @@ -20,12 +20,13 @@ INTERVAL = 10 -#function used to build the ipmi and csv commands def build_commands(args): + """ + function used to build the ipmi and csv commands + """ year = time.strftime("%Y") month = int(time.strftime("%m")) - # DO NOT FORGET TO CHANGE THIS AFTER TESTING - day = int(time.strftime("%d")) + 1 + day = int(time.strftime("%d")) date=str(year)+str(month)+str(day) csv_command = 'python2.7 csvcreator.py --name=last --date='+date+' --jsonfile=' @@ -56,8 +57,10 @@ def build_commands(args): return ipmi_command,csv_command -#function to get the arguments from the user def get_input(): + """ + function to get the arguments from the user + """ parser = argparse.ArgumentParser(description='Parameters') parser.add_argument('--host', help='adress of the host') @@ -74,12 +77,16 @@ def get_input(): help='jsonfile to be converted as csv') return parser.parse_args() -#function to run the collection of data def run_collector(command): + """ + function to run the collection of data + """ os.system(command) -#function to run the csv generator def run_csv(command): + """ + function to run the csv generator + """ while 1: time.sleep(300) os.system(command) From 6fcdffdf9da790ce6b00d898fd716e3fad0ed331 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Wed, 24 May 2017 19:24:36 -0300 Subject: [PATCH 06/18] fixing + --- graph_csv.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graph_csv.py b/graph_csv.py index dc41c6d..c1cefae 100644 --- a/graph_csv.py +++ b/graph_csv.py @@ -29,7 +29,7 @@ def build_commands(args): day = int(time.strftime("%d")) date=str(year)+str(month)+str(day) - csv_command = 'python2.7 csvcreator.py --name=last --date='+date+' --jsonfile=' + csv_command = 'python2.7 csvcreator.py --name=last --date=' + date + ' --jsonfile=' csv_command = csv_command + args.jsonfile ipmi_command = 'python2.7 powergraph.py' @@ -38,19 +38,19 @@ def build_commands(args): parser.print_help() sys.exit(1) else: - ipmi_command += ' --host='+args.host + ipmi_command += ' --host=' + args.host if args.port: - ipmi_command += ' --port='+args.port + ipmi_command += ' --port=' + args.port if not args.user: print "\nERROR: username is required.\n" parser.print_help() sys.exit(1) else: - ipmi_command += ' --user='+args.user + ipmi_command += ' --user=' + args.user if args.passwd: - ipmi_command += ' --passwd='+args.passwd + ipmi_command += ' --passwd=' + args.passwd if args.interval: - ipmi_command += ' --interval='+args.interval + ipmi_command += ' --interval=' + args.interval else: ipmi_command += ' --interval=1' ipmi_command += ' --store' From 7a35aace59ac62d55c580e053a18324b94f67c3d Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Wed, 24 May 2017 19:38:19 -0300 Subject: [PATCH 07/18] adding csv_interval parameter --- graph_csv.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100644 => 100755 graph_csv.py diff --git a/graph_csv.py b/graph_csv.py old mode 100644 new mode 100755 index c1cefae..0d75879 --- a/graph_csv.py +++ b/graph_csv.py @@ -32,6 +32,12 @@ def build_commands(args): csv_command = 'python2.7 csvcreator.py --name=last --date=' + date + ' --jsonfile=' csv_command = csv_command + args.jsonfile + if args.csv_interval: + global CSV_INTERVAL + CSV_INTERVAL = args.csv_interval + else: + CSV_INTERVAL = 300 + ipmi_command = 'python2.7 powergraph.py' if not args.host: print "\nERROR: hostname is required.\n" @@ -75,6 +81,9 @@ def get_input(): parser.add_argument('--jsonfile', help='jsonfile to be converted as csv') + parser.add_argument('--csv_interval', + help='interval you want to create a new csv file') + return parser.parse_args() def run_collector(command): @@ -88,7 +97,7 @@ def run_csv(command): function to run the csv generator """ while 1: - time.sleep(300) + time.sleep(CSV_INTERVAL) os.system(command) os.system("tail -n 300 last.csv > aux.csv") os.system("mv aux.csv last.csv") From fa76dca3fed72ea624a8f472b0ce60717c0ffa4a Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Wed, 24 May 2017 19:49:05 -0300 Subject: [PATCH 08/18] updating readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30c4c94..6039c72 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ python2.7 powergraph.py --host="server address" --port="server port" --user="all You can use the optional parameter ```--store``` in order to save the infos as json on tinydb. Without this parameter, the script will print on the terminal. Besides, you can use ```--feedback``` with store -in order to see the measures status. +in order to see the measures status. If you want to set the time interval that a new csv file is +generated, you can use the flag ```csav_interval```. Run ```csvcreator.py``` like this: From 643a94666881f6890424700762adfd95a0746d4b Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Wed, 24 May 2017 20:09:45 -0300 Subject: [PATCH 09/18] minor fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6039c72..2c49fd5 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You can use the optional parameter ```--store``` in order to save the infos as json on tinydb. Without this parameter, the script will print on the terminal. Besides, you can use ```--feedback``` with store in order to see the measures status. If you want to set the time interval that a new csv file is -generated, you can use the flag ```csav_interval```. +generated, you can use the flag ```csv_interval```. Run ```csvcreator.py``` like this: From 2c71dc6ad7b055054715f65787b032afec55bb94 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Thu, 25 May 2017 15:10:32 -0300 Subject: [PATCH 10/18] fixing required arguments --- graph_csv.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/graph_csv.py b/graph_csv.py index 0d75879..ded09f7 100755 --- a/graph_csv.py +++ b/graph_csv.py @@ -69,18 +69,21 @@ def get_input(): """ parser = argparse.ArgumentParser(description='Parameters') - parser.add_argument('--host', help='adress of the host') - parser.add_argument('--port', help='port of IPMI host') - parser.add_argument('--user', help='user allowed to acces IPMI') + parser.add_argument('--host', + help='adress of the host', required=True) + parser.add_argument('--port', + help='port of IPMI host', required=True) + parser.add_argument('--user', + help='user allowed to acces IPMI', required=True) parser.add_argument('--passwd', - help='password for the specific user') + help='password for the specific user', required=True) parser.add_argument('--interval', help='seconds between each data reading') parser.add_argument('--nread', help='number of time to collect data') parser.add_argument('--jsonfile', - help='jsonfile to be converted as csv') + help='jsonfile to be converted as csv', required=True) parser.add_argument('--csv_interval', help='interval you want to create a new csv file') From c374dd836552509282e47235e86e3101d83a7a0a Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Thu, 25 May 2017 17:05:04 -0300 Subject: [PATCH 11/18] adding float CSV_INTERNAL --- graph_csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph_csv.py b/graph_csv.py index ded09f7..9e185a8 100755 --- a/graph_csv.py +++ b/graph_csv.py @@ -100,7 +100,7 @@ def run_csv(command): function to run the csv generator """ while 1: - time.sleep(CSV_INTERVAL) + time.sleep(float(CSV_INTERVAL)) os.system(command) os.system("tail -n 300 last.csv > aux.csv") os.system("mv aux.csv last.csv") From ef5d7cf49d5058d726d01ff95416a04962145c56 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Fri, 26 May 2017 11:04:49 -0300 Subject: [PATCH 12/18] mv now forces --- graph_csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph_csv.py b/graph_csv.py index 9e185a8..a6266b4 100755 --- a/graph_csv.py +++ b/graph_csv.py @@ -103,7 +103,7 @@ def run_csv(command): time.sleep(float(CSV_INTERVAL)) os.system(command) os.system("tail -n 300 last.csv > aux.csv") - os.system("mv aux.csv last.csv") + os.system("mv -f aux.csv last.csv") args = get_input() ipmi_command, csv_command = build_commands(args) From 104acd4726ca945b71eb5a40ea4b1548c9b6e25a Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Fri, 26 May 2017 19:45:11 -0300 Subject: [PATCH 13/18] fixing graph_csv and adding killer.sh --- README.md | 4 ++- csvcreator.py | 2 ++ graph_csv.py | 72 +++++++++++++++++++++++++++++++++++---------------- killer.sh | 28 ++++++++++++++++++++ 4 files changed, 83 insertions(+), 23 deletions(-) create mode 100755 killer.sh diff --git a/README.md b/README.md index 2c49fd5..9c056fa 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ You can use the optional parameter ```--store``` in order to save the infos as json on tinydb. Without this parameter, the script will print on the terminal. Besides, you can use ```--feedback``` with store in order to see the measures status. If you want to set the time interval that a new csv file is -generated, you can use the flag ```csv_interval```. +generated, you can use the flag ```--csv_interval```. The +```--tail_length``` is used to set the number of lines the csv +file will have. Run ```csvcreator.py``` like this: diff --git a/csvcreator.py b/csvcreator.py index 03bce02..4110190 100755 --- a/csvcreator.py +++ b/csvcreator.py @@ -66,6 +66,8 @@ def readdbtable(json_file_data, table_name): # Creates two separeted lists that will be the coluns in # the csv file. One is for the time and another for the # watts + timelist.append('date') + wattslist.append('consumption') for iten in dbdict: # print iten, dbdict[iten], timedict[dbdict[iten]] timelist.append(dbdict[iten]) diff --git a/graph_csv.py b/graph_csv.py index a6266b4..2fd638c 100755 --- a/graph_csv.py +++ b/graph_csv.py @@ -19,6 +19,7 @@ import os INTERVAL = 10 +PYTHON_VERSION = 'python2.7' def build_commands(args): """ @@ -29,7 +30,8 @@ def build_commands(args): day = int(time.strftime("%d")) date=str(year)+str(month)+str(day) - csv_command = 'python2.7 csvcreator.py --name=last --date=' + date + ' --jsonfile=' + csv_command = PYTHON_VERSION + ' csvcreator.py --name=last --date=' + date + \ + ' --jsonfile=' csv_command = csv_command + args.jsonfile if args.csv_interval: @@ -38,30 +40,30 @@ def build_commands(args): else: CSV_INTERVAL = 300 - ipmi_command = 'python2.7 powergraph.py' + powergraph_command = PYTHON_VERSION + ' powergraph.py' if not args.host: print "\nERROR: hostname is required.\n" parser.print_help() sys.exit(1) else: - ipmi_command += ' --host=' + args.host + powergraph_command += ' --host=' + args.host if args.port: - ipmi_command += ' --port=' + args.port + powergraph_command += ' --port=' + args.port if not args.user: print "\nERROR: username is required.\n" parser.print_help() sys.exit(1) else: - ipmi_command += ' --user=' + args.user + powergraph_command += ' --user=' + args.user if args.passwd: - ipmi_command += ' --passwd=' + args.passwd + powergraph_command += ' --passwd=' + args.passwd if args.interval: - ipmi_command += ' --interval=' + args.interval + powergraph_command += ' --interval=' + args.interval else: - ipmi_command += ' --interval=1' - ipmi_command += ' --store' + powergraph_command += ' --interval=1' + powergraph_command += ' --store' - return ipmi_command,csv_command + return powergraph_command,csv_command def get_input(): """ @@ -86,6 +88,11 @@ def get_input(): help='jsonfile to be converted as csv', required=True) parser.add_argument('--csv_interval', help='interval you want to create a new csv file') + parser.add_argument('--tail_length', + help='the amount of inputs do get from the csv file ' + 'in order to create the input for the graphic ' + 'visualization', + default=300) return parser.parse_args() @@ -93,23 +100,44 @@ def run_collector(command): """ function to run the collection of data """ - os.system(command) + try: + os.system(command) + except OSError as err: + print ("OS erros: {0}".format(err)) + -def run_csv(command): +def run_csv(command,tail_length): """ function to run the csv generator """ - while 1: + while True: time.sleep(float(CSV_INTERVAL)) - os.system(command) - os.system("tail -n 300 last.csv > aux.csv") - os.system("mv -f aux.csv last.csv") + try: + os.system(command) + os.system("tail -n 300 last.csv > aux.csv") + os.system("mv -f aux.csv last.csv") + except OSError as err: + print("OS error: {0}".format(err)) + +def main(): + """ + Main execution. + """ + args = get_input() + powergraph_command, csv_command = build_commands(args) + thread.start_new_thread(run_collector, (powergraph_command,)) + thread.start_new_thread(run_csv, (csv_command, args.tail_length, )) + try: + while True: + pass + except (KeyboardInterrupt, SystemExit): + print "\nExecution cancelled. Bye!" + sys.exit(1) -args = get_input() -ipmi_command, csv_command = build_commands(args) -thread.start_new_thread(run_collector,(ipmi_command,)) -thread.start_new_thread(run_csv,(csv_command,)) +if __name__ == "__main__": + """ + Invoking the main execution function. + """ + main() -while 1: - pass diff --git a/killer.sh b/killer.sh new file mode 100755 index 0000000..86d24e3 --- /dev/null +++ b/killer.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#script made to make sure the ipmi data collector is running. +#used alongside with crontab + +#name of the process that can be running to get data +threads=('powergraph.py' 'graph_csv.py') + +#get size of the threads array +size=$(echo ${#threads[@]}) +size=$(echo "$size-1" | bc) + +for i in $(seq 0 $size); do + #if the number of procees running are only one, so its the grep itself + #and nedd to be restarted + ps_size=$(ps aux | grep ${threads[i]} | wc -l) + if [ "$ps_size" == 1 ]; then + for i in $(seq 0 $size); do + for pid in $(pgrep -f ${threads[i]}); do + kill $pid + done + done + #comando to launch the data getter again + python2.7 graph_csv.py --host=177.220.10.134 --port=20006 \ + --user=$IPMI_USER --passwd=$IPMI_PASS \ + --interval=1 --jsonfile=powerdata.json & + fi +done From 390b1db50a6e1a10e7862d08381cb64fc84b7084 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Fri, 26 May 2017 19:49:20 -0300 Subject: [PATCH 14/18] fixing --- killer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/killer.sh b/killer.sh index 86d24e3..6b25dfd 100755 --- a/killer.sh +++ b/killer.sh @@ -21,7 +21,7 @@ for i in $(seq 0 $size); do done done #comando to launch the data getter again - python2.7 graph_csv.py --host=177.220.10.134 --port=20006 \ + python2.7 graph_csv.py --host=$IPMI_HOST --port=IPMI_PORT \ --user=$IPMI_USER --passwd=$IPMI_PASS \ --interval=1 --jsonfile=powerdata.json & fi From 13f31d53b05aacca53bb8c19e80767be8f63d969 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Fri, 26 May 2017 20:18:31 -0300 Subject: [PATCH 15/18] fixing --- killer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/killer.sh b/killer.sh index 6b25dfd..d09f5c7 100755 --- a/killer.sh +++ b/killer.sh @@ -21,8 +21,8 @@ for i in $(seq 0 $size); do done done #comando to launch the data getter again - python2.7 graph_csv.py --host=$IPMI_HOST --port=IPMI_PORT \ - --user=$IPMI_USER --passwd=$IPMI_PASS \ + python2.7 graph_csv.py --host='' --port='' \ + --user='' --passwd='' \ --interval=1 --jsonfile=powerdata.json & fi done From 5b34661159afd716ac3ee952e5abd570f5d86851 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 30 May 2017 20:18:22 -0300 Subject: [PATCH 16/18] fixing readme --- README.md | 4 ++++ killer.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c056fa..ee5910b 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ Run ```csvcreator.py``` like this: python2.7 csvcreator.py --jsonfile="generated_json_name" ``` +There are two optional arguments: ```--date```, to create the csv only with +the data from a specific day and ```--name```, with the name you want your +```csv``` file. + The ```graph_csv.py``` runs the ```powergraph.py``` and, from time to time, creates a new csv file, with the latest measures. To run it, type: diff --git a/killer.sh b/killer.sh index d09f5c7..dc3f45c 100755 --- a/killer.sh +++ b/killer.sh @@ -21,8 +21,8 @@ for i in $(seq 0 $size); do done done #comando to launch the data getter again - python2.7 graph_csv.py --host='' --port='' \ - --user='' --passwd='' \ + python2.7 graph_csv.py --host='' --port='' \ + --user='' --passwd=' \ --interval=1 --jsonfile=powerdata.json & fi done From b46493fe54fb461de97dd3be541e905304819d76 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 30 May 2017 20:31:48 -0300 Subject: [PATCH 17/18] fixing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee5910b..5bc7fd8 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,6 @@ to time, creates a new csv file, with the latest measures. To run it, type: ``` -python2.7 powergraph.py --host="server address" --port="server port" --user="allowed user" --passwd="password for this user +python2.7 graph_csv.py --host="server address" --port="server port" --user="allowed user" --passwd="password for this user --jsonfile="path to bd jsonfile" ``` From 4475c168f5da9c57c8ece66a020cbea712d4e215 Mon Sep 17 00:00:00 2001 From: Guilhermeslucas Date: Tue, 30 May 2017 20:45:45 -0300 Subject: [PATCH 18/18] explaining optional arguments --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5bc7fd8..16ed4c7 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,9 @@ type: python2.7 graph_csv.py --host="server address" --port="server port" --user="allowed user" --passwd="password for this user --jsonfile="path to bd jsonfile" ``` + +Besides, you can use the following optional arguments: +- interval: interval between each ipmi measure (default=10) +- nread: number of ipmi measures to be done (default=infinity) +- csv_interval: interval that a new csv file is made (deafult=300s) +- tail_length: size of the csv files (default=300)