<div dir="ltr"><div>Hi Andreas,</div><div><br></div>Thank you very much.  That worked nicely, much easier than I thought it would be.<br><div><br></div><div>The difference between INSTALLED (519) and ESTABLISHED (520) was nearly the same in my case.   What is the main difference between them in this context?</div><div><br></div><div>Many Thanks,</div><div>Houman</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 31 Jul 2019 at 11:14, Andreas Steffen <<a href="mailto:andreas.steffen@strongswan.org">andreas.steffen@strongswan.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Houman,<br>
<br>
you can get the number of active IKE SAs via<br>
<br>
  swanctl --list-sas | grep ESTABLISHED | wc -l<br>
<br>
if you are using the vici interface or<br>
<br>
  ipsec statusall | grep ESTABLISHED | wc -l<br>
<br>
if you are using the legacy whack interface.<br>
<br>
For the total number of active CHILD SAs replace ESTABLISHED<br>
by INSTALLED in the grep query.<br>
<br>
Best regards<br>
<br>
Andreas<br>
<br>
On 31.07.19 10:05, Houman wrote:<br>
> Good morning,<br>
> <br>
> <br>
> What is the best way to determine how many connections are currently<br>
> active on the StrongSwan server? <br>
> <br>
> <br>
> Maybe there is a simpler way but I thought of one way. I’m using<br>
> FreeRadius with Mysql DB as storage.<br>
> <br>
> <br>
> There are three fields that capture the start (acctstarttime), ongoing<br>
> (acctupdatetime) and the end (acctstoptime) of a connection.<br>
> <br>
> <br>
> I could theoretically filter for all acctupdatetime that start from<br>
> today and have a acctstoptime that is null.  The count of these records<br>
> would be the approximate number of active connections to the server.<br>
> <br>
> <br>
> Is there a better way to achieve this or do you agree to this approach?<br>
> <br>
> <br>
> <br>
> Many Thanks,<br>
> <br>
> Houman<br>
> <br>
<br>
-- <br>
======================================================================<br>
Andreas Steffen                         <a href="mailto:andreas.steffen@strongswan.org" target="_blank">andreas.steffen@strongswan.org</a><br>
strongSwan - the Open Source VPN Solution!          <a href="http://www.strongswan.org" rel="noreferrer" target="_blank">www.strongswan.org</a><br>
Institute for Networked Solutions<br>
HSR University of Applied Sciences Rapperswil<br>
CH-8640 Rapperswil (Switzerland)<br>
===========================================================[INS-HSR]==<br>
</blockquote></div>