Coder Social home page Coder Social logo

Comments (8)

louislam avatar louislam commented on May 22, 2024

My guess is the response data is a JSON object and Uptime Kuma currently support html only. I will try to improve it.

from uptime-kuma.

0mni avatar 0mni commented on May 22, 2024

Not a JSON object, at least I don't think it could be. It was the response I got when I configured a check for my SMTP port 587 on my mailcow server.

Edit: ignore above, was thinking of smtp, on mobile.

I have two files located on my server served by nginx/php-fpm.

One is a static index.html that is blank except for the number "42".
The other is a php script with the following code:

<?php
echo "4";
echo "2";

I do a check for each file as a seperate service and both checks are used to let me know that my webserver is okay, of course the php check will fail if nginx is down, but that is to be expected.

Maybe the check you do is expecting a particular format? Instead of just a simple response?

from uptime-kuma.

louislam avatar louislam commented on May 22, 2024

Not a JSON object, at least I don't think it could be. It was the response I got when I configured a check for my SMTP port 587 on my mailcow server.

Edit: ignore above, was thinking of smtp, on mobile.

I have two files located on my server served by nginx/php-fpm.

One is a static index.html that is blank except for the number "42".
The other is a php script with the following code:

<?php
echo "4";
echo "2";

I do a check for each file as a seperate service and both checks are used to let me know that my webserver is okay, of course the php check will fail if nginx is down, but that is to be expected.

Maybe the check you do is expecting a particular format? Instead of just a simple response?

I am sorry that I am a bit lost. Do you mean the error you mentioned at the topic, is related to index.html/index.php hosted on nginx/php-fpm server?

from uptime-kuma.

0mni avatar 0mni commented on May 22, 2024

I am sorry that I am a bit lost. Do you mean the error you mentioned at the topic, is related to index.html/index.php hosted on nginx/php-fpm server?

Correct.

from uptime-kuma.

0mni avatar 0mni commented on May 22, 2024

Just did a test, I replaced my index.html that used to have:

42

with the following:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Answer to the Ultimate Question</title>
</head>
<body>
42
</body>
</html>

It is now functioning, so I think you are on the right track that it is a issue with the way the response is being handled. Maybe don't check if it is valid HTML? Just parse the data for the keyword it gets on the response?

from uptime-kuma.

0mni avatar 0mni commented on May 22, 2024

I made the same change to my php script, it too now works as expected:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Answer to the Ultimate Question</title>
</head>
<body>
<?php

echo "4";
echo "2";

?>
</body>
</html>

from uptime-kuma.

louislam avatar louislam commented on May 22, 2024

Found the root problem, because axios automatically parse the response "42" to number format.

Lucky, JSON.stringify can also fix the problem even though it is not a json.

Thank you for your special case.

from uptime-kuma.

louislam avatar louislam commented on May 22, 2024

Fixed with 1.0.1

from uptime-kuma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.