You are right …
I missed the “status” word in my command …
Thanks.
You are right …
I missed the “status” word in my command …
Thanks.
Tonight I not very smart … May be usually on saturday I used to do different activities before Corona Time …
This?:
That’s what I’ll do.
Take time to test it
I’ll do it tomorrow or monday
Thanks
Is there a corresponding command line that can be used in a script to export the list and send something human readable via mail?
Thanks.
the api can be queried by the command line in a terminal
echo '{"action":"connectionHistory","account":"stephane@domain.org","timeInterval":"today"}' | /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-vpn-ui/openvpn-rw/read | jq
echo '{"action":"connectionHistory","account":"stephane@domain.org","timeInterval":"last_week"}' | /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-vpn-ui/openvpn-rw/read | jq
echo '{"action":"connectionHistory","account":"stephane@domain.org","timeInterval":"last_month"}' | /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-vpn-ui/openvpn-rw/read | jq
you retrieve a json object that you can parse and email it to who you want
Ok, now I have to convert it in human readable format (like in the windows panel):
Started Ended Duration RemoteIP Received Sent
Today I discovered jq exist and probably if I study it I can achieve this, but if there is already an example that I can use …
Thanks
It is linux time in second since 1970, happy coding
Did you manage to configure VPN user access by time?
Did you read this post?
Different request (per user route) same solution (firewall rule on the ip assigned to the user)