# Statup Help Statup is an easy to use Status Page monitor for your websites and applications. Statup is developed in Go Language and you are able to create custom plugins with it!
# Services For each website and application you want to add a new Service. Each Service will require a URL endpoint to test your applications status. You can also add expected HTTP responses (regex allow), expected HTTP response codes, and other fields to make sure your service is online or offline. # Statup Settings You can change multiple settings in your Statup instance. # Users Users can access the Statup Dashboard to add, remove, and view services. # Notifications # Plugins Creating a plugin for Statup is not that difficult, if you know a little bit of Go Language you can create any type of application to be embedded into the Status framework. Checkout the example plugin that includes all the interfaces, information, and custom HTTP routing at https://github.com/hunterlong/statup_plugin. Anytime there is an action on your status page, all of your plugins will be notified of the change with the values that were changed or created. Using the statup/plugin Golang package you can quickly implement the event listeners. Statup uses upper.io/db.v3 for the database connection. You can use the database inside of your plugin to create, update, and destroy tables/data. Please only use respectable plugins! # Custom Stlying On Statup Status Page server can you create your own custom stylesheet to be rendered on the index view of your status page. Go to Settings and click on Custom Styling. # API Endpoints Statup includes a RESTFUL API so you can view, update, and edit your services with easy to use routes. You can currently view, update and delete services, view, create, update users, and get detailed information about the Statup instance. To make life easy, try out a Postman or Swagger JSON file and use it on your Statup Server.Postman JSON Export | Swagger Export
## Authentication Authentication uses the Statup API Secret to accept remote requests. You can find the API Secret in the Settings page of your Statup server. To send requests to your Statup API, include a Authorization Header when you send the request. The API will accept any one of the headers below. - HTTP Header: `Authorization: API SECRET HERE` - HTTP Header: `Authorization: Bearer API SECRET HERE` ## Main Route `/api` The main API route will show you all services and failures along with them. ## Services The services API endpoint will show you detailed information about services and will allow you to edit/delete services with POST/DELETE http methods. ### Viewing All Services - Endpoint: `/api/services` - Method: `GET` - Response: Array of [Services](https://github.com/hunterlong/statup/wiki/API#service-response) - Response Type: `application/json` - Request Type: `application/json` ### Viewing Service - Endpoint: `/api/services/{id}` - Method: `GET` - Response: [Service](https://github.com/hunterlong/statup/wiki/API#service-response) - Response Type: `application/json` - Request Type: `application/json` ### Updating Service - Endpoint: `/api/services/{id}` - Method: `POST` - Response: [Service](https://github.com/hunterlong/statup/wiki/API#service-response) - Response Type: `application/json` - Request Type: `application/json` POST Data: ``` json { "name": "Updated Service", "domain": "https://google.com", "expected": "", "expected_status": 200, "check_interval": 15, "type": "http", "method": "GET", "post_data": "", "port": 0, "timeout": 10, "order_id": 0 } ``` ### Deleting Service - Endpoint: `/api/services/{id}` - Method: `DELETE` - Response: [Object Response](https://github.com/hunterlong/statup/wiki/API#object-response) - Response Type: `application/json` - Request Type: `application/json` Response: ``` json { "status": "success", "id": 4, "type": "service", "method": "delete" } ``` ## Users The users API endpoint will show you users that are registered inside your Statup instance. ### View All Users - Endpoint: `/api/users` - Method: `GET` - Response: Array of [Users](https://github.com/hunterlong/statup/wiki/API#user-response) - Response Type: `application/json` - Request Type: `application/json` ### Viewing User - Endpoint: `/api/users/{id}` - Method: `GET` - Response: [User](https://github.com/hunterlong/statup/wiki/API#user-response) - Response Type: `application/json` - Request Type: `application/json` ### Creating New User - Endpoint: `/api/users` - Method: `POST` - Response: [User](https://github.com/hunterlong/statup/wiki/API#user-response) - Response Type: `application/json` - Request Type: `application/json` POST Data: ``` json { "username": "newadmin", "email": "info@email.com", "password": "password123", "admin": true } ``` ### Updating User - Endpoint: `/api/users/{id}` - Method: `POST` - Response: [User](https://github.com/hunterlong/statup/wiki/API#user-response) - Response Type: `application/json` - Request Type: `application/json` POST Data: ``` json { "username": "updatedadmin", "email": "info@email.com", "password": "password123", "admin": true } ``` ### Deleting User - Endpoint: `/api/services/{id}` - Method: `DELETE` - Response: [Object Response](https://github.com/hunterlong/statup/wiki/API#object-response) - Response Type: `application/json` - Request Type: `application/json` Response: ``` json { "status": "success", "id": 3, "type": "user", "method": "delete" } ``` # Service Response ``` json { "id": 8, "name": "Test Service 0", "domain": "https://status.coinapp.io", "expected": "", "expected_status": 200, "check_interval": 1, "type": "http", "method": "GET", "post_data": "", "port": 0, "timeout": 30, "order_id": 0, "created_at": "2018-09-12T09:07:03.045832088-07:00", "updated_at": "2018-09-12T09:07:03.046114305-07:00", "online": false, "latency": 0.031411064, "24_hours_online": 0, "avg_response": "", "status_code": 502, "last_online": "0001-01-01T00:00:00Z", "dns_lookup_time": 0.001727175, "failures": [ { "id": 5187, "issue": "HTTP Status Code 502 did not match 200", "created_at": "2018-09-12T10:41:46.292277471-07:00" }, { "id": 5188, "issue": "HTTP Status Code 502 did not match 200", "created_at": "2018-09-12T10:41:47.337659862-07:00" } ] } ``` # User Response ``` json { "id": 1, "username": "admin", "api_key": "02f324450a631980121e8fd6ea7dfe4a7c685a2f", "admin": true, "created_at": "2018-09-12T09:06:53.906398511-07:00", "updated_at": "2018-09-12T09:06:54.972440207-07:00" } ``` # Object Response ``` json { "type": "service", "id": 19, "method": "delete", "status": "success" } ``` # Main API Response ``` json { "name": "Awesome Status", "description": "An awesome status page by Statup", "footer": "This is my custom footer", "domain": "https://demo.statup.io", "version": "v0.56", "migration_id": 1536768413, "created_at": "2018-09-12T09:06:53.905374829-07:00", "updated_at": "2018-09-12T09:07:01.654201225-07:00", "database": "sqlite", "started_on": "2018-09-12T10:43:07.760729349-07:00", "services": [ { "id": 1, "name": "Google", "domain": "https://google.com", "expected": "", "expected_status": 200, "check_interval": 10, "type": "http", "method": "GET", "post_data": "", "port": 0, "timeout": 10, "order_id": 0, "created_at": "2018-09-12T09:06:54.97549122-07:00", "updated_at": "2018-09-12T09:06:54.975624103-07:00", "online": true, "latency": 0.09080986, "24_hours_online": 0, "avg_response": "", "status_code": 200, "last_online": "2018-09-12T10:44:07.931990439-07:00", "dns_lookup_time": 0.005543935 } ] } ``` # Prometheus Exporter Statup includes a prometheus exporter so you can have even more monitoring power with your services. The prometheus exporter can be seen on `/metrics`, simply create another exporter in your prometheus config. Use your Statup API Secret for the Authorization Bearer header, the `/metrics` URL is dedicated for Prometheus and requires the correct API Secret has `Authorization` header. # Grafana Dashboard Statup has a [Grafana Dashboard](https://grafana.com/dashboards/6950) that you can quickly implement if you've added your Statup service to Prometheus. Import Dashboard ID: `6950` into your Grafana dashboard and watch the metrics come in!