Iam struggling a bit to understand howto monitor if a gateway is “alive” or “online”.
As i understand there are prometheus stats availible on lots of things but i cant seem to find if a specifik gateway is online or not? Or am i missing something here?
It would be nice if there was a intervall that chirpstack uses to se if a gateway has been seen och not and if that intervall is exceeded a mqtt message could be sent on a “status” topic and of course also be published on prometheus as this seems to be the choice of chirpstack.
I prefer zabbix for monitoring and could take the mqtt message and send it to zabbix via node-red but prometheus is not used in my enviroment so i would like it if mqtt could carry this information also since it already is sp extensively used in chirpstack.
If anyone has solved this in another way i would like to hear it.
we have our own custom “prometheus-exporter” for that. I bet you could replicate the same functionality with Zabbix. The services polls the chirpstack-api triggered by a prometheus-scrape. Integrating it directly to chirpstack might be cumbersome, at least for the prometheus metrics, as in our case we have 3 Chirpstack-AS (NS) containers running, and each would generate in that case the same metrics.
You can also have multiple/different AS connected to the same NS, and each would have their “own” gateways. Even on a single AS, you have different orgs and visibility depending on that.
You could subscribe to the stats event of a gateway and depending on the interval configured, you would then have a “liveness” indicator outside and independent of chirpstack, in case chirpstack is unavailable you could still “see” if a gateway is sending something.
I have looked at the stats event but it does not make sense as the gatewayid is encoded or garbled, at least not base64 encoded. that would be a way to get some “alive” from the gateways.
iam not so interrested in the prometheus metrics, much more if the gateways are alive or not since they are spread over a large region
You have a bunch of choices but if you plan to use this function in ChirpStack, this script will be run under otto JS VM which supports only ES5; any ES6 will cause script to fail.
Well, since i was unable to get this decodeing to work i resorted to the node-red chirpstack integration and created this flow that every five minutes checks all gateways for lastseen value and compares that to current time and sends a sms if its been down for more over 30 minutes.