Triggers: Introducing webhook

minerstat
minerstat
Published in
3 min readOct 15, 2019

There is a new action that can be automatically triggered by certain events: webhook. This feature will be most interesting to those that want to connect the mining monitoring system with smart relays or set some other custom actions that get triggered on certain events.

A webhook trigger can be used in many different situations as it is available for all possible events - here are just some ideas:

  • Controlling the room temperature via a smart relay API;
  • Double-checking some parameters before resetting a profit switch on profit drop;
  • Changing mining configuration on certain events;
  • Sending yourself notifications on Discord, Slack, or any other platform that isn’t officially supported on minerstat.

How does a webhook trigger work?

A webhook trigger works the same as any other trigger, but while other triggers get fired for the most extreme cases, the webhook trigger will be fired for each event it is set. This means that if you set, for example, temperature trigger which set fans to 100% when the temperature is 80°C and at the same time a webhook trigger, both triggers will get fired.

How to set up a webhook trigger?

  1. First, select an item for which the value will be checked, for example, GPU temperature.
  2. Then select a group of workers, for example, MSOS.
  3. Then select the value, for example, ≥ 80°C;
  4. Then select [Webhook];
  5. Lastly, enter the URL of the webhook.

The URL of the webhook is the URL that will be called when the trigger is fired. In the entered URL address, you can also use tags that will be replaced with appropriate values so you will easier distinguish which trigger was fired:

  • (WORKER) tag will be replaced with the worker’s name.
  • (IF) tag will be replaced with the setting under the IF condition, defined in point (1).
  • (OF) tag will be replaced with the group name under the OF condition, defined in point (2).
  • (IS) tag will be replaced with the setting under the IS condition, defined in point (3).

So if the URL of the webhook would be defined as

https://mining.management/set_fans?worker=(WORKER)&temp=(IS)

you would be able to read the worker’s name and the temperature value and adjust the script on the URL to act accordingly.

minerstat API

When you are preparing the script for your webhook(s), you can also always use all of the actions and methods provided to you by minerstat private and public API.

Discord example

You can read instructions on how to enable Discord webhook here. The URL you will set in the triggers should look like this:

https://discord.com/api/webhooks/SERVER/CHANNEL?worker=(WORKER)&if=(IF)&of=(OF)&is=(IS)

Where https://discord.com/api/webhooks/SERVER/CHANNEL is the URL you will receive by Discord and ?worker=(WORKER)&if=(IF)&of=(OF)&is=(IS) are minerstat related parameters that will be sent to you in the message and should not be changed.

Want to take your mining management to the next level? Register on minerstat and start for free.

--

--

minerstat
minerstat

minerstat® is the top platform for ASIC and GPU crypto mining monitoring and management. Enjoy hassle-free mining with our cutting-edge software.