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

Feature Request - Disable Nagios exit codes if Alert Providers used #475

Closed
varuzam opened this issue Aug 26, 2020 · 5 comments
Closed

Feature Request - Disable Nagios exit codes if Alert Providers used #475

varuzam opened this issue Aug 26, 2020 · 5 comments

Comments

@varuzam
Copy link

varuzam commented Aug 26, 2020

Feature Request

add args like --nagios-mode

Feature Description

it is nice to have such behavior:
when the script is executed with --nagios-mode argument it returns exit code 1 for alerts with warning severity and 2 - critical
without the argument it returns non-zero exit code only if any exceptions or critical errors happen

Use Cases

I run the script from cronjob and need to monitor that it is working properly without any exceptions and any errors. I use alert provider for getting alerts. Such approach gives me ability to distinguish alerts about failure of execution the script and alerts about AWS limits.

Testing Assistance

I can help in testing it

Installation Method

I noticed that it behaves such way only in official docker image and, likely, when installed from the repo. When installed from pip it returns exit code 0 even when any AWS limits exceeded

@jantman
Copy link
Owner

jantman commented Aug 31, 2020

@varuzam Hmm... this one is really interesting to me. I think there might be two separate issues here...

First, just to make sure I'm understanding you correctly, what you're asking for is an option so that when an Alert Provider is used, awslimitchecker only exits non-zero if there's some sort of exception? As opposed to its current behavior, where Alert Providers are in addition to the 0/1/2 exit code (ok/warning/critical)?

Secondly, I'm a bit confused/surprised about what you said in the "Installation Method" section. You're saying that you've installed awslimitchecker via pip but it's returning zero even when there are warnings and criticals? Could you please provide a debug-level output example of this, by running awslimitchecker -vv [any other options you specify]; echo $?

@varuzam
Copy link
Author

varuzam commented Sep 3, 2020

@jantman you understand me correctly

sorry, my bad. installed via pip it works as expected. returning the 0/1/2 exit code

@jantman
Copy link
Owner

jantman commented Sep 18, 2020

@varuzam I just want to make sure I understand the current state of this issue:

  1. awslimitchecker is returning 0/1/2 properly based on ok/warning/critical.
  2. You'd like to request a feature/option where, if Alert Providers are used, awslimitchecker will not exit non-zero just because of warnings/criticals, but only because of an exception or other program error.

Is this correct?

@varuzam
Copy link
Author

varuzam commented Sep 18, 2020 via email

@jantman jantman changed the title add nagios mode instead of returning non-zero exit code by default Feature Request - Disable Nagios exit codes if Alert Providers used Sep 21, 2020
@jantman
Copy link
Owner

jantman commented Sep 22, 2020

This has been fixed in 9.0.0, which is now live on PyPI and on the Docker Hub. Thank you so much!

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

2 participants