

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 刪除監視器
<a name="nw-monitor-delete"></a>

無論監視器**狀態**為何，您都必須停用或刪除與監視器關聯的所有探針，才能在網絡合成監視器中刪除監視器。刪除監視器後，無須再支付監視器探針的費用。請注意，不能復原已刪除的監視器。

您可以透過 Amazon CloudWatch 主控台或 AWS Command Line Interface使用監視器和探針。若要以程式設計方式使用網路合成監視器，請參閱《 AWS Command Line Interface 命令參考》中的[網路合成監視器 API ](https://docs.aws.amazon.com/networkmonitor/latest/APIReference/Welcome.html)參考和[網路監視器](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/)。

**使用主控台刪除監視器**

1. 在 [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) 開啟 CloudWatch 主控台，然後在**網路監控**下方選擇 **Synthetic Monitor**。

1. 在**監視器**區段中，選擇您要刪除的監視器。

1. 選擇**動作**，然後選擇**刪除**。

1. 如果您的監視器有任何作用中的探針，系統會提示您停用它們。選擇**停用探查**。
**注意**  
選擇**停用探查**後，無法取消或復原此動作。不過，不會從監視器中移除已停用的探查。如果需要，稍後可以重新啟用它們。如需詳細資訊，請參閱[啟用或停用探針](nw-monitor-probe-status.md)。

1. 在確認欄位中輸入 **confirm**，然後選擇**刪除**。

或者，您可以透過程式設計方式刪除監視器，例如使用 AWS Command Line Interface。

**使用 CLI 刪除監視器**

1. 若要刪除監視器，您需要監視器名稱。如果不知道名稱，請執行 [list-monitors](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/list-monitors.html) 命令以取得監視器清單。記下您要刪除之監視器的名稱。

1. 驗證監視器中是否包含任何作用中的探針。使用上一個步驟中的監視器名稱來使用 [edit-monitor](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/get-monitor.html)。這會傳回與該監視器相關聯的任何探查清單。

1. 如果監視器包含探針，必須先將這些探針設定為非作用中或刪除。
   + 若要將探查設定為非作用中，請使用 [update-probe](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/update-probe.html)，並將狀態設定為 `INACTIVE`。
   + 若要刪除探查，請使用 [delete-probe](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/delete-probe.html)。

1. 將探針設定為 `INACTIVE` 或刪除後，可以執行 [delete-monitor](https://docs.aws.amazon.com/cli/latest/reference/networkmonitor/create-probe.html) 命令以刪除監視器。當您刪除監視器時，不會刪除非作用中的探針。