Re: [Openvpn-users] Client history

2024-03-02 Thread Bo Berglund
On Sat, 02 Mar 2024 10:22:48 +, Peter Davis via Openvpn-users wrote: >Hello, >As suggested by someone here, I chose the /tmp directory because it >doesn't need any special permissions and I can make sure the script >runs correctly. And as you have stated it still "does not work", except

Re: [Openvpn-users] Client history

2024-03-02 Thread Peter Davis via Openvpn-users
> On Wednesday, February 28th, 2024 at 5:01 PM, Bo Berglund > wrote: > On Wed, 28 Feb 2024 14:07:13 +0100, Marc SCHAEFER schae...@alphanet.ch wrote: > > > On Wed, Feb 28, 2024 at 12:52:17PM +, Peter Davis via Openvpn-users > > wrote: > > > > > # #!/bin/bash > > > # export

Re: [Openvpn-users] Client history

2024-03-02 Thread Gert Doering
Hi, On Sat, Mar 02, 2024 at 08:41:57AM +, Peter Davis wrote: > So, how to solve it? I also answered this before - get a solid understanding how systemd works, and how the systemd unit files on your system are configured (= which directories are protected, or made private). Also find out if

Re: [Openvpn-users] Client history

2024-03-02 Thread Peter Davis via Openvpn-users
> On Wednesday, February 28th, 2024 at 6:10 PM, Gert Doering > wrote: > Hi, > > On Wed, Feb 28, 2024 at 12:52:17PM +, Peter Davis via Openvpn-users wrote: > > > # cat /tmp/Connections.log > > 2024-02-28 16:16:51 - CommonName connected with IP 192.168.129.253 > > > > So, why is the script

Re: [Openvpn-users] Client history

2024-02-28 Thread Gert Doering
Hi, On Wed, Feb 28, 2024 at 12:52:17PM +, Peter Davis via Openvpn-users wrote: > # cat /tmp/Connections.log > 2024-02-28 16:16:51 - CommonName connected with IP 192.168.129.253 > > So, why is the script not working in OpenVPN? You already know the answer of that - because systemd is making

Re: [Openvpn-users] Client history

2024-02-28 Thread Jochen Bern
On 28.02.24 14:31, Bo Berglund wrote: I am running *all* openvpn scripts from within /etc/openvpn/scripts and I use the *full path* to the scripts in the conf files calls. I also keep all of the custom logs (as defined in the conf file) below /etc/openvpn/log, which is also perfectly accessile

Re: [Openvpn-users] Client history

2024-02-28 Thread Bo Berglund
On Wed, 28 Feb 2024 14:07:13 +0100, Marc SCHAEFER wrote: >On Wed, Feb 28, 2024 at 12:52:17PM +, Peter Davis via Openvpn-users wrote: >> # #!/bin/bash >> # export script_type="client-connect" >> # export common_name="CommonName" >> # export trusted_ip="192.168.129.253" >> # ./server-events.sh

Re: [Openvpn-users] Client history

2024-02-28 Thread Marc SCHAEFER
On Wed, Feb 28, 2024 at 12:52:17PM +, Peter Davis via Openvpn-users wrote: > # #!/bin/bash > # export script_type="client-connect" > # export common_name="CommonName" > # export trusted_ip="192.168.129.253" > # ./server-events.sh I did not follow the whole discussion, but why on earth are you

Re: [Openvpn-users] Client history

2024-02-28 Thread Peter Davis via Openvpn-users
> On Monday, February 26th, 2024 at 5:06 PM, Bo Berglund > wrote: > On Mon, 26 Feb 2024 10:07:14 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Thanks again. > > I changed "LOG_FILE" to LOG_FILE="/tmp/Connections.log" and executed the > >

Re: [Openvpn-users] Client history

2024-02-26 Thread Bo Berglund
On Mon, 26 Feb 2024 10:07:14 +, Peter Davis via Openvpn-users wrote: >Hi, >Thanks again. >I changed "LOG_FILE" to LOG_FILE="/tmp/Connections.log" and executed the >script: > ># ./script-events.sh ># ># cat /tmp/Connections.log >2024-02-26 13:32:19 - CommonName connected with IP

Re: [Openvpn-users] Client history

2024-02-26 Thread Peter Davis via Openvpn-users
> On Monday, February 26th, 2024 at 1:42 PM, Gert Doering > wrote: > Hi, > > On Mon, Feb 26, 2024 at 10:10:23AM +, Peter Davis wrote: > > > I have two scripts. The second script worked, but puts the data in the /tmp > > directory. > > I selected the "/tmp" directory, so this is not

Re: [Openvpn-users] Client history

2024-02-26 Thread Gert Doering
Hi, On Mon, Feb 26, 2024 at 10:10:23AM +, Peter Davis wrote: > I have two scripts. The second script worked, but puts the data in the /tmp > directory. > I selected the "/tmp" directory, so this is not related to the permission! If you have a working script, then why not use that? (And

Re: [Openvpn-users] Client history

2024-02-26 Thread Peter Davis via Openvpn-users
> On Monday, February 26th, 2024 at 10:55 AM, Gert Doering > wrote: > Hi, > > On Sun, Feb 25, 2024 at 06:50:39PM +, Peter Davis via Openvpn-users wrote: > > > But my problem is that the script doesn't work at all. How do I find the > > cause? > > > Last thing you said is it does work

Re: [Openvpn-users] Client history

2024-02-26 Thread Peter Davis via Openvpn-users
> On Monday, February 26th, 2024 at 12:05 AM, Bo Berglund > wrote: > On Sun, 25 Feb 2024 10:50:05 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > > Hello, > > > I installed shellcheck and result is: > > > > > > # shellcheck script-events.sh > > > > > >

Re: [Openvpn-users] Client history

2024-02-25 Thread Gert Doering
Hi, On Sun, Feb 25, 2024 at 06:50:39PM +, Peter Davis via Openvpn-users wrote: > But my problem is that the script doesn't work at all. How do I find the > cause? Last thing you said is it *does* work when logging to /tmp (though systemd hides it in the private /tmp directory). So if all

Re: [Openvpn-users] Client history

2024-02-25 Thread Peter Davis via Openvpn-users
> On Sunday, February 25th, 2024 at 6:20 PM, Bo Berglund > wrote: > On Sun, 25 Feb 2024 15:31:20 +0100, Bo Berglund bo.bergl...@gmail.com wrote: > > > On Sun, 25 Feb 2024 10:50:05 +, Peter Davis via Openvpn-users > > openvpn-users@lists.sourceforge.net wrote: > > > > > Hello, > > > I

Re: [Openvpn-users] Client history

2024-02-25 Thread Bo Berglund
On Sun, 25 Feb 2024 10:50:05 +, Peter Davis via Openvpn-users wrote: >>Hello, >>I installed shellcheck and result is: >> >># shellcheck script-events.sh >> >>In script-events.sh line 14: >>if [[ "$script_type" == "client-connect" ]]; then >> ^--^ SC2154 (warning): script_type

Re: [Openvpn-users] Client history

2024-02-25 Thread Bo Berglund
On Sun, 25 Feb 2024 15:31:20 +0100, Bo Berglund wrote: >On Sun, 25 Feb 2024 10:50:05 +, Peter Davis via Openvpn-users > wrote: > >>Hello, >>I installed shellcheck and result is: >> >># shellcheck script-events.sh >> >>In script-events.sh line 14: >>if [[ "$script_type" == "client-connect"

Re: [Openvpn-users] Client history

2024-02-25 Thread Bo Berglund
On Sun, 25 Feb 2024 10:50:05 +, Peter Davis via Openvpn-users wrote: >Hello, >I installed shellcheck and result is: > ># shellcheck script-events.sh > >In script-events.sh line 14: >if [[ "$script_type" == "client-connect" ]]; then > ^--^ SC2154 (warning): script_type is

Re: [Openvpn-users] Client history

2024-02-25 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 4:39 PM, Bo Berglund > wrote: > On Fri, 23 Feb 2024 13:24:36 +0100, Gert Doering g...@greenie.muc.de wrote: > > > I think at this point you need to familiarize yourself with shell > > scripting to ensure that script is well-behaved. > > > And using

Re: [Openvpn-users] Client history

2024-02-23 Thread Bo Berglund
On Fri, 23 Feb 2024 13:24:36 +0100, Gert Doering wrote: >I think at this point you need to familiarize yourself with shell >scripting to ensure that script is well-behaved. And using shellcheck after editing/creating a script file also helps in getting rid of syntax errors etc... "sudo apt

Re: [Openvpn-users] Client history

2024-02-23 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 3:54 PM, Gert Doering > wrote: > Hi, > > On Fri, Feb 23, 2024 at 12:20:32PM +, Peter Davis via Openvpn-users wrote: > > > 2024-02-23 15:46:43 Peter/172.20.1.254:44526 OPTIONS IMPORT: reading client > > specific options from:

Re: [Openvpn-users] Client history

2024-02-23 Thread Gert Doering
Hi, On Fri, Feb 23, 2024 at 12:20:32PM +, Peter Davis via Openvpn-users wrote: > 2024-02-23 15:46:43 Peter/172.20.1.254:44526 OPTIONS IMPORT: reading client > specific options from: /tmp/openvpn_cc_49daa49dc12e3fd51fc8e9f83942bc70.tmp > 2024-02-23 15:46:43 Peter/172.20.1.254:44526 Options

Re: [Openvpn-users] Client history

2024-02-23 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 3:33 PM, Bo Berglund > wrote: > On Fri, 23 Feb 2024 11:36:39 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > > On Friday, February 23rd, 2024 at 2:50 PM, Bo Berglund > > > bo.bergl...@gmail.com wrote: > > > > > On

Re: [Openvpn-users] Client history

2024-02-23 Thread Bo Berglund
On Fri, 23 Feb 2024 11:36:39 +, Peter Davis via Openvpn-users wrote: >> On Friday, February 23rd, 2024 at 2:50 PM, Bo Berglund >> wrote: > >> On Fri, 23 Feb 2024 10:33:19 +, Peter Davis via Openvpn-users >> openvpn-users@lists.sourceforge.net wrote: >> >> > # mkdir /etc/openvpn/Log/

Re: [Openvpn-users] Client history

2024-02-23 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 2:50 PM, Bo Berglund > wrote: > On Fri, 23 Feb 2024 10:33:19 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > But: > > > > # ls /etc/openvpn/Log/ > > # > > > > No files have been created. > > > Logfile is created

Re: [Openvpn-users] Client history

2024-02-23 Thread Bo Berglund
On Fri, 23 Feb 2024 10:33:19 +, Peter Davis via Openvpn-users wrote: >But: > ># ls /etc/openvpn/Log/ ># > >No files have been created. Logfile is created following a login to the OpenVPN server you have configured for logging. -- Bo Berglund Developer in Sweden

Re: [Openvpn-users] Client history

2024-02-23 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 12:36 PM, Bo Berglund > wrote: > On Fri, 23 Feb 2024 08:12:47 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Thanks again. > > You right. Logs are under > >

Re: [Openvpn-users] Client history

2024-02-23 Thread Bo Berglund
On Fri, 23 Feb 2024 08:12:47 +, Peter Davis via Openvpn-users wrote: >Hi, >Thanks again. >You right. Logs are under >"/tmp/systemd-private-0b76fd773c1b491090b475708960936b-openvpn\@server.service-kEyUKj/tmp/Connections.log". > >Why is nothing written to the file when I create it in the

Re: [Openvpn-users] Client history

2024-02-23 Thread Gert Doering
Hi, On Fri, Feb 23, 2024 at 08:12:47AM +, Peter Davis wrote: > Why is nothing written to the file when I create it in the "/var/log/openvpn > directory"? > > # ls -l /var/log/openvpn/ > total 40 > -rw-r--r-- 1 root root 0 Feb 23 10:16 Connections.log > -rw--- 1 root root 603 Feb

Re: [Openvpn-users] Client history

2024-02-23 Thread Peter Davis via Openvpn-users
> On Friday, February 23rd, 2024 at 10:58 AM, Gert Doering > wrote: > Hi > > On Fri, Feb 23, 2024 at 07:05:46AM +, Peter Davis wrote: > > > log_file="/tmp/Connections.log" > > > Don't use /tmp in systemd environments - that was bad advice by one of > the other posters. Systemd likes to

Re: [Openvpn-users] Client history

2024-02-22 Thread Gert Doering
Hi On Fri, Feb 23, 2024 at 07:05:46AM +, Peter Davis wrote: > log_file="/tmp/Connections.log" Don't use /tmp in systemd environments - that was bad advice by one of the other posters. Systemd likes to do per-service /tmp directories, so your log file is likely somewhere in

Re: [Openvpn-users] Client history

2024-02-22 Thread Peter Davis via Openvpn-users
> On Wednesday, February 21st, 2024 at 9:48 PM, Gert Doering > wrote: > Hi, > > On Wed, Feb 21, 2024 at 05:53:59PM +, Peter Davis via Openvpn-users wrote: > > > What is wrong? > > > Have you enabled the script in the openvpn config? Including raising > script-security? What does the

Re: [Openvpn-users] Client history

2024-02-21 Thread Jochen Bern
On 21.02.24 18:53, Peter Davis via Openvpn-users wrote: LOG_FILE="/var/log/openvpn/Connections.log" I restarted the OpenVPN service and connected to the OpenVPN server with a client. I checked the file, but it was empty and nothing was registered. What is wrong? Are directory and file writable

Re: [Openvpn-users] Client history

2024-02-21 Thread Gert Doering
Hi, On Wed, Feb 21, 2024 at 05:53:59PM +, Peter Davis via Openvpn-users wrote: > What is wrong? Have you enabled the script in the openvpn config? Including raising script-security? What does the openvpn server log look like? (It's always the same question "what is in the logs?" so you

Re: [Openvpn-users] Client history

2024-02-21 Thread Peter Davis via Openvpn-users
> On Wednesday, February 21st, 2024 at 5:18 PM, Bo Berglund > wrote: > On Wed, 21 Feb 2024 11:04:48 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hello, > > I use Debian. I used "bash" instead of "sh": > > > > # bash script-events.sh > >

Re: [Openvpn-users] Client history

2024-02-21 Thread tincantech via Openvpn-users
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, On Wednesday, 21 February 2024 at 06:59, Peter Davis via Openvpn-users wrote: > Hi, > I got the following error: > > # sh /etc/openvpn/scripts/script-events.sh > /etc/openvpn/scripts/script-events.sh: 6: [: ==: unexpected operator >

Re: [Openvpn-users] Client history

2024-02-21 Thread Bo Berglund
On Wed, 21 Feb 2024 11:04:48 +, Peter Davis via Openvpn-users wrote: > >Hello, >I use Debian. I used "bash" instead of "sh": > ># bash script-events.sh >script-events.sh: line 6: [: ==: unary operator expected > >I changed "[" to "[[": > ># bash script-events.sh ># > >Seems OK? You also

Re: [Openvpn-users] Client history

2024-02-21 Thread Peter Davis via Openvpn-users
>On Wednesday, February 21st, 2024 at 1:01 PM, Bo Berglund > wrote: > On Wed, 21 Feb 2024 06:59:25 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > > On Tuesday, February 20th, 2024 at 8:26 PM, Bo Berglund > > > bo.bergl...@gmail.com wrote: > > > > > On

Re: [Openvpn-users] Client history

2024-02-21 Thread Bo Berglund
On Wed, 21 Feb 2024 06:59:25 +, Peter Davis via Openvpn-users wrote: >> On Tuesday, February 20th, 2024 at 8:26 PM, Bo Berglund >> wrote: > >> On Tue, 20 Feb 2024 11:29:36 +, Peter Davis via Openvpn-users >> openvpn-users@lists.sourceforge.net wrote: >> >> > Hi, >> > Thanks again. >>

Re: [Openvpn-users] Client history

2024-02-20 Thread Peter Davis via Openvpn-users
> On Tuesday, February 20th, 2024 at 8:26 PM, Bo Berglund > wrote: > On Tue, 20 Feb 2024 11:29:36 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Thanks again. > > Can you make the report be saved to a file? > > > Are you trolling me? > > What

Re: [Openvpn-users] Client history

2024-02-20 Thread Peter Davis via Openvpn-users
> On Tuesday, February 20th, 2024 at 8:26 PM, Bo Berglund > wrote: > On Tue, 20 Feb 2024 11:29:36 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Thanks again. > > Can you make the report be saved to a file? > > > Are you trolling me? > > What

Re: [Openvpn-users] Client history

2024-02-20 Thread Bo Berglund
On Tue, 20 Feb 2024 11:29:36 +, Peter Davis via Openvpn-users wrote: >Hi, >Thanks again. >Can you make the report be saved to a file? Are you trolling me? What do you think this does? : LOG_FILE="/etc/openvpn/log/server-events.log" echo "$LOG_TIMESTAMP - $common_name connected with IP

Re: [Openvpn-users] Client history

2024-02-20 Thread Peter Davis via Openvpn-users
> On Monday, February 19th, 2024 at 5:16 PM, Bo Berglund > wrote: > On Mon, 19 Feb 2024 11:57:43 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Thanks again. > > Can you put the script somewhere like pastebin? I can't fix it. > > > I modified

Re: [Openvpn-users] Client history

2024-02-19 Thread Bo Berglund
On Mon, 19 Feb 2024 11:57:43 +, Peter Davis via Openvpn-users wrote: >Hi, >Thanks again. >Can you put the script somewhere like pastebin? I can't fix it. I modified the script so it can be used without call argument like I have done, then the logfile defined in the script is used, otherwise

Re: [Openvpn-users] Client history

2024-02-19 Thread Peter Davis via Openvpn-users
> On Sunday, February 18th, 2024 at 5:57 PM, Bo Berglund > wrote: > On Sun, 18 Feb 2024 09:44:14 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > Hi, > > Mine is: > > > > # ls -l scripts/script-events.sh > > -rwxr-xr-x 1 root root 543 Feb 18 10:11

Re: [Openvpn-users] Client history

2024-02-18 Thread Bo Berglund
On Sun, 18 Feb 2024 09:44:14 +, Peter Davis via Openvpn-users wrote: >Hi, >Mine is: > ># ls -l scripts/script-events.sh >-rwxr-xr-x 1 root root 543 Feb 18 10:11 scripts/script-events.sh > >And Server.conf is: >... >script-security 2 >client-connect /etc/openvpn/scripts/script-events.sh

Re: [Openvpn-users] Client history

2024-02-18 Thread Peter Davis via Openvpn-users
> On Sunday, February 18th, 2024 at 12:27 PM, Bo Berglund > wrote: > On Sun, 18 Feb 2024 06:50:06 +, Peter Davis via Openvpn-users > openvpn-users@lists.sourceforge.net wrote: > > > > SOLUTION > > > > > > Just to follow up on my question > > > - > > > I

Re: [Openvpn-users] Client history

2024-02-18 Thread Bo Berglund
On Sun, 18 Feb 2024 06:50:06 +, Peter Davis via Openvpn-users wrote: >> SOLUTION >> >> Just to follow up on my question >> - >> I have done the following and it seems to work: >> >> /etc/openvpn/server/serverlocal.conf: >> >> #Add logging of client

Re: [Openvpn-users] Client history

2024-02-17 Thread Peter Davis via Openvpn-users
> On Friday, February 16th, 2024 at 2:10 PM, Bo Berglund > wrote: > On Wed, 14 Feb 2024 08:34:38 +0100, Bo Berglund bo.bergl...@gmail.com wrote: > > > I also want to log server side client connect/disconnect events on my > > server. > > > > And I have tried to read the documentation here: >

Re: [Openvpn-users] Client history

2024-02-16 Thread Bo Berglund
On Wed, 14 Feb 2024 08:34:38 +0100, Bo Berglund wrote: >I also want to log server side client connect/disconnect events on my server. > >And I have tried to read the documentation here: >https://openvpn.net/community-resources/reference-manual-for-openvpn-2-5/ > >I can find a lot of entries for

Re: [Openvpn-users] Client history

2024-02-13 Thread Bo Berglund
On Tue, 13 Feb 2024 13:28:27 -0500, mike tancsa wrote: >On 2/13/2024 1:13 PM, Peter Davis via Openvpn-users wrote: >> Hello, >> 1- Is there a way to report when clients connect and disconnect? >> >> 2- Is it possible to notify the connection of a specific client to the >> server through email?

Re: [Openvpn-users] Client history

2024-02-13 Thread Gert Doering
Hi, On Tue, Feb 13, 2024 at 06:37:03PM +, Peter Davis via Openvpn-users wrote: > I mean, does OpenVPN itself have the ability to keep the IP address of the > client and the time it is connected to the server somewhere for reporting? No. This is something we have script/plugin interfaces

Re: [Openvpn-users] Client history

2024-02-13 Thread Gert Doering
Hi, On Tue, Feb 13, 2024 at 06:13:37PM +, Peter Davis via Openvpn-users wrote: > 1- Is there a way to report when clients connect and disconnect? > > 2- Is it possible to notify the connection of a specific client to the server > through email? I seem to have managed --client-connect

Re: [Openvpn-users] Client history

2024-02-13 Thread mike tancsa
On 2/13/2024 1:13 PM, Peter Davis via Openvpn-users wrote: Hello, 1- Is there a way to report when clients connect and disconnect? 2- Is it possible to notify the connection of a specific client to the server through email? On the server, you can use the client-connect/disconnect config.

Re: [Openvpn-users] Client history

2024-02-13 Thread mike tancsa
On 2/13/2024 1:37 PM, Peter Davis wrote: > On Tuesday, February 13th, 2024 at 9:58 PM, mike tancsa wrote: On 2/13/2024 1:13 PM, Peter Davis via Openvpn-users wrote: Hello, 1- Is there a way to report when clients connect and disconnect? 2- Is it possible to notify the connection of a

Re: [Openvpn-users] Client history

2024-02-13 Thread Peter Davis via Openvpn-users
> On Tuesday, February 13th, 2024 at 9:58 PM, mike tancsa > wrote: > On 2/13/2024 1:13 PM, Peter Davis via Openvpn-users wrote: > >> Hello, >> 1- Is there a way to report when clients connect and disconnect? >> >> 2- Is it possible to notify the connection of a specific client to the >> server

[Openvpn-users] Client history

2024-02-13 Thread Peter Davis via Openvpn-users
Hello, 1- Is there a way to report when clients connect and disconnect? 2- Is it possible to notify the connection of a specific client to the server through email? Thank you.___ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net