Shitty handling of arguments, but needed for initial version of rc-scripts...
This commit is contained in:
@@ -189,8 +189,6 @@ class UpdateRRD:
|
|||||||
logging.error('Not sure what to do here? ' + str(input_dict) + str(self.toupdate))
|
logging.error('Not sure what to do here? ' + str(input_dict) + str(self.toupdate))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
rrdfile = 'test.rrd'
|
|
||||||
rrdupdater = UpdateRRD(rrdfile)
|
|
||||||
try:
|
try:
|
||||||
client_host = sys.argv[1]
|
client_host = sys.argv[1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
@@ -199,9 +197,14 @@ def main():
|
|||||||
try:
|
try:
|
||||||
client_port = int(sys.argv[2])
|
client_port = int(sys.argv[2])
|
||||||
except (ValueError, IndexError):
|
except (ValueError, IndexError):
|
||||||
#We're fine on our own
|
logging.error('Need port as second argument')
|
||||||
client_port = 9999
|
sys.exit()
|
||||||
|
try:
|
||||||
|
rrdfile = sys.argv[3]
|
||||||
|
except IndexError:
|
||||||
|
logging.error('Need rrdfile as third argument')
|
||||||
|
|
||||||
|
rrdupdater = UpdateRRD(rrdfile)
|
||||||
client = routerstats_client(client_host, client_port)
|
client = routerstats_client(client_host, client_port)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user