This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Check Ipsec Vpn Status by Command Cli

I would need to retrieve the following information from the XG 135 Firewall via script:
- VPN status node by node and child by child
- restart the VPN if phase2 or phase1 is down

Can you help me retrieve this information via commands?
Thank you

This thread was automatically locked due to age.
Parents Reply Children
  •    static void Main()

                string host = "ip";

                string username = "admin";

                string password = "passw";

                using (var client = new SshClient(host, username, password))



                    if (client.IsConnected)


                        var commandText = "ipsec statusall";

                        var command = client.RunCommand(commandText);

                        string result = command.Result;

                        Console.WriteLine("Risultato del comando:");






    Example of my C#  code

    what i need is:

    - send command example ipsec statusll

    - Get result

    - if ipsec down

    - restart ipsec connection


  • I updated regarding the API in the other post, but executing via command line ipsec statusall, it would be difficult via external program. 

    Thanks & Regards,

    Vivek Jagad | Team Lead, Global Support & Services 

    Log a Support Case | Sophos Service Guide
    Best Practices – Support Case

    Sophos Community | Product Documentation | Sophos Techvids | SMS
    If a post solves your question please use the 'Verify Answer' button.