YetaWF.StatusCheck Package Documentation

Display
Print

YetaWF.StatusCheck Package

The YetaWF.StatusCheck assembly/package implements an application that checks the availability of a list of websites at a specified interval (by default every minute). If a site is found that is down, text messages are sent to a list of phone numbers. When the site(s) come back up, further text messages are sent notifying of the recovery.

This console application uses YetaWF services, such as the TwilioProcessor package and is a good example of how a console application has full access to all YetaWF services, including data providers.

Running StatusCheck

This is a simple console application run from the command line or started automatically when the server starts. Or it can just as easily be containerized. It is available as an ASP.NET Core console application and as a .NET console application.

Configuring StatusCheck

The configuration is quite straightforward. The file StatusCheck.json has all the settings relevant for website status checking.

StatusCheck.json

{
  "SiteDomain":  "yourdomain.com",
  "Interval: 60,
  "URLs: [
    "https://yourdomain.com",
    "https://yourotherdomain.com"
  ],
  "Timeout: 30,
  "SMSNotify: [
    "+14075551212"
  ]
}

AppSettings.json

The following settings are required in AppSettings.json. They can be copied directly from the AppSettings.json file used by the website (or the entire file can simply be copied).

You need a valid Twilio account and phone number(s) suitable for SMS delivery. The TwilioProcessor package documentation shows how to set up a Twilio account.

{
  "Application": {
    "P": {
      "Default": {
        "LanguageId": "en-US",
        "IOMode": "SQL",
        "SQLDbo": "dbo",
        "SQLConnect": "Data Source=..server..;Initial Catalog=..database..;User ID=..userid..;Password=..password.."
      },
      "Softelvdm_TwilioProcessor": {
        "Live": false,
        "LiveAccountSid": "..live account SID..",
        "LiveAuthToken": "..live account token..",
        "TestAccountSid": "..test account SID..",
        "TestAuthToken": "..test account token.."
      }
    }
  }
}

LanguageSettings.json

The following settings are required in LanguageSettings.json. They can be copied directly from the LanguageSettings.json file used by the website (or the entire file can simply be copied).

{
  "LanguageSection": {
    "Languages": [
      {
        "Id": "en-US",
        "ShortName": "English",
        "Description": "US English"
      }
    ]
  }
}

See Also YetaWF.Core