zabbix-alertscripts
zabbix-alertscripts copied to clipboard
Indentation error causes `notify_pushover.py` to always fail after checking tokens
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.
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
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!
@izeen
- Go to Administration
- Select Media Types
- Create Pushover entry
- Define name, type and script name like stated in README.md
- Add FOUR params:
- First param is your application key.
- Params 2-4 like stated in README.md (send to, subject, message)
- Go to Users
- Select some User
- Go to Media
- Add entry
- Select type Pushover (like named before)
- Type in your User Key or Group Key in the send to field.
- Go to Configuration
- Go to Actions
- Enable the default entry or define your own.
Then you will get Pushover notifications from your zabbix instance.
Thank you so much for the very detailed instruction, worked instantly!
Thanks again and have a good summer!