Sudo command to restart gateway bridge

HI Guys what is the command I can put in this Gateway bridge file in order to restart the gateway:

That might work, but you are better off, having a bash-script and command="/opt/" inside there you define how to restart the gw or anything else. Might be with systemctl or monit, or something else. It depends on your setup. If you need sudo to run something, then you might want to add the particular command to a sudoers file, so you dont need to use a password to run it.

Please be aware: if the gwb is “stuck/unresponsive” it wont execute your command. That’s why we created an extra service just for that, triggered by alert-manager (prometheus)

wobcom / Chirpstack Devices Prometheus Exporter · GitLab (Monitors devices and gateways tagged with productive: true)
wobcom / iot / Revive · GitLab (uses the same MQTT topic and “command” message as the gwb bridge)

This are all “in-band” management and connectivity with the gateway is required.

@chopmann thank you, your answer was interesting and helpful. May I ask, with the commnds I have a few questions; first, how do I execute them? For example, do I just leave one of the lines uncommented and it will automatically run when the downlink is recieved?

; second, how can i confirm they are running or not?
Third, if uncommenting the lines is the only way to run the command which one is the best choice, the first one, so e.g. meta.dynamic.commands…
Fourth, is there a way just to restart the gatewaybridge with the command? Not reboot or poweroff.
Please let me know, thank you.

# Uncomment everything after example
command="sudo monit restart chirpstack-concentratord"
  1. It’s in the documentation. I forgot what the output is thou.
  2. Don’t know. We moved to our own tool.

@chopmann Thank you for that. Could you please address the 4th. point I made as well, that is; how to restart the Gateway bridge using the commands?

Please let me know. Thank you.

analog to point 1. just add another command. Send a message over the API/backend you configured.

@chopmann I am using the GateWay OS base image, when you say API/backend, could you please be explicit e.g. the gatewaybridge.toml file or … Also how can I set this command up to only execute when the gateway becomes inactive in ChirpStack web Interface. Just to explain my goal here is when the gateway goes inactive on chirpstack I want to restart the gateway bridge iun order for it to be active again.

Please let me know what you think. Thank you.

  1. please read the documentation:
    Commands - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server

  2. I dont know, built your own trigger. Have a cron job, or pay someone to look 24/7 at the UI and run a script if that’s cheaper.

  3. I think you are misunderstanding how the “commands” work. See point 1.

  4. Have you thought about, why the gateway-bridge might be stuck? Which scenarios are covered by a command built into the gateway-bridge code? Which are not covered?
    4.1 What if the gateway has no internet connection?
    4.2 What if the gwb disconnected from the backend and cant rejoin? Are you able to restart the gwb?
    4.3 Do you have physical-access to the gateway?
    4.4 Do you need to do all of that, even if you are running everything from the same hardware? How long is it acceptable for a gateway to be offline?

Those questions are not for me to answers, nor do I want the answer from you. You have a goal, now you need a plan.