monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitoring ngrok tunnel


From: SZÉPE Viktor
Subject: Re: Monitoring ngrok tunnel
Date: Mon, 11 Feb 2019 12:50:02 +0100
User-agent: Horde Application Framework 5

Idézem/Quoting Marcin Deka <address@hidden>:

Hi,

Can someone advise how I can monitor tunnel created with ngrok (running as a daemon)? I would like to reestablish tunnel if existing one is stoped and send alert including new tunnel parameters (there is a TCP port number change while tunel is being created).
I’m using below command to see tunnel details:
curl --silent http://127.0.0.1:4040/api/tunnels/ssh | jq '.public_url’
It gives a response like below, where XXXXX ia a TCP port number:
"tcp://0.tcp.eu.ngrok.io:XXXXX"
Will appreciate your help!


Hi Marcin!

You may monitor ngrok's

- log files
- binaries
- configuration files
- init files
- the running process
- TCP ports
- and functional tests as you mentioned, you may check public_url in a shell script

see all my configs https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit/services
aruba-serclient_script is a very simple example:
/usr/bin/lsof -p "$(cat /run/serclient.pid)" | grep -w "/dev/ttyS1"

so
curl --silent "http://127.0.0.1:4040/api/tunnels/ssh"; | jq -r '.public_url' | grep -F 'tcp://0.tcp.eu.ngrok.io:'

adding "if changed status then alert" to monit will alert you.

All the best!


SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  address@hidden  skype: szepe.viktor
Budapest, III. kerület








reply via email to

[Prev in Thread] Current Thread [Next in Thread]