how to alert when internet is down

Started by totalysmartlittelboy, December 28, 2024, 04:09:26 PM

Previous topic - Next topic
im an complete noob in opnsense

i want it to notify via the spekers with beeps

install espeak

ping google.com | grep 'timed out' > espeak &

You'll want to run this on Linux with a speaker attached (raspberry pi?)


You need a separate Linux machine, e.g. a Raspberry Pi, and some scripting skills. You cannot do this on OPNsense. Refer to the documentation of your Linux distribution of choice to find out how to install the "espeak" package.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

so i cant install an freebsd app but forced to use an linux macien

Possibly FreeBSD, too. I don't know which applications exists that produce some sound. But you probably need a separate machine, because you cannot install arbitrary packages on OPNsense. OPNsense is an appliance OS based on FreeBSD, not a stock FreeBSD.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Why is this not possible on OS? Can it not emit sounds by design? 8()


I don't know. You can do all sorts of things with ESP32 I heard. Never seen one. You are asking a lot of questions about a lot of things that are not OPNSense, so how should I know? I'm an OPNsense expert of some degree.

I googled this "espeak" thing. It seems to be a speech synthesiser that outputs via a sound card. From Ubuntu. Probably nobody on this forum has ever used it, so nobody knows if it would work on OPNsense or where to get and how to install this software.

Second OPNsense does not contain support for sound cards, only beeps via a simple PC speaker.

But you did not ask how to make any beep at all but how to use "espeak", which seemingly only exists on Linux so I said "get a Raspberry Pi".

If your system actually has a speaker connected to the mainboard you should be able to emit some beep e.g. by using the "beep" command.

On a shell in OPNsense type

man beep
To see how it works and then try it. Possibly you will be able to make *some* noise.

HTH,
Patrick

Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

OP, if the reason you want OPNsense to notify you when internet is down is because you want to have it bring the internet back up, consider this thread: https://forum.opnsense.org/index.php?topic=40930.msg226932#new

You may get a standard beep (via motherboard speaker) from a console by just writing an ASCII 7. In DOS, for instance, Ctrl-7 (hold "Ctrl", press and release "7", release "Ctrl") should beep the speaker (if connected). So a very simple shell script on the console might work. Utility would be limited, though - I think everyone here would recommend a more robust solution.

I don't recall offhand the last machine I built with a PC speaker connected - they're commonly omitted these days. The old Media Vision PAS16 had a PC speaker input, so you could run those sounds through its output (to headphones or an external amp) - that might have been the last (in other words, ~1993). Whee.