Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 Example: Scheduled maintenance tomorrow #65

Closed
thomasmerz opened this issue Feb 26, 2021 · 5 comments
Closed

🚧 Example: Scheduled maintenance tomorrow #65

thomasmerz opened this issue Feb 26, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@thomasmerz
Copy link
Owner

thomasmerz commented Feb 26, 2021

This is an example of how you can set up a scheduled maintenance event. To set this up, create a new issue in your @upptime repository and add the label maintenance to it. Then, you can add details in the comments. Make sure you also add an HTML comment at the beginning of the issue, which looks like this:

<!--
start: 2021-02-24T13:00:00.220Z
end: 2021-02-24T14:00:00.220Z
expectedDown: google, hacker-news
-->

More here: https://upptime.js.org/docs/scheduled-maintenance

@thomasmerz thomasmerz added the documentation Improvements or additions to documentation label Feb 26, 2021
@thomasmerz
Copy link
Owner Author

Original See upptime/upptime#267

@thomasmerz thomasmerz pinned this issue Feb 26, 2021
@thomasmerz thomasmerz added maintenance Planned maintenance and removed maintenance Planned maintenance labels Feb 26, 2021
@thomasmerz
Copy link
Owner Author

This

start: 2021-03-12T00:30:00.220Z
end: 2021-03-12T02:00:00.220Z

means:

start: 2021-03-12T01:30:00.220Z
end: 2021-03-12T03:00:00.220Z

⚠️

@thomasmerz thomasmerz changed the title Example: Scheduled maintenance tomorrow 🚧 Example: Scheduled maintenance tomorrow Apr 20, 2021
@thomasmerz thomasmerz unpinned this issue Aug 10, 2021
@modem7
Copy link

modem7 commented Sep 14, 2021

Just an FYI - an easy way to generate the start/end string in bash is:

date +"%Y-%m-%dT%H:%M:%S%z"

Output: 2021-09-14T11:02:48+0100

That will also append the appropriate timezone as well.

Or if you don't have a terminal to hand:
https://rextester.com/LRHG10863

Have tested this successfully here: modem7/Status#31

@thomasmerz thomasmerz pinned this issue Sep 14, 2021
@modem7
Copy link

modem7 commented Sep 14, 2021

Hopefully this will help people a bit more than the above.

https://rextester.com/HGYD18980

I've created a (probably poorly written) script that has everything required w/ appropriate TZ and some Github text formatting to create a maintenance issue.

image

image

#!/bin/bash
# Script to easily create maintenance window issue for Upptime.
# Author: modem7 - https://github.com/modem7

##################################
###### Change these values #######
##################################

# Edit Timezone if required
export TZ=Europe/London

# Enter how long your maintenance window is for
mainthour="1" # 0 value allowed
maintmin="30" # 0 value allowed

# Enter services to be down (make sure to keep the quotes, and comma separate the values)
expecteddown="website, analytics"

###########################################
###### Don't change these variables #######
###########################################

# Start time variable. Don't change.
    starttime=$(date +"%Y-%m-%dT%H:%M:%S%z")

# Maintenance window variables. Don't change.
    maintwindow="${mainthour} hours ${maintmin} minutes"

    endtime=$(date -d "${maintwindow} hence" +"%Y-%m-%dT%H:%M:%S%z")

    nicestart=$(date -d "$(echo ${starttime} | sed 's/T/ /')")
    niceend=$(date -d "$(echo ${endtime} | sed 's/T/ /')")

#####################
###### Output #######
#####################

# Output required fields for maintenance issue.
echo "#################### Copy values below ####################"
echo "### Scheduled maintenance"
echo "Affected services: _**$expecteddown**_"
echo "Lasting from _**$nicestart**_ to _**$niceend**_"
echo
echo "<!--"
echo "start: $starttime"
echo "end: $endtime"
echo "expectedDown: $expecteddown"
echo "-->"
echo "#################### Copy values above ####################"

@thomasmerz
Copy link
Owner Author

Reminder for me: Timezone!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants