// configure checkup
c := checkup.Checkup{
Checkers: []checkup.Checker{
checkup.HTTPChecker{
Name: "Website",
URL: "http://www.example.com",
Attempts: 5,
},
},
Storage: checkup.S3{
AccessKeyID: "<yours>",
SecretAccessKey: "<yours>",
Bucket: "<yours>",
},
}
// provisioning need only happen once
info, err := c.Storage.Provision()
if err != nil {
return err
}
// save this info and put it in the
// config of your status page
fmt.Println(info)
// perform a checkup
results, err := c.Check()
if err != nil {
return err
}
for _, result := range results {
fmt.Println(result)
}
// post a status update
results[0].Message = "We're investigating connectivity issues."
err = c.Storage.Store(results)
if err != nil {
return err
}
// perform a check and store results
err = c.CheckAndStore()
if err != nil {
return err
}
// perform checks every 10 minutes
c.CheckAndStoreEvery(10 * time.Minute)
$ cat checkup.json
{
"checkers": [{
"type": "http",
"endpoint_name": "Website",
"endpoint_url": "http://www.example.com",
"attempts": 5
}],
"storage": {
"provider": "s3",
"access_key_id": "<yours>",
"secret_access_key": "<yours>",
"bucket": "<yours>"
}
}
$ checkup provision
One sec...
Provision successful
User ID: AKIAJDUI7LNDMABCDZZZZ
Username: checkup-monitor-s3-public
Public Access Key ID: AKIAJDXYIQOXABCDZZZZ
Public Access Key: ndGU+iHdgsozx8Qco23Bpf6rFtiYfFXRmRfoob4
IMPORTANT: Copy the Public Access Key ID and Public Access
Key into the config.js file for your status page. You will
not be shown these credentials again.
$ checkup
== Website - http://www.example.com
Threshold: 0
Max: 136.296933ms
Min: 37.716659ms
Median: 51.626374ms
Mean: 65.212206ms
All: [{54.489828ms } {45.93124ms } {51.626374ms } {136.296933ms } {37.716659ms }]
Assessment: healthy
$ checkup message --about=Website "We're fixing it."
Message posted
$ checkup --store
$ checkup every 10m
^C