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 : Query a particular Backend #4

Open
JoNicolas opened this issue Jan 5, 2018 · 2 comments
Open

Feature : Query a particular Backend #4

JoNicolas opened this issue Jan 5, 2018 · 2 comments
Assignees
Labels

Comments

@JoNicolas
Copy link

Hi,

I was looking at your excellent script and found one feature : in some case, when you host multiples backends on a haproxy, when you have one faulty server, you will have the notification; however in certain condition, if you have another another failed server in another backend, the previous notification will be overwritten.

I will try to add one new option in order to query particular backend.

Best regards,

Nicolas

@jonathanio jonathanio self-assigned this Jan 5, 2018
@jonathanio
Copy link
Owner

@JoNicolas,

I understand where you are coming from, however, the script was designed to ensure HAProxy had the appropriate number of minimum or maximum servers up or down (normally respectively). Setting Warning or Critical to one down won't re-warn when a second, or a third, go down too. This is not specifically an issue with the script, but just the way Nagios-based checked are designed to operate.

My preferred option here (and the way I normally configure monitoring) is to set up specific checks for the service/host that are independent of HAProxy. At least there I have awareness of communication issues (HAProxy alerts, but service/host alert is OK), or service down (service/host alerts instead, maybe HAProxy if it goes over the allowed limit too).

Nonetheless, I'm open to your pull request and am interested in seeing your idea.

@JoNicolas
Copy link
Author

Hello @jonathanio,

I understand your point of view, from my side, I think that adding checks on both elements (HAProxy and all the backend servers and services) are a must be : HaProxy could have an issue but your backend servers can be healthy, it will be easier to track down the issues (but the impacts could be important).

I was able to tweak your script (in a quick and dirty way, I do not know perl) and add an optional parameter to the backend checks :

If you do not provide a parameter to -b or --backends then proceed as before (eq : display old behaviour); if a parameter is provided, try to find the provided backend and display the result of the checks.

I was not able to use the "!" getopt option with my optional parameter....

Regards,

Nicolas

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

No branches or pull requests

2 participants