diff --git a/EXAMPLES b/EXAMPLES index c3b6174..be389bf 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -165,22 +165,25 @@ No time to take action specified. ... webctrl/bin$ ./wc_checkAlarms -u wsdl -f SETTINGS -i 1 -t 1 -v No password specified via -p. Please enter your WebCTRL login password now: -Appending alarm 2017-07-25 12:24:25 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung to alarmsActive -Removing alarm 2017-07-25 12:24:37 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung from alarmsActive -Appending alarm 2017-07-25 13:14:21 DI_Wasser_Sensor_Lichtschacht_TZ to alarmsActive +Appending alarm 2017-08-08 15:27:58 Geb.R Anlage 01 Sammelstrung to alarmsActive No alarms in list alarmsChecked -(datetime.datetime(2017, 7, 25, 13, 14, 21), '/Fritz-Haber-Institut/Bauteil R/Meldungen/Geb.R Meldungen', 'Geb.R Wasser-Sensor Lichtschacht Technikzentrale Keller ausgelst!', 'DI_Wasser_Sensor_Lichtschacht_TZ', 'Nicht besttigt', 'Heizung, Lftung, Klimatechnik - Allgemein', 'Unnormal') +(datetime.datetime(2017, 8, 8, 15, 27, 58), u'/Fritz-Haber-Institut/Bauteil R/Lftung/Zuluftanlage/Geb.R Zuluftanlagex', u"Geb.R Anlage 01 Sammelstrung is in an alarm state of 'ON'.", u'Geb.R Anlage 01 Sammelstrung', u'Nicht besttigt', u'Heizung, Lftung, Klimatechnik - Allgemein', u'Unnormal') Age: 0.0 -Appending alarm 2017-07-25 12:24:25 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung to alarmsActive -Removing alarm 2017-07-25 12:24:37 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung from alarmsActive +a.reminderNotification= 0 +a.firstNotification= False +----------------------------------------------------------------------------------------- No alarms in list alarmsChecked -(datetime.datetime(2017, 7, 25, 13, 14, 21), '/Fritz-Haber-Institut/Bauteil R/Meldungen/Geb.R Meldungen', 'Geb.R Wasser-Sensor Lichtschacht Technikzentrale Keller ausgelst!', 'DI_Wasser_Sensor_Lichtschacht_TZ', 'Nicht besttigt', 'Heizung, Lftung, Klimatechnik - Allgemein', 'Unnormal') +(datetime.datetime(2017, 8, 8, 15, 27, 58), u'/Fritz-Haber-Institut/Bauteil R/Lftung/Zuluftanlage/Geb.R Zuluftanlagex', u"Geb.R Anlage 01 Sammelstrung is in an alarm state of 'ON'.", u'Geb.R Anlage 01 Sammelstrung', u'Nicht besttigt', u'Heizung, Lftung, Klimatechnik - Allgemein', u'Unnormal') Age: 1.0 -Sending an e-mail to weiher@fhi-berlin.mpg.de -Appending alarm 2017-07-25 12:24:25 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung to alarmsActive -Removing alarm 2017-07-25 12:24:37 Geb.G KKUK Sekundr Pumpe Ansteuerung Strung from alarmsActive +a.reminderNotification= 1 +a.firstNotification= True +----------------------------------------------------------------------------------------- No alarms in list alarmsChecked -(datetime.datetime(2017, 7, 25, 13, 14, 21), '/Fritz-Haber-Institut/Bauteil R/Meldungen/Geb.R Meldungen', 'Geb.R Wasser-Sensor Lichtschacht Technikzentrale Keller ausgelst!', 'DI_Wasser_Sensor_Lichtschacht_TZ', 'Nicht besttigt', 'Heizung, Lftung, Klimatechnik - Allgemein', 'Unnormal') +(datetime.datetime(2017, 8, 8, 15, 27, 58), u'/Fritz-Haber-Institut/Bauteil R/Lftung/Zuluftanlage/Geb.R Zuluftanlagex', u"Geb.R Anlage 01 Sammelstrung is in an alarm state of 'ON'.", u'Geb.R Anlage 01 Sammelstrung', u'Nicht besttigt', u'Heizung, Lftung, Klimatechnik - Allgemein', u'Unnormal') Age: 2.0 +a.reminderNotification= 1 +a.firstNotification= True Sending an e-mail to weiher@fhi-berlin.mpg.de - +----------------------------------------------------------------------------------------- +No alarms in list alarmsChecked +... \ No newline at end of file diff --git a/Email.py b/Email.py index 39994f0..f468af3 100644 --- a/Email.py +++ b/Email.py @@ -6,12 +6,12 @@ from email.mime.text import MIMEText -def sendEmail (address, alarmDate, alarmLocation, alarmMessage, alarmSource): +def sendEmails (sourceAddress, addresses, alarmDate, alarmLocation, alarmMessage, alarmSource): msg = MIMEMultipart() msg['Subject'] = alarmMessage - msg['From'] = address - msg['To'] = address + msg['From'] = sourceAddress + msg['To'] = addresses content = alarmMessage + '\n' + \ 'Date: ' + str(alarmDate) + '\n' + \ 'Location: ' + alarmLocation + '\n' + \ @@ -19,18 +19,34 @@ def sendEmail (address, alarmDate, alarmLocation, alarmMessage, alarmSource): msg.attach(MIMEText(content, 'plain')) s = smtplib.SMTP('mail.fhi-berlin.mpg.de') - s.sendmail(address, address, msg.as_string()) + s.sendmail(sourceAddress, addresses, msg.as_string()) s.quit() -def getMailAddress(currentHour, mailAddresses, timePeriods): +def getMailAddresses (currentHour, mailAddresses, timePeriods): - periods = timePeriods.split(',') + periods = timePeriods.split(';') + foundAPeriod = False for n, period in enumerate(periods): - times = period.split('-') - if int(times[0]) <= currentHour < int(times[1]): - break + try: + times = period.split('-') + if int(times[0]) <= currentHour < int(times[1]): + foundAPeriod = True + break + except: + errorMessage = "ERROR: Something is wrong with the given period: " + period + " Please check it." + return errorMessage + + if not foundAPeriod: + errorMessage = "ERROR: The current hour is not contained in any of the time periods specified in the SETTINGS file." + return errorMessage + + try: + addresses = mailAddresses.split(';') + except IndexError: + errorMessage = "ERROR: There are no e-mails specified for the current time period, " + period + \ + "Please check again the SETTINGS file" + return errorMessage - addresses = mailAddresses.replace(' ','').split(',') return addresses[n] \ No newline at end of file diff --git a/Environment.py b/Environment.py index 52d7328..854f01d 100644 --- a/Environment.py +++ b/Environment.py @@ -6,12 +6,22 @@ def readSettings(file): f = open(file, 'r') settings = {} + keyEmails = '' + valueEmails = '' for line in f: - if line.startswith('WC_'): - parts = line.replace(' ', '').replace('\n','').replace("'", "").split('=') + if line.startswith("WC_ALARMS_ALERT_EMAILS"): + # Concatenate all lines that contain the e-mail addresses (the key, we need only once) + parts = line.replace(" ", "").replace("\n","").replace("'", "").split("=") + keyEmails = parts[0] + valueEmails += parts[1] + elif line.startswith("WC_"): + parts = line.replace(" ", "").replace("\n","").replace("'", "").split("=") key = parts[0] value = parts[1] settings[key] = value + # Finally add the key-value pair holding the e-mail addresses + settings[keyEmails] = valueEmails + f.close() return settings \ No newline at end of file diff --git a/README b/README index a8e2ac1..6ce6318 100644 --- a/README +++ b/README @@ -83,3 +83,39 @@ All required arguments (except the password for the WebCTRL login) need to be pa The password cannot be given via the SETTINGS file. If the password is not specified via -p you will be prompted to type it interactively. All optional arguments have default values which will be shown to you when using one of the tools. +More detailed explanation of the wc_checkAlarms tool +---------------------------------------------------- + +wc_checkAlarms checks for all alarms for a given node. For example, if '/trees/geographic' is chosen as node all alarms +in the FHI network are retrieved. The tool checks in an interval (-i option) for new alarms and the status of old +alarms. "Old alarms" are alarms that are already known to the tool but have not yet been acknowledged or solved. Once +an alarm is discovered in an "unnormal" state it is observed: Does it still exist? Has it changed its status? The +second parameter is the -t option: the time that needs to pass for an alarm until an action is taken, that is, until +an e-mail about this alarm is sent. This "take action interval" needs to be bigger than the check-for-new-alarms +interval. As it is done at the moment there will be two e-mails after an alarm has been discovered and while the alarm +remains unchecked. After these two e-mails there will be one e-mail every hour reminding of this alarm. The first two +e-mails go to a person lowest in the hierarchy. For every e-mail to follow the hierarchy increases until no more +increase is possible because no more hierarchies have been specified in the SETTINGS file. This could be a schema +for the setting of times and e-mails: + +WC_ALARMS_ALERT_PERIODS = '8-16; 16-22; 22-8' +WC_ALARMS_ALERT_EMAILS = 'person1@hierarchy1.de, person2@hierarchy1.de, ... # person1@hierarchy2.de, ... # + person1@hierarchy3.de, person2@hierarchy3.de, ...;' +WC_ALARMS_ALERT_EMAILS = 'person1@hierarchy1.de, person2@hierarchy1.de, ... # person1@hierarchy2.de, ... # + person1@hierarchy3.de, person2@hierarchy3.de, ...;' +WC_ALARMS_ALERT_EMAILS = 'person1@hierarchy1.de, person2@hierarchy1.de, ... # person1@hierarchy2.de, ... # + person1@hierarchy3.de, person2@hierarchy3.de, ...' + +A day is divided up into three time periods - all seperated by a colon(!). You can divide up the day in as many periods +as you like and the times do not necessarily need to be in chronologial order. WC_ALARMS_ALERT_EMAILS specifies the +e-mail addresses per time period (seperated by a colon) and per hierarchy within one time period (seperated by a '#'). +More than one person will get a notification if you provide a comma-seperated list of e-mail addresses. You can +specifiy as many WC_ALARMS_ALERT_EMAILS as you like. Within the programm all WC_ALARMS_ALERT_EMAILS lines will be +concatenated. You could also make it really simpel. With the following setting the same person(s) will receive an +e-mail at any time of the day: + +WC_ALARMS_ALERT_PERIODS = '0-24' +WC_ALARMS_ALERT_EMAILS = 'person1@hierarchy1.de, person2@hierarchy1.de, ...' + +ATTENTION: You should specify as many WC_ALARMS_ALERT_EMAILS lines as there are time periods in +WC_ALARMS_ALERT_PERIODS as exemplified above. diff --git a/SETTINGS b/SETTINGS index bab0111..bcda6e3 100644 --- a/SETTINGS +++ b/SETTINGS @@ -4,12 +4,6 @@ WC_NODE = '#km_speicher_fel' WC_URL = 'https://webctrl.rz-berlin.mpg.de' WC_VERBOSITY = -# wc_checkAlarms -WC_ALARMS_ALERT_EMAIL = 'weiher@fhi-berlin.mpg.de,weiher@fhi-berlin.mpg.de,weiher@fhi-berlin.mpg.de' -WC_ALARMS_ALERT_PERIODS = '8-16,16-22,22-8' -WC_ALARMS_INTERVAL = -WC_ALARMS_TAKEACTION = - # wc_getReport WC_REPORT_TYPE = '~point-list-report' @@ -17,4 +11,12 @@ WC_REPORT_TYPE = '~point-list-report' WC_TREND_STIME = WC_TREND_ETIME = WC_TREND_LIMIT = -WC_TREND_MAXREC = \ No newline at end of file +WC_TREND_MAXREC = + +# wc_checkAlarms +WC_ALARMS_INTERVAL = +WC_ALARMS_TAKEACTION = +WC_ALARMS_ALERT_PERIODS = '8-16;16-22; 22-8' +WC_ALARMS_ALERT_EMAILS = 'weiher@fhi-berlin.mpg.de # weiher@fhi-berlin.mpg.de # weiher@fhi-berlin.mpg.de;' +WC_ALARMS_ALERT_EMAILS = 'weiher@fhi-berlin.mpg.de # weiher@fhi-berlin.mpg.de # weiher@fhi-berlin.mpg.de;' +WC_ALARMS_ALERT_EMAILS = 'weiher@fhi-berlin.mpg.de # weiher@fhi-berlin.mpg.de' diff --git a/alarm.py b/alarm.py index 638a1db..42a545e 100644 --- a/alarm.py +++ b/alarm.py @@ -6,8 +6,6 @@ class alarm: def __init__(self, date, age, standort, message, quelle, bestaetigtVon, kategorie, status): self.date = date self.age = age - #self.oldAge = None - self.stillActive = False self.standort = standort self.message = message self.quelle = quelle @@ -15,5 +13,7 @@ def __init__(self, date, age, standort, message, quelle, bestaetigtVon, kategori self.kategorie = kategorie self.status = status + self.stillActive = False self.firstNotification = False self.reminderNotification = 0 + self.notificationHierarchy = 0 \ No newline at end of file diff --git a/wc_checkAlarms.py b/wc_checkAlarms.py index 6cc5521..3cae2a0 100644 --- a/wc_checkAlarms.py +++ b/wc_checkAlarms.py @@ -8,7 +8,7 @@ from alarm import alarm from time import sleep import datetime -from Email import sendEmail,getMailAddress +from Email import getMailAddresses, sendEmails from Environment import readSettings @@ -146,11 +146,25 @@ def main(args): takeActionTime = takeAction if takeActionTime < checkForNewAlarmsInterval: - print 'The time after which action is taken for not acknowledged alarms is smaller than the interval for checking' + \ - 'for new alarms: ' + str(takeActionTime) + ' < ' + str(checkForNewAlarmsInterval) - print 'The take action time should be bigger or equal to the checking for new alarms time. Exiting now...' + print 'The time after which action is taken for not acknowledged alarms is smaller than the interval for checking' \ + 'for new alarms: ' + str(takeActionTime) + ' < ' + str(checkForNewAlarmsInterval) + \ + 'The take action time should be bigger or equal to the checking for new alarms time.Exiting now...' sys.exit(1) + errorMessage = "Either (or both) information about alarm time periods or e-mails is missing. Please set them in " \ + "the settings file." + try: + if not settings['WC_ALARMS_ALERT_PERIODS'] or not settings['WC_ALARMS_ALERT_EMAILS']: + print(errorMessage) + sys.exit(1) + except KeyError: + print(errorMessage) + sys.exit(1) + + # Setting two further "defaults": + numberOfReminders = 2 + loopThroughHierarchiesInterval = 60.0 # unit: minutes + #################################################################################################################### ### Connect to the webCTRL server #################################################################################################################### @@ -240,31 +254,29 @@ def main(args): # the check/solution to a prior alarm with status e.g. 'unnormal': removedAlarm = False for a in alarmsActive: - if a.quelle == quelle: + if a.quelle == quelle and a.date == date: # Remove alarm from running and do not append to checked removedAlarm = True alarmsActive.remove(a) - if verbosity: print('Removing alarm ' + str(date) + ' ' + quelle + ' from alarmsActive') + if verbosity: print('Removing alarm ' + str(a.date) + ' ' + a.quelle + ' from alarmsActive') if not removedAlarm: # Ignore the alarms that have a 'Normal' status without another matching alarm with 'Unnormal' # status because it's already solved pass else: - # Before appending the current alarm to the list of alarms check if this alarm is already contained - # in the list: + # Alarms with "Unnormal" status; before appending the current alarm to the list of alarms check if + # this alarm is already contained in the list: alarmAlreadyKnown = False for a in alarmsActive: if a.quelle == quelle and a.date == date: # This alarm is already known; move on to the next alarm alarmAlreadyKnown = True # Observe the age of the alarm, i.e, increase the age by the time interval in which new alarms are caught - #a.oldAge = a.age a.age += checkForNewAlarmsInterval a.stillActive = True if not alarmAlreadyKnown: if verbosity: print('Appending alarm ' + str(date) + ' ' + quelle + ' to alarmsActive') age = 0.0 - #alarmsActive.append(alarm(date, age, standort, message, quelle, bestaetigtVon, kategorie, status)) a = alarm(date, age, standort, message, quelle, bestaetigtVon, kategorie, status) a.stillActive = True alarmsActive.append(a) @@ -276,11 +288,12 @@ def main(args): else: print('No alarms in list alarmsChecked') + # Handling of active alarms, e.g., send a notification e-mail depending on the age of an alarm if alarmsActive: for a in alarmsActive: # Remove "Zombi alarms", that is, alarms that are still marked as active but do not appear in the retrieved - # alarms list anymore. So, these alarms were acknowledged/solved AND deleted between two alarms retrievals + # alarms list anymore. So, these alarms were acknowledged/solved AND deleted between two alarms retrievals. if not a.stillActive: if verbosity: print("This alarm seems to have been solved and deleted so we're removing it from the list of active alarms:") @@ -294,19 +307,37 @@ def main(args): print 'a.reminderNotification= ' + str(a.reminderNotification) print 'a.firstNotification= ' + str(a.firstNotification) - numberOfReminders = 3 + # Initialisations in case there hasn't been any e-mail yet about this alarm if not a.firstNotification: - # The first notification mail about an alarm a.firstNotification = True a.reminderNotification = 0 # Check the age of the still active alarms and take action in case of, for example, the age is greater than e.g. 20 min - #if a.age >= takeActionTime: - if a.age >= takeActionTime and (a.age % takeActionTime == 0) and a.reminderNotification < numberOfReminders+1: - currentHour = datetime.datetime.now().hour - mailAddress = getMailAddress(currentHour, settings['WC_ALARMS_ALERT_EMAIL'], settings['WC_ALARMS_ALERT_PERIODS']) - if verbosity: print 'Sending an e-mail to ' + mailAddress - sendEmail(mailAddress, a.date, a.standort, a.message, a.quelle) + sourceMailAddress = 'ppb@fhi-berlin.mpg.de' + currentHour = datetime.datetime.now().hour + allMailAddressesForCurrentPeriod = getMailAddresses(currentHour, settings['WC_ALARMS_ALERT_EMAILS'], settings['WC_ALARMS_ALERT_PERIODS']) + if allMailAddressesForCurrentPeriod.startswith("ERROR"): + print(allMailAddressesForCurrentPeriod) + print("Exiting now...") + sys.exit(1) + addresses = allMailAddressesForCurrentPeriod.split("#") + # Select the correct mail addresses depending on the hierarchy: + if a.reminderNotification < numberOfReminders+1: + if a.age >= takeActionTime and (a.age % takeActionTime == 0): + mailAddresses = addresses[a.notificationHierarchy] + if verbosity: print 'Sending an e-mail to ' + mailAddresses + sendEmails(sourceMailAddress, mailAddresses, a.date, a.standort, a.message, a.quelle) + else: + if (a.age - takeActionTime * numberOfReminders) % loopThroughHierarchiesInterval == 0: + a.notificationHierarchy += 1 + try: + mailAddresses = addresses[a.notificationHierarchy] + except IndexError: + print("Index Error! a.notificationHierarchy = " + str(a.notificationHierarchy)) + # get the addresses of the highest hierarchy no matter what the index is at the moment + mailAddresses = addresses[-1] + if verbosity: print("Sending an e-mail at age = " + str(a.age) + " to: " + mailAddresses) + sendEmails(sourceMailAddress, mailAddresses, a.date, a.standort, a.message, a.quelle) if a.firstNotification and (a.age % takeActionTime == 0) and 0 <= a.reminderNotification < numberOfReminders + 1: # Only send a small amount of reminder mails about an alarm because we don't want the recipient to get spamed @@ -317,7 +348,6 @@ def main(args): else: if verbosity: print('No alarms in list alarmsActive') - if verbosity: print('-----------------------------------------------------------------------------------------') # sleep for n minutes @@ -338,12 +368,10 @@ def main(args): required.add_argument('--password', '-p', type=str, default=None, help='Password for the login to the WebCTRL server') required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') - optional.add_argument('--verbosity', '-v', action='store_true', default=None, help="If '-v' is selected you'll get verbose output") - optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") optional.add_argument('--node', '-n', type=str, default=None, - help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') + help="Path to the point or node for which you want to retrieve all alarms. If '-n /trees/geographic' you'll get all alarms in the network.") optional.add_argument('-interval', '-i', type=int, default=None, help="Interval in MINUTES in which the script checks for new alarms") optional.add_argument('-takeAction', '-a', type=int, default=None, help="Time in MINUTES after which an action is taken if an alarm still hasn't been acknowledged") args = parser.parse_args() diff --git a/wc_getReport.py b/wc_getReport.py index 59091c8..a014af0 100644 --- a/wc_getReport.py +++ b/wc_getReport.py @@ -185,8 +185,7 @@ def main(args): required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") - optional.add_argument('--node', '-n', type=str, default=None, - help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') + optional.add_argument('--node', '-n', type=str, default=None, help='Path to the point or node for which you want to get a report') optional.add_argument('-reportType', '-t', type=str, default=None, help="The type of the report: ~schedule-instance, ~effective-schedule, ~point-list-report, ~locked-value, \ ~network-io, ~test-and-balance, ~equipment-checkout, ~audit-log, ~alarms, ~alarm-source, ~network-status, \ diff --git a/wc_getTrend.py b/wc_getTrend.py index 21239e9..4e126b1 100644 --- a/wc_getTrend.py +++ b/wc_getTrend.py @@ -203,8 +203,7 @@ def main(args): required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") - optional.add_argument('--node', '-n', type=str, default=None, - help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') + optional.add_argument('--node', '-n', type=str, default=None, help='Path to the point or node for which you want to get the trend') optional.add_argument('--sTime', '-s', type=str, default=None, help="Start Time. Returns trend data values starting with this time. Like this: 'MM/DD/YYYY HH:MM:SS AM'.") optional.add_argument('--eTime', '-e', type=str, default=None, diff --git a/wc_getValue.py b/wc_getValue.py index c61adc8..f263981 100644 --- a/wc_getValue.py +++ b/wc_getValue.py @@ -133,8 +133,7 @@ def main(args): required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") - optional.add_argument('--node', '-n', type=str, default=None, - help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') + optional.add_argument('--node', '-n', type=str, default=None, help='Path to the point or node whose value you want to retrieve') args = parser.parse_args() # Get the password if it hasn't been passed as argument diff --git a/wc_monitor.py b/wc_monitor.py index e24182d..31b363f 100644 --- a/wc_monitor.py +++ b/wc_monitor.py @@ -145,9 +145,8 @@ def main(args): required.add_argument('--password', '-p', type=str, default=None, help='Password for the login to the WebCTRL server') required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') - optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") - optional.add_argument('--node', '-n', type=str, default=None, - help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') + optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'") + optional.add_argument('--node', '-n', type=str, default=None, help='Path to the point or node that you want to monitor') args = parser.parse_args() # Get the password if it hasn't been passed as argument diff --git a/wc_query.py b/wc_query.py index 41c6d60..c07ef50 100644 --- a/wc_query.py +++ b/wc_query.py @@ -127,7 +127,7 @@ def main(args): required.add_argument('--password', '-p', type=str, default=None, help='Password for the login to the WebCTRL server') required.add_argument('--settingsFile', '-f', type=str, default=None, help='File name of settings containing WC_* variables') required.add_argument('--username', '-u', type=str, default=None, help='Username for the login to the WebCTRL server') - optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'.") + optional.add_argument('--url', '-url', type=str, default=None, help="URL of the webctrl server like 'http(s)://webctrl.de'") optional.add_argument('--node', '-n', type=str, default=None, help='Path to the point or node whose children you want to retrieve. Start querying at the lowest level with "-n /trees/geographic"') args = parser.parse_args()