Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tristantech opened this issue Apr 27, 2019 · 4 comments

Comments

@tristantech
Copy link

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
Copy link

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
Copy link

izeen commented Jun 13, 2019

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
Copy link

@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.

@izeen
Copy link

izeen commented Jun 13, 2019

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

Thanks again and have a good summer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants