louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.31k stars 5.39k forks source link

SIP Monitoring #1906

Open kristiandg opened 2 years ago

kristiandg commented 2 years ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

New Monitor

🔖 Feature description

Good morning. I would love to see a monitor type for SIP (via UDP, TCP, and TLS). I envision it being very similar to the HTTP(s) monitor, in that you could have it only accept certain response codes as "up" (it obviously just has to parse them a bit differently).

I love this tool, and would love to be able to use it for our needs, if I can get a couple of monitoring capabilities added to it.

Thanks! And great work!

✔️ Solution

In a similar design fashion to how the HTTP monitor works, the SIP Monitor would initiate a connection to the host:port defined, with an OPTIONS request (see Section 11.2 of RFC3261). An acceptable responses should be able to be defined (just like the HTTP monitor), such as "200-299". In addition, a "Maintenance" option should also exist (for processing of another range of response codes, such as 503 specifically, but editable as well), which will send an alert indicating maintenance, not down (the maintenance option should be able to be disabled, if not desired to function). Latency would also be visible in the history (just as the HTTP monitor does).

❓ Alternatives

None with existing monitors.

📝 Additional Context

Monitoring of SIP servers/endpoints is a very helpful feature for anyone who runs a SIP server (Asterisk, or even corporate PBX). It's even helpful to monitor health of carrier trunks.

medOualla commented 1 year ago

Any updates for this issue please?

Pome-ro commented 1 year ago

Also something I'm interested in.

ksutkowski commented 1 year ago

Following - definitely something worth having!

markosole commented 1 year ago

Interested in as well. I can think of one was to monitor it but it would requre installation and running nodejs app on the server. NodeJS app which checks local system health (services, online status and similar) and which can hit Uptime Kuma endpoint https://my-kuma-sever.com/api/push/abcd124DFGHJ?status=up&msg=OK&ping=

Or it does not if something went off for example.

I've built something similar for Windows services monitoring based 100% on NodeJS. Solution isn't ideal and would need customization for Linux based system. I'll try with something simple for start and share here.

absginc commented 1 year ago

So far I found this was best handled to create a docker file including sipsak and a node express app that takes in a host IP and port and returns the value of the sipsak result.

I used the spawn() method from the built-in child_process module to run the sipsak command as a child process and used the stdout event to capture the output of the sipsak command and the stderr event to handle any errors that may occur during the execution of sipsak. From within uptimekuma, monitor a HTTP endpoint with the POST method. A simple in express returns 200 OK for a successful PING and a 500 response if the sip option were to fail. This was pretty straiught forward to setup using docker.

absginc commented 1 year ago

To follow up with my previous response, here is an example https://github.com/absginc/sipsaker In the above repository, it launches a simple container that will do your SIP OPTIONS with sipsak by replying to a POST request with the OPTION results to uptime kuma, or any monitoring platform that can monitor HTTP results.