diff --git a/wazuh-ntfy-notifier.py b/wazuh-ntfy-notifier.py index 334a825..19cd77a 100755 --- a/wazuh-ntfy-notifier.py +++ b/wazuh-ntfy-notifier.py @@ -75,11 +75,14 @@ yc_args = [notifier, d_server, d_sender, d_destination, d_priority, d_message, d # Get params during execution. Params found here, override minimal defaults and/or config settings. -if ga(notifier, options, long_options) is None: - pass - # sender, destination, priority, message, tags, click = "", "", "", "", "", "" -else: - sender, destination, priority, message, tags, click = ga(notifier, options, long_options) +# noinspection PyRedeclaration +a_sender, a_destination, a_message, a_priority, a_tags, a_click = ga(notifier, options, long_options) + +if a_sender != '': sender = a_sender +if a_destination != '': destination = a_destination +if a_priority != "": priority = a_priority +if a_tags != "": tags = a_tags +if a_click != "": click = a_click # Get the threat level from the message and map it to priority diff --git a/wazuh_notifier_module.py b/wazuh_notifier_module.py index bb00b12..a4b0a7a 100755 --- a/wazuh_notifier_module.py +++ b/wazuh_notifier_module.py @@ -204,16 +204,19 @@ def call_for_help(notifier): def get_arguments(notifier, options, long_options): # Get params during execution. Params found here, override minimal defaults and/or config settings. + notifier: str = notifier.lower() + help_text = call_for_help(notifier) sender, destination, message, priority, tags, click = "", "", "", "", "", "" - notifier: str = notifier.lower() - if notifier == "discord": + argument_list: list = sys.argv[1:] + if not argument_list: pass + else: - argument_list: list = sys.argv[1:] + try: # Parsing argument arguments, values = getopt.getopt(argument_list, options, long_options) @@ -251,4 +254,4 @@ def get_arguments(notifier, options, long_options): # output error, and return with an error code print(str(err)) - return sender, destination, priority, tags, click + return sender, destination, message, priority, tags, click