4G

4G Router metrics and alarms in Slack

How to send custom alarms, metrics and system events of 4G router to Slack the easy way. Create custom alarm conditions and send notification only when needed.

· 2 min read
4G Router metrics and alarms in Slack

How to troubleshoot 4G router connectivity problems and not to deploy full monitoring suite? Similar questions or simple. My 4G router behaves strange, how to find out, what is going on?

Not want to use or go via the hassle of setting up SNMP monitoring or similar. What about getting notification into a Slack channel, when some router metrics changes. This can provide quick and easy insight into what is actually happening and we can use software tools, which are ready available.

We will end up with something like this in your Slack channel:

4G router metrics and alarm in Slack message
4G Router metrics in Slack

Let’s start with Slack.

Follow this great documentation from Slack itself how to enable web hooks. Quick tip, create a new channel in your selected workspace to keep it organised.

https://api.slack.com/messaging/webhooks
When you get it, you should end up with a URL to send the messages.

Test the basic curl message that it’s all ready to go on a Slack side.

Time to configure the 4G router

I use Node-Red for this as it’s quick and easy. We can use linux script as well for basics. I have Advantech industrial 4G routers from here https://dureco.com.au/collections/4g-routers

Install Node-Red User Module (https://ep.advantech-bb.cz/products/software/user-modules#node-red) and navigate to IP_OF_ROUTER:1880 you will need to login with the same login and password as a router.

Next import sample Node-Red flow. Find here.

The sample flow does look like this:

Node-Red flow to send router metrics to Slack channel

It is set up to retrieve status information every 60sec and I introduce a logic condition, where I am interested in a status message only if signal strength changes over a certain value. I have selected 4dBm. You can change or use a different metrics based on what you are interested in.

In a Debug Tab will be output from Http Request Node. The successful POST to your Slack channel will look similar to this (notice statusCode: 200, payload: “ok”):

Node-Red Debug message of successful post

In a case there is an error, it will be indicated in payload property and status code will be different probably 400.

Conclusion


This example can easily be modified for different messaging platform. Same to say about alarming metrics, which can be multitude. The most important is, we can get quite sophisticated alarming, monitoring and debugging which suits individual workflow with little effort.

Related Articles

Advantech 4G, LTE router FW 6.3.2
· 1 min read
Advantech 4G Routers FW 6.3.1
· 2 min read
Advantech 4G Router FW 6.3.0
· 2 min read
4G Router Metrics to Grafana
· 7 min read