OPNsense Forum

English Forums => High availability => Topic started by: ikkeT on October 16, 2020, 11:07:36 am

Title: haproxy endpoint monitoring
Post by: ikkeT on October 16, 2020, 11:07:36 am
Hi,

I use haproxy for exposing my services to internet. I'd want to monitor the services behind the haproxy, and though it would be the easiest to use telegraf, which I also use, to publish the backend stats into influxdb. Grafana could then give alerts if they start failing.

Other options would be to run prometheus with alert manager somewhere, but I have all the above tools aready in place. Would telegraf plugin maintainer be interested of adding the haproxy endpoints to monitored objects? Has anyone already done that?

Or do you use some other alert mechanism for monitoring availability from OPNsense?
Title: Re: haproxy endpoint monitoring
Post by: ikkeT on October 16, 2020, 11:12:33 am
mmmm, seems to be there already... ooops. I'll give it a try.
Title: Re: haproxy endpoint monitoring
Post by: ikkeT on January 04, 2021, 02:52:44 pm
Happy new year! I wanted to give some feedback here. I am happy user of HAproxy on OPNsense. I just automated my setup monitoring also OPNsense HAproxy status using grafana. For anyone interested, here's how to get grafana set up against such setup.

Here's how to run grafana in container, automated by ansible. So I don't need backups, as it will create the grafana end from scratch:

https://redhatnordicssa.github.io/grafana-rootless-container-ansible

Here's a dashboard I use, it prints out all services set for HAproxy. I want to have red/green status if service is doing fine. Lower at the dashboard there are some values of stats. I just took random sample here, the page is really long outside the screenshot. The third attachment is the json for creating such dashboard. I use ansible to push it it in my home setup.

I just wanted to contribute my monitoring setup in hopes it helps someone. Have fun!

Note that this requires you run influxdb somewhere and set that up as a source to grafana. Also need to enable haproxy stats telegraf plugin in OPNsense. I'm happy to describe more if someone is interested.





 
Title: Re: haproxy endpoint monitoring
Post by: ikkeT on January 04, 2021, 04:20:06 pm
Seems to be you need to be logged in to see the attached screenshots and json, in case you wonder what I'm talking about.
Title: Re: haproxy endpoint monitoring
Post by: norgan on March 28, 2021, 01:11:10 pm
Hey buddy, this is awesome thanks. Just trying to get this going and when imported the dash complains about telegraf not found. Changing queries fixes graphs but not showing data.
Title: Re: haproxy endpoint monitoring
Post by: ikkeT on March 28, 2021, 10:59:26 pm
Telegraf is the name of the influxdb database where OPNsense sends the data. You can name it as you wish, but you gotta have it. Did you set it up?
Title: Re: haproxy endpoint monitoring
Post by: norgan on March 31, 2021, 09:20:54 am
Yeah, already have a TIG stack in action. The existing influxdb db is called telegraf.