Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 

Remote Access VPN Statistics - One-Liner

Champion
Champion

COVID-19  💊 We take care of your Remote Access VPN needs!
👩‍💻 Reviewed by RnD.
👍 Available as SmartConsole Extension.

One-liner (Bash) to show a summary about the remote access statistics of a VPN gateway.
Run in SmartConsole as one-time script or from your scripts repository or directly on your Gateway in expert mode:


    echo; if [[ `if [[ $(cat /etc/cp-release) == *"Embed"* ]]; then grep 1 /opt/fw1/conf/active_blades.txt | tr '[:upper:]' '[:lower:]'; else e
...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
72 Replies

Leader
Leader

@Danny 

great job. I love these oneliners.

Wolfgang

 

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

great , I was looking for it.

 The statistics match for   the last hour/day/week ?

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

I can understand that the current number is the live stat from the gateway at the point in time of running the one liner but what about the peak number? - that must be historical, surely?  Over what historical period?

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

The peak number is always counted since last reboot of the system.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee+
Employee+
Very good! Thanks for sharing. ;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

👍

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Leader
Leader

@Danny 

running in export mode is fine, but from Smartconsole repository some small formatting errors are seen.

SmartConsole.PNG

Maybee you can find the problem.

Wolfgang 

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

Thanks @Wolfgang, I fixed it.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee
Employee

It will show also Capsule Workspace connected Users?

Capsule Workspace it part of MAB Portal Users count?

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

Hi @Bechor, I've just included stats for Capsule Workspace users as well. ✔️

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Employee
Employee
That's great!
Thank you! ;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee+
Employee+

Untitled.png

Untitled2.png

 

Hi Danny, thank you for the great one-liner script!

It's certainly helping a lot.

Quick feedback on when running Gateways CG IaaS (VE), the outcome is "Not a firewall gateway!".

We had to bypassed it by getting rid of the first "if" of the script.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Champion
Champion

Thanks for the enabled_blades tip, @Eduardo_Pereira, I just improved the One-liner to check the VPN blade.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Contributor
Quality one-liners as always! ;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Champion
Champion

Thanks @PatrikSkoglund! 😃

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Participant

Great script for quick stats,

so are they full day stats? or current stats?

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

Thanks for the tip. I'll add the word 'current' to the title. The peak score is an overall status since last reboot of the system.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Hi :

Thank you very much for your work 

I have spent tons of hours trying to do the same thing

In my script I have used the following kernel table to obtain SNX users:

  1. SNX users ---> fw tab -t sslt_connectra_sessions -s

I have counted the lines with SNX users on the smartview monitor users table, and with this number I could find the "correct" kernel table 

If I use your script,  the number shown is different from the number that you can obtain from   the kernel table s

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Participant

Great job! Thx for very useful one liner.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

I'm glad you like it.  🙂

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee+
Employee+

Hey  @Danny,

This is a one-liner that I did for a client few days ago to monitor VPN clients and the performance of the appliance. It was a huge appliance with thousands of users.

It help to find any heavy connections and monitor the connected users real time.

Have you ever wrote something to find/monitor heavy connections/elephant flows? (VPN or not related).

monitor VPN heavy conn.jpg

Script:

watch -n 0.1 "echo ' CPU UTILIZATION'; printf '%.s-' {1..100}; echo;echo;mpstat -P ALL 1 1 | gre

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Champion
Champion

Thanks for sharing your code with us.  😀 I haven't yet created a solution to identify top VPN remote users.

It's impressive to see what we can bring up together while working from home focusing on getting home workers connected and protected maintaining their businesses during COVID-19.

corona.gif

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee+
Employee+
True that! 😉

Let me know if you ever get inspiried to code such thing! 😉

Thank you! ;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

Will do!  😉

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Contributor

Super thank you.
This is a super mega command, very useful.
Thanks again

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Champion
Champion

I'm glad it's useful to you. This one-liner also got reviewed by R&D today as Check Point SE's now use it, too.  👩‍💻

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

The command is great!! I have one question: What is the difference between MAB Portal Users and SNX Users?

My case:

REMOTE ACCESS VPN STATS - Current
----------------------------------------------------------------------
Assigned OfficeMode IPs : 1499 (Peak: 1692)
Capsule/Endpoint VPN Users : 1447 (Peak: 1501) using Visitor Mode: 60
Capsule Workspace Users : 0 (Peak: 0)
MAB Portal Users : 141 (Peak: 232)
L2TP Users : 0 (Peak: 0)
SNX Users : 122 (Peak: 198)

Regards

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos

Employee+
Employee+

A user may login to MAB portal but not connect SNX. In this case he will be counted as MAB user and will not be counted as SNX user.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free
Reply
0 Kudos