sriccio / zabbix-alertscripts

A nice and small collection of Zabbix custom alterting scripts.
20 stars 15 forks source link

Indentation error causes `notify_pushover.py` to always fail after checking tokens #9

Open tristantech opened 5 years ago

tristantech commented 5 years ago

Program always exits with status 1 due to indentation error on line 98:

# Check if UserKey and AppToken has been supplied
if not app_token:
  l("Error: you must supply a User Key")
sys.exit(1)

https://github.com/sriccio/zabbix-alertscripts/blob/master/notify_pushover.py#L98

Both of these checks (#Check if AppToken... and # Check if UserKey) should be removed since argparse handles enforcing command line parameters.

MalteHillmann commented 5 years ago

Thank you. Had the same problem. Removing checks works. Also the README.md is wrong, because UserKey|AppToken is splitted to two params AppToken and UserKey since #5

izeen commented 5 years ago

Thank you. Had the same problem. Removing checks works. Also the README.md is wrong, because UserKey|AppToken is splitted to two params AppToken and UserKey since #5

I'm pulling my hair a bit, i've managed to make the changes tristantech typed and it works fine from cli to send notifications. How am i supposed to setup the media settings in Zabbix? I can see like you said that you cant use UserKey|AppToken anymore, that results in too few arguments, but how do you do it in media settings in zabbix? I tried just using space inbetween instead of | but still getting too few arguments. Any pointers would be greatly appriciated!

MalteHillmann commented 5 years ago

@izeen

Then you will get Pushover notifications from your zabbix instance.

izeen commented 5 years ago

Thank you so much for the very detailed instruction, worked instantly!

Thanks again and have a good summer!