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
  • HI,
    the problem with the command is that it doesn't give me the names of the children of the various nodes but only the codes
    example

    Ipsec VPN NODE
    child 1
    child 2
    Are there other commands?

  • My other question is i need to do this command by external program for example write in c#, i do without problem ssh connection, but in which way i can send command ipsec statusall , i got always % Error: Unknown Parameter, in which way i can connect on advanced shell from external program?

    Could you help me?

  • Other than this it would be difficult, ipsec statusall will display a useful information. And regarding the external program can you please show a screenshot how are you doing it ?

    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.

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