mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
add client listner
This commit is contained in:
parent
7253718860
commit
279ca266d9
1 changed files with 4 additions and 2 deletions
|
@ -25,6 +25,9 @@ class RtspMonitorType extends MonitorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = new RTSPClient();
|
const client = new RTSPClient();
|
||||||
|
client.on("error", (err) => {
|
||||||
|
log.debug("monitor", `RTSP client emitted error: ${err.message}`);
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.debug("monitor", `Connecting to RTSP URL: ${url}`);
|
log.debug("monitor", `Connecting to RTSP URL: ${url}`);
|
||||||
|
@ -46,11 +49,10 @@ class RtspMonitorType extends MonitorType {
|
||||||
heartbeat.status = DOWN;
|
heartbeat.status = DOWN;
|
||||||
heartbeat.msg = `${statusCode} - ${statusMessage}`;
|
heartbeat.msg = `${statusCode} - ${statusMessage}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
log.debug("monitor", `[${monitor.name}] RTSP check failed: ${error.message}`);
|
||||||
heartbeat.status = DOWN;
|
heartbeat.status = DOWN;
|
||||||
heartbeat.msg = `RTSP check failed: ${error.message}`;
|
heartbeat.msg = `RTSP check failed: ${error.message}`;
|
||||||
log.debug("monitor", `[${monitor.name}] RTSP check failed: ${JSON.stringify(error.message)}`);
|
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
await client.close();
|
await client.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue