Hello all, I have a machine in production running an elixir application (no access to iex, only to erl) and I am tasked with running an analysis on why we are consuming so much CPU. The idea here would be to launch observer, check the processes tab and see the processes with the most reductions.
launch the app in the production machine with a cookie and a name
from local run: ssh user@public_ip "epmd -names" to get the name of the app and the port used
create a ssh tunel to the remote machine: ssh -L 4369:user@public_ip:4369 -L 42877:user@public_ip:42877 user@public_ip (4369 is the epmd port by default, 42877 is the port of the app)
connect to the remote machine via public ip: erl -name "user@public_ip" -setcookie "mah_cookie" -hidden -run observer
Problem
And now in theory I should be able to use observer on the machine. Instead however I am greeted with the following error:
What am I doing wrong?
I read that in older version of erlang I can’t monitor a machine with observer if they are in different networks (which is the case, because I want to monitor this machine from my localhost) but I didn’t find any information regarding modern days.
If this is in fact impossible, what alternatives do I have?
Right after typing it. I assume it would be step 0
In the remote machine, when I try to connect and fail, I get the following error message:
channel 5: open failed: administratively prohibited: open failed
What does it all mean?
After an hour of scouring the dark side of internet, I decided to use sudo journalctl -f to check all the logs of the machine and I found this:
erlang -name: my_app_name
machine user: flame
machine public ip: 99.999.99.999 (obviously not real)
channel 3: open failed: administratively prohibited: open failed
my_app_name sshd[8917]: error: connect_to flame@99.999.99.999: unknown host (Name or service not known)
/scripts/watchdog.sh")
my_app_name CRON[9985]: pam_unix(cron:session): session closed for user flame
so it tells me, unknown host ?? I am confused since 99.999.99.999 is the public IP of the machine itself!