Giter Site home page Giter Site logo

Comments (4)

yigitkeremoktay avatar yigitkeremoktay commented on June 5, 2024 1

There is sadly no way to do this built-in. The API is also read-only so your only way to do this could be by having a PHP Script on Cron or NodeJS app that will check the UptimeRobot API status and create an incident in Server Status database directly, through MySQL.

If you would look into spending a bit more time and contribute, you could use the classes from the project and create a file inside the repo that could be setup to use uptimerobot if it is enabled in the config.

@Pryx would be of better help if you decide to write something yourself

from server-status.

Steffen-MLR avatar Steffen-MLR commented on June 5, 2024

I think implementing a write-enabled API would be the best way. Maybe with a simple user/pw authentication for starters.

from server-status.

yigitkeremoktay avatar yigitkeremoktay commented on June 5, 2024

I think implementing a write-enabled API would be the best way. Maybe with a simple user/pw authentication for starters.

Most likely but it's a big amount of change that may not be that easy to do. I also don't think anyone is active enough to do such major updates.

from server-status.

Steffen-MLR avatar Steffen-MLR commented on June 5, 2024

``I have an Idea:
start with a request to login to your instance:

curl -X POST 'http://example/admin/' \
   --header 'Accept: */*' \
   --form 'email="<mail@example>"' \
   --form 'pass="<password>"' -v

Get the Line Set-Cookie: Set-Cookie: PHPSESSID=<seesionid>; path=/ and strip out PHPSESSID=<sessionid>.
then create an incident by:

curl -X POST \
  'http://example/admin/?new=incident' \
  --header 'Accept: */*' \
  --header 'Cookie: PHPSESSID=<sessionid>' \
  --form 'type="1"' \
  --form 'title="title2"' \
  --form 'text="test123"' \
  --form 'services[]="1"'

further explanations:
possible values for type are: 0 = "Major outage", 1 = "Minor outage", 2 = "Planned maintenance", 3 = "Operational"
possible values for services[] are indexes starting with 1, for your exisiting services. If you have only one, 1 would be the correct value.

NOTE: if you want to add an incident of type=2, you need to submit additional form params time and end_time using ISO 8601 Format. e.g. 2023-03-12 12:00. Value of time need to be before end_time.

NOTE 2: Since these features were not considered when creating the functions, there is no exception handling there. Do not test it in Production.

Hope this helps. i am currently working on PHP8 support, Maybe I can look into this after that. Should not be that hard to do this with one single request instead of using two.

from server-status.

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.