Connection checking utility

I live in an area of Mexico where Internet service is not always consistent. So I have two connections, one via telephone system and the other via cable T.V. Is there a utility that I can run all the time that warns me when one of them shuts down?
Thanks in advance.

Are you connected to both at the same time? And when yes, how. We are not clairvoyant.

Yes both connected at the same time. There is a wire connection from the street to my cable company modem and a wire from that modem to my desktop. There is a wire connection from the street to my telephone modem and it connects to my desktop wirelessly.

And using Network Manager?

I thought that when NM manages both the cable and the wifi, it then will automatically takes what thinks it is the fastest when both are available and when not take the one that does function.
Isn’t that the case?

Yes Network Manager uses whatever works. I would like to be notified when there is a change without having to ask Network Manager.

That wasn’t very clear from your first post.

Thus you want NM to sound a trumpet or so when it detects one of the two coming up or going down.

A bit more. To sound a trumpet if I am at the keyboard and have my speakers active, and to produce a log file that shows time of disconnection and reconnection.

Which DE are you using?

1 Like

Using XFCE.

Ah, ok. I have no XFCE VM to test atm.
For KDE Plasma it would have been easier, as it provides configurable notifications (including sounds) for such events…

Unfortunately…

sudo zypper in atm
Loading repository data...
Reading installed packages...
'atm' not found in package names. Trying capabilities.
No provider of 'atm' found.
Resolving package dependencies...
Nothing to do.

:joy: the “atm” acronym stands for “at the moment”.

That made me chuckle…sorry :rofl:

3 Likes

Sorry I missed that. Thanks anyway.

There is something called linux-atm. Thus my confusion.

I’ve had a look at “man NetworkManager” and I believe what I want is available. Sorry to bother you.

Chuckling is always good.

2 Likes

It’s not clear why you’re trying to get a notification when one of the connections are down.
Are you trying to manually switch the connection or …?
Perhaps you would be better served by a business router that has multi-WAN support.

All of these state changes (when you connect, disconnect, what you’re connected to, etc.) and actions (what you would like to do) are managed via D-Bus. Showing a notification would be akin to calling a dbus method with the appropriate arguments.

First install, D-Spy as a flatpak since you’re not on Gnome.
This would let you view and query dbus services using a GUI. Much easier! :slightly_smiling_face:

To interact with dbus from the terminal, use busctl.

For example, I call these two from a script before my 3 AM dup begins:

  1. busctl --json=short get-property org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Metered to get whether I’m connected to a metered network
  2. busctl --json=short get-property org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower OnBattery to get whether the device is running on battery

The format is get-property SERVICE OBJECT INTERFACE PROPERTY..., type in busctl --help. D-Spy will help you in decoding what those SERVICE OBJECT INTERFACE PROPERTY values are.

No. d-spy is in the official openSUSE repos and does not require additional dependencies. So please don’t recommend external untested packages when they are available in official repos.

You’re right, even I have d-spy installed from the repos:

S  | Name  | Summary                    | Type
---+-------+----------------------------+--------
i+ | d-spy | A D-Bus explorer for GNOME | package

Don’t know how the flatpak thing got into my mind. Perhaps it’s because Gnome releases it as one:

Many thanks. You’ve just opened a new door into learning.

1 Like