DEV Community

Cover image for Adding server monitoring to my SSH manager without opening a second connection
Rafi Bagaskara Halilintar
Rafi Bagaskara Halilintar

Posted on

Adding server monitoring to my SSH manager without opening a second connection

I use my SSH manager every day. I also use a separate monitoring tool every day. For a long time I just accepted that these were two different things.

Then one day I was SSH'd into a server that was behaving weird. I wanted to check if it was CPU or memory, but I had to open a different app, find the server in there, and wait for the dashboard to load. It took maybe 15 seconds. Not a huge deal. But it broke my flow every single time.

I already had an SSH connection open to that server. Why was I opening a second thing just to see what was happening to it?
That's what pushed me to build server monitoring directly into Termique, the SSH manager I've been working on.

The interesting part: reusing the existing SSH connection

SSH connections aren't just for terminals. The protocol supports multiple channels over a single TCP connection. You can have a terminal session running in one channel while sending short exec commands through another channel on the same connection.

That's how the monitoring feature works. When you open the metrics panel for a server, Termique creates a separate exec channel on the existing SSH connection and polls /proc/stat for CPU, /proc/meminfo for RAM, and /proc/loadavg for system load. Short-lived commands, called on an interval, over the connection you already have open.
No second SSH handshake. No separate auth. Just another channel on the same pipe.

The tradeoff: you do need an agent

I want to be upfront about this. The monitoring feature requires a small agent installed on each server. It's not agentless.

I considered going agentless, relying entirely on /proc reads through exec channels. That works fine on most Linux servers. But the agent makes it easier to handle edge cases properly and opens the door for future features like alerts and longer history retention. Without it, I'd be fighting a lot of fragile shell parsing.

If you're managing Linux servers, it's a one-command install. Non-Linux systems aren't supported yet. That's a real limitation and something I'm still working through.

Where it fits

The goal isn't to replace something like Netdata or Grafana. Those are great for what they do. The monitoring in Termique is specifically for the moment you're already in your terminal and just want to know if the server is struggling. CPU, RAM, disk. At a glance. Without switching apps.

It's a consolidation thing, not a monitoring platform.

Current status

The feature is still in development. I'm targeting a release in the next Termique update. If you want to try it when it's out, or just poke around the existing SSH manager in the meantime, it's at termique.app. Free tier available, Pro is $5/month.

If you've built something similar or have opinions on how you handle server monitoring in your day-to-day, I'd love to hear it in the comments.

Top comments (0)