SwitchProvider is a Custom Notification that allows you to automatically switch over to another hosting provider when your website is down.

The HTTPFailoverSite Custom Sensor can detect if a failover site is up, but leaves the decision to you to manually change your DNS records.

SwitchProvider takes it one step further. In combination with a standard HTTP sensor, it automatically switches over to the first provider that is up.
Switch provider starting point
Step 1/3
This is your starting point
You have setup a standard HTTP sensor on your PRTG server that checks your website.
The DNS record at your Domain Registrar points to your hosting provider
Back
Next
PTF.SwitchProvider gets its settings from the SwitchProvider.ini file. Both the .exe and the .ini file need to be placed in the \Notifications\EXE folder of your PRTG installation.
The .ini file contains information about your domain, your hosting providers, your DNSdynamic account and information that makes it possible to send you an email when a provider switch has taken place.
.INI File
[domain]
name=mydomain.com
pagetitle=Welcome at my domain

[provider]
name=Provider1
dnsip=31.170.21.35

[provider]
name=Provider2
dnsip=89.56.127.56

[dnsdynamic]
accountname=user@mydomain.com
accountpassword=mypassword
domain=mydomain.dnsd.info

[email]
smtpserver=mail.mydomain.com
smtpport=25
username=
password=
usessl=0
from=user@mydomain.coml
to=user@mydomain.com
The [domain] section holds information about your domain name and the title of your home page. The pagetitle field can be left empty, but provides extra security when switching providers.

You can enter as much [provider] sections as you like.
Finding a provider that is up takes place in the order they are listed, so make sure to place your preferred provider at the top of the list.

In the [dnsdynamic] section, you need to enter the information about your DNSdynamic account.

In the [email] section, enter information about your mail server and the user who gets an email when provider switching has taken place.

Tip: all passwords can be encrypted, using the PassHash tool. This prevents them from being stored in plain text.
Test your setup

Use the -p= parameter to force SwitchProvider to switch to a specific provider. I.E.
SwitchProvider.exe -p=Provider1 or SwitchProvider.exe -p=Provider2. Next, open your DNSdynamic account and check that your dns record has changed.
Setting up the Notification

After copying the SwitchProvider.exe and .ini file to the \Notifications\EXE folder of your PRTG installation and modifying the content of the .ini file, you need to create a new notification on your PRTG server.
Name the notification 'Switch hosting provider', choose to execute a program and select the Switchprovider.exe program. The parameter field can be left empty.
On the HTTP sensor, go to the 'Notifications' tab and under 'Object Triggers' add a new 'State Trigger' that will fire the new 'Switch hosting provider' notification when the HTTP sensor is down for more than 300 seconds. (see image below)
Triggers
Finished

When your website is down for more than 5 minutes (300 seconds), your DNS record will automatically switch to the first provider in the .ini file that is up.

Tip: running the Switchprovider.exe as a scheduled task will automatically switch DNS record back to your preferred hosting provider when it is up again.

SWITCHPROVIDER

The slides below will show you how to set up your DNS records in order to accomplish this.
Switch provider
PRTG Tools Family
Addons for your PRTG Network Monitor
Addons for your PRTG Network Monitor

PRTG Tools Family

Facebook
Twitter
Copyright © 20xx, PRTG Tools Family
back to topback to top