glanceapp / glance

A self-hosted dashboard that puts all your feeds in one place
GNU Affero General Public License v3.0
7.42k stars 255 forks source link

[REQUEST] Add option for pings to Monitor #2

Open danmed opened 4 months ago

danmed commented 4 months ago

the Monitor service (for me anyway) would benefit from an option to react to just a ping rather than an http 200 code..

Would it be possible to add just an option so the full URl can be added (so it can be clicked) but the result of the monitor is based on a ping result?

svilenmarkov commented 4 months ago

Hey, thanks for providing feedback!

One issue with pinging is that it typically requires root privileges which is something I wouldn't want to involve for an application that simply aggregates data from a bunch of HTTP requests. This leaves me with having to call the OS native ping command and parse the result, however since I want to maintain cross OS compatibility I have to potentially parse 3 different outputs.

I'm not entirely sure what the best way to go about this is for the time being, I'll have to give it some thought.

danmed commented 4 months ago

Appreciate the reply and your consideration... maybe a way to customise the response code that means it's all good? for example when i try and add my home assistant instance it fails (yet clicking the link actually shows it's all fine...)

svilenmarkov commented 4 months ago

In what way does it fail? Can you check what the error is by hovering over the red "ERROR" text? There should also be an error in your logs.

danmed commented 4 months ago

ill go back and set up the monitor again.. i removed it because i realised i just wanted bookmarks.. uptime-kuma is already monitoring things for me..

Ill get back to you

Petbotson commented 4 months ago

hey, i am encountering the same issue (or one like @danmed).

I have a few services listed, with a valid let's encrypt certificate, where everything is shown as fine. But when it is a self signed certificate the check failes.

example one Get "domain.com": tls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead

example two Get "domain2.com": tls: failed to veryfy certificate: x509: certificate is valid for localhost, not domain2.com

I think it would be great to have some kind of toggle to accept insecure certificates.

Bit0r commented 4 months ago

Backend services like MySQL cannot accept HTTP requests; their availability can only be confirmed through ping.

Bit0r commented 4 months ago

The Go language has a pro-ping library, which can send ping using three different protocols: icmp, udp, and http.

Rhys-Woolcott commented 4 months ago

hey, i am encountering the same issue (or one like @danmed).

I have a few services listed, with a valid let's encrypt certificate, where everything is shown as fine. But when it is a self signed certificate the check failes.

example one Get "domain.com": tls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead

example two Get "domain2.com": tls: failed to veryfy certificate: x509: certificate is valid for localhost, not domain2.com

I think it would be great to have some kind of toggle to accept insecure certificates.

Yeah, hard agree. Especially in environments where you have your own root authority.

phil9309 commented 1 week ago

Is this issue still active?

I'm a new user having the same problem for Plex and Wallos. Plex is online but the ping monitor shows red and "unauthorzied". So far I've been using a (gethomepage.dev) homepage. Their siteMonitor feature displays a green dot for HTTP Status 401 (Plex) or "too many redirects" (Wallos) too. Wouldn't that be the most simple solution to this?

Petbotson commented 3 days ago

hey @phil9309 you can check out the docs You can set allow-insecure. Explanation: Whether to ignore invalid/self-signed certificates