How to Monitor VPN State through XML API
Created On 09/25/18 19:21 PM - Last Modified 04/20/20 22:37 PM
In addition to the WebUI and a Command Line Interface (CLI), PAN-OS provides an XML API to manage Palo Alto Networks devices.
The following steps allow the user to monitor the state of the VPN on the device.
- Generate the API key. Use the URL below, replace the hostname, username, and password with the appropriate values. Any special characters in the password must be URL/percent-encoded.
The result will be an XML block that contains the key. It should look like the following:
- Pull data on the existing tunnels using the following URL:
The result will be an XML block that contains multiple details on VPN tunnels. In case the VPN is up, a variable state will equal active:
In case VPN is down, a variable state will equal inactive: