Important note about SSL VPN compatibility for 20.0 MR1 with EoL SFOS versions and UTM9 OS. Learn more in the release notes.

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

HI,
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))

                {

                    client.Connect();



                    if (client.IsConnected)

                    {

                        var commandText = "ipsec statusall";



                        var command = client.RunCommand(commandText);

                        string result = command.Result;



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

                        Console.WriteLine(result);



                        client.Disconnect();

                    }

                }

            }                    

    Example of my C#  code

    what i need is:

    - send command example ipsec statusll

    - Get result

    - if ipsec down

    - restart ipsec connection

    Davide

  • 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.