louislam / uptime-kuma

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

Ping monitor: "Platform |openbsd| is not support" #3201

Open h3artbl33d opened 1 year ago

h3artbl33d commented 1 year ago

⚠️ Please verify that this bug has NOT been raised before.

🛡️ Security Policy

Description

First and foremost: thank you so much for creating uptime-kuma - have been using it for quite some time and am completely happy with it. I do run it on OpenBSD with some monitors. Most are TCP Pings and some HTTPS. However, a 'Ping' monitor throws the following error:

Platform |openbsd| is not support

I am not versed in NodeJS - so the following might be complete nonsense: it seems to be caused by cypress, which is listed as a devDependency. The 🔧 How to Install instructs to execute npm run setup. The package.json:42 shows that npm ci --production is ran, which should omit devDependencies.

If I run npm i @louislam/ping I get the following output:

npm ERR! code 1
npm ERR! path /var/www/status/app/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! Platform: "openbsd" is not supported.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/www/status/.npm/_logs/2023-05-29T10_35_00_736Z-debug-0.log

However, running npm i @louislam/ping --production seems to work:

npm WARN config production Use `--omit=dev` instead.

removed 1 package, and audited 657 packages in 57s

90 packages are looking for funding
  run `npm fund` for details

3 vulnerabilities (2 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

It fix the issue - still getting the same error adding a Ping monitor (even after restarting uptime-kuma) - but this might be due to my incompetence with NodeJS / npm.

👟 Reproduction steps

  1. Follow 🔧 How to Install on an OpenBSD machine.
  2. Add a Ping monitor.
  3. The error pops up.

👀 Expected behavior

  1. Follow 🔧 How to Install on an OpenBSD machine.
  2. Add a Ping monitor.
  3. The monitor starts pinging the host at the set interval.

😓 Actual Behavior

  1. Follow 🔧 How to Install on an OpenBSD machine.
  2. Add a Ping monitor.
  3. The error pops up.

🐻 Uptime-Kuma Version

1.21.3

💻 Operating System and Arch

OpenBSD 7.3

🌐 Browser

Chromium 113.0.5672.126

🐋 Docker Version

No response

🟩 NodeJS Version

18.15.0

📝 Relevant log output

No response

h3artbl33d commented 1 year ago

To be clear: Uptime Kuma works, TCP Ping, HTTPS monitors work - so do the notifications. This issue only occurs with a (ICMP) Ping monitor.

louislam commented 1 year ago

Unfortunately, we switched the ping library to node-ping which is not support for OpenBSD.

node-ping should need to be modified in order to support it.

Current workaround: You can use an older version of Uptime Kuma that haven't switched to node-ping, but I can't remember start from which version.

rezzorix commented 1 year ago

I believe the switch to node-ping was made with uptime-kuma 1.19.4

See also here: https://github.com/louislam/uptime-kuma/pull/2223