Typically, monitors automatically adjust their up/down status based on the health of their associated endpoint. In some cases, you may want to “force” an up or down status manually to either resume or prevent traffic to that endpoint, regardless of the outcome of the health check.
For example, suppose a health check indicates an endpoint is healthy, but you would like to stop traffic to that endpoint. In this case, you can use the NS1 portal or API to adjust the monitor status to “down” manually. Doing this drains traffic away from the endpoint, which can be a helpful tool during maintenance windows requiring a reboot.
The instructions below demonstrate how to force a monitor up/down via the NS1 portal and then via the API.
Before forcing a monitor up or down, you must first pause the monitor or disable notifications associated with the monitor. Note that pausing the monitor stops health checks to the endpoint, whereas muting notifications does not. Both options, however, prevent new status updates sent via the monitor’s data feed to the associated records. Pausing the monitor or disabling notifications is necessary to retain the forced up/down status.
Note
You need only pause the monitor or disable notifications. You need not do both.
curl -X POST -H "X-NSONE-Key: $API_KEY" https://api.nsone.net/v1/monitoring/jobs/monitorID -d '{"active": false}'
where
monitorID is the unique identifier for this particular monitor. You can retrieve a list of monitor IDs by executing a GET command to
https://api.nsone.net/v1/monitoring/jobs
.
Navigate to the Monitors page.
-
Click the menu (three dots) icon to the right of the relevant monitor, and click Edit.
-
Under Configuration, toggle the switch next to Monitor Paused to enable this setting.
Click Save Changes. Once complete, advance to Step 2.
curl -X POST -H "X-NSONE-Key: $API_KEY" https://api.nsone.net/v1/monitoring/jobs/monitorID -d '{"mute":true}'
where
monitorID is the unique identifier for this particular monitor. You can retrieve a list of monitor IDs by executing a GET command to
https://api.nsone.net/v1/monitoring/jobs
.
After pausing or muting the monitor, you can adjust the status by forcing it to up or down. This action forces a message to associated data feeds that the endpoint associated with this monitor is “up” or “down.”
curl -X POST -H "X-NSONE-key:$API_KEY" https://api.nsone.net/v1/feed/sourceID -d '{"jobid": "monitorID", "up": false}'
where
sourceID is the unique identifier of the data source associated with this monitor. The NS1 platform created a data source automatically when you created the monitor. To locate the source ID, execute a GET command to the
https://api.nsone.net/v1/data/sources
API endpoint to return a list of all data sources and their IDs.monitorID is the unique identifier for this particular monitor. You can retrieve a list of monitor IDs by executing a GET command to
https://api.nsone.net/v1/monitoring/jobs
An "up" status of
false
indicates the endpoint associated with the monitor is down. If the "up" status is set totrue
, this indicates the endpoint is up.
Navigate to the relevant monitor’s configuration page (same screen as referenced above).
-
Next to Force, select the desired option (either Up or Down).
Note
Forcing an up or down status does not change the status of the monitor itself. Instead, it changes the status of the data feed associated with the monitor.
-
Click Save Changes. You can view the status of the monitor by navigating to the record details page. Here, a label beneath the associated answer indicates the up/down status of the endpoint.
This completes the force up/down process. To revert this forced status and resume normal monitoring behavior, un-pause the monitor or re-enable notifications and de-select the forced status on the monitor configuration screen.
Your website is up, but the NS1 monitor indicates the site is down due to a networking issue. Automatically and repeatedly in user-defined intervals, the monitor communicates this “down” status to all data feeds associated with the monitor. These data feeds point to specific DNS records, so the new “down” status triggers failover at these records.
To fix this, you must first mute monitor notifications or pause the monitor to prevent the monitor from sending anymore “down” status messages to the data feeds. However, at this point, the data feeds still retain that “down” status, so you must force an “up” status to revert the incorrect failover.