Re: [Openvpn-devel] Bytecount Reporting

2010-03-18 Thread Eike Lohmann


Or you can user the radiusplugin from Ralf 
(http://www.nongnu.org/radiusplugin/) use a radius server and set an 
accounting interval.


Regards, Eike



Am 17.03.2010 23:38, schrieb Davide Brini:

On Wednesday 17 March 2010, open...@rkmorris.us wrote:

   

I am trying to write an application that monitors traffic over an OpenVPN
  link - by using bytecount information from the management interface.
  However, after I telnet in, and enter "bytecount 1" (for 1 second
  updates), I find that the real-time bytecount updates are not really every
  second. They seem to be initially, but soon slow down (to an update every
  5-10 seconds).
 

Sorry for avoiding a direct answer to the question (David has already
addressed that quite well), but I just wanted to tell you that you can get
byte counts from OpenVPN's status file, ie the one you specify with "--
status". I used that in the past to monitor clients and traffic (it was
actually a Munin plugin that read the file and collected the data).
That said, it might not suit your requirements, but I thought I mentioned that
just in case.

   





Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread Davide Brini
On Wednesday 17 March 2010, open...@rkmorris.us wrote:
> Hi Davide,
> 
> 
> 
> Yes, that makes sense - and I was going to do that originally, but I
>  figured the real-time bytecount would result in less traffic (and text
>  parsing). One question though ... you say "status file". Do you really
>  mean a file? I can execute the status command over the Management
>  Interface, but it's really a telnet type response, not in a file.

Yes, it's a real file. For example, you say

status /var/run/openvpn.status 10

and here's an example of what you get there (updated every 10 seconds, as per 
the above directive):

# cat /var/run/openvpn.status
OpenVPN CLIENT LIST
Updated,Wed Mar 17 22:56:47 2010
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
CLIENT2,78.X.X.X:37298,742906,512337,Wed Mar 17 18:11:44 2010
DHOME,81.X.X.X:52424,3746,4900,Wed Mar 17 22:56:29 2010
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
10.180.0.4,CLIENT2,78.X.X.X:37298,Wed Mar 17 18:11:45 2010
10.180.0.9,DHOME,81.X.X.X:52424,Wed Mar 17 22:56:30 2010
GLOBAL STATS
Max bcast/mcast queue length,0
END

Easily parsable with sed/awk/perl/whatever you like.
You can even choose among three different formats (all easily parsable) by 
using the "--status-version [n]" option (the above is format 1). See the man 
for the details.

-- 
D.



Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread openvpn
Hi Davide,

 

Yes, that makes sense - and I was going to do that originally, but I figured 
the real-time bytecount would result in less traffic (and text parsing). One 
question though ... you say "status file". Do you really mean a file? I can 
execute the status command over the Management Interface, but it's really a 
telnet type response, not in a file.

 

Thanks,

... Russell


On Wed, Mar 17, 2010 05:38 PM, Davide Brini  wrote:


> 
On Wednesday 17 March 2010, open...@rkmorris.us wrote:
> 
> > I am trying to write an application that monitors traffic over an OpenVPN
> > link - by using bytecount information from the management interface.
> > However, after I telnet in, and enter "bytecount 1" (for 1 second
> > updates), I find that the real-time bytecount updates are not really every
> > second. They seem to be initially, but soon slow down (to an update every
> > 5-10 seconds).
> 
> Sorry for avoiding a direct answer to the question (David has already 
> addressed that quite well), but I just wanted to tell you that you can get 
> byte counts from OpenVPN's status file, ie the one you specify with "--
> status". I used that in the past to monitor clients and traffic (it was 
> actually a Munin plugin that read the file and collected the data).
> That said, it might not suit your requirements, but I thought I mentioned 
> that 
> just in case.
> 
> --
> D.
> 
> --
> Download IntelĀ® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
> 

Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread Davide Brini
On Wednesday 17 March 2010, open...@rkmorris.us wrote:

> I am trying to write an application that monitors traffic over an OpenVPN
>  link - by using bytecount information from the management interface.
>  However, after I telnet in, and enter "bytecount 1" (for 1 second
>  updates), I find that the real-time bytecount updates are not really every
>  second. They seem to be initially, but soon slow down (to an update every
>  5-10 seconds).

Sorry for avoiding a direct answer to the question (David has already 
addressed that quite well), but I just wanted to tell you that you can get 
byte counts from OpenVPN's status file, ie the one you specify with "--
status". I used that in the past to monitor clients and traffic (it was 
actually a Munin plugin that read the file and collected the data).
That said, it might not suit your requirements, but I thought I mentioned that 
just in case.

-- 
D.



Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread David Sommerseth
On 17/03/10 23:01, open...@rkmorris.us wrote:
> Hi,
> 
> All very good questions! Some thoughts, below.
> 
> Thanks for all your help!
> ... Russell
> 
> On Wed, Mar 17, 2010 05:01 PM, David Sommerseth 
>  wrote:
>>
> On 17/03/10 22:40, open...@rkmorris.us wrote:
>>> Hi,
>>>
>>>
>>>
>>> I'm running OpenVPN (client) on Windows - connecting to a Linux Server. 
>>
>> I'm presuming you're connecting to the management interface on the Linux
>> server.
> Russell: No, on the local client (i.e. on Windows). This avoids having to 
> send information over the link (=wasted bandwidth, and lower speed).
>>
>>> I am wondering if a value isn't reported if there is no traffic - that 
>>> could be part of this 
>>
>> I have a feeling this is the reality. As I don't see any timer alarms
>> scheduled in the management part of the code. So I need to see this
>> more in connection with the main part of the event loop code. But I
>> believe this is the case.
>
> Russell: Understood - if it is please just let me know.

Will do!

>>> (though it would be better to report information anyways).
>>>
>>> Make sense?
>>
>> Yeah, I can see your point. But isn't the information going to be
>> rather useless if it hasn't changed? If there is no change, no need to
>> dump the same info once again. What do you think?
>
> Russell: I understand your point, but I'm also wanting to show transfer rate, 
> and plot the data (which would be easiest if the data arrives uniformly). Not 
> a huge issue, but I would to at least like to understand why this is the 
> case. I guess if this is the way it works it should at least be captured in 
> the documentation for the Management Interface, right?

I'll definitely look into this!  And if the behaviour is in need of
network traffic, updating the docs is always the quickest and safest
update we can do :)


kind regards,

David Sommerseth




>>> On Wed, Mar 17, 2010 04:01 PM, David Sommerseth 
>>>  wrote:
>>>
>>>

>>> On 17/03/10 20:46, open...@rkmorris.us wrote:
> Hi,
>
> I am trying to write an application that monitors traffic over an OpenVPN 
> link - by using bytecount information from the management interface. 
> However, after I telnet in, and enter "bytecount 1" (for 1 second 
> updates), I find that the real-time bytecount updates are not really 
> every second. They seem to be initially, but soon slow down (to an update 
> every 5-10 seconds).
>
> Is this expected, or a known issue?

 Hi,

 I'd say this is probably unexpected. But I'd like to know a little bit
 more about your setup. What kind of OS are you running OpenVPN?

 It sounds like your OpenVPN process get lower priority somehow. But it
 could also be that it is dependent on the amount of traffic passing over
 the tunnel. I'll dig more into the code to see if there are some
 oddities there before concluding.


 kind regards,

 David Sommerseth

>>
>>




Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread openvpn
Hi,

 

All very good questions! Some thoughts, below.

 

Thanks for all your help!

 

... Russell


On Wed, Mar 17, 2010 05:01 PM, David Sommerseth  
wrote:


> 
On 17/03/10 22:40, open...@rkmorris.us wrote:
> > Hi,
> > 
> > 
> > 
> > I'm running OpenVPN (client) on Windows - connecting to a Linux Server. 
> 
> I'm presuming you're connecting to the management interface on the Linux
> server.
>> Russell: No, on the local client (i.e. on Windows). This avoids having to 
>> send information over the link (=wasted bandwidth, and lower speed).
> 
> 
> > I am wondering if a value isn't reported if there is no traffic - that 
> > could be part of this 
> 
> I have a feeling this is the reality. As I don't see any timer alarms
> scheduled in the management part of the code. So I need to see this
> more in connection with the main part of the event loop code. But I
> believe this is the case.
>> Russell: Understood - if it is please just let me know.
> 
> > (though it would be better to report information anyways).
> > 
> > Make sense?
> 
> Yeah, I can see your point. But isn't the information going to be
> rather useless if it hasn't changed? If there is no change, no need to
> dump the same info once again. What do you think?
>> Russell: I understand your point, but I'm also wanting to show transfer 
>> rate, and plot the data (which would be easiest if the data arrives 
>> uniformly). Not a huge issue, but I would to at least like to understand why 
>> this is the case. I guess if this is the way it works it should at least be 
>> captured in the documentation for the Management Interface, right?
> 
> 
> kind regards,
> 
> David Sommerseth
> 
> 
> 
> > On Wed, Mar 17, 2010 04:01 PM, David Sommerseth 
> >  wrote:
> > 
> > 
> >>
> > On 17/03/10 20:46, open...@rkmorris.us wrote:
> >>> Hi,
> >>>
> >>> I am trying to write an application that monitors traffic over an OpenVPN 
> >>> link - by using bytecount information from the management interface. 
> >>> However, after I telnet in, and enter "bytecount 1" (for 1 second 
> >>> updates), I find that the real-time bytecount updates are not really 
> >>> every second. They seem to be initially, but soon slow down (to an update 
> >>> every 5-10 seconds).
> >>>
> >>> Is this expected, or a known issue?
> >>
> >> Hi,
> >>
> >> I'd say this is probably unexpected. But I'd like to know a little bit
> >> more about your setup. What kind of OS are you running OpenVPN?
> >>
> >> It sounds like your OpenVPN process get lower priority somehow. But it
> >> could also be that it is dependent on the amount of traffic passing over
> >> the tunnel. I'll dig more into the code to see if there are some
> >> oddities there before concluding.
> >>
> >>
> >> kind regards,
> >>
> >> David Sommerseth
> >>
> 
> 

Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread David Sommerseth
On 17/03/10 22:40, open...@rkmorris.us wrote:
> Hi,
> 
>  
> 
> I'm running OpenVPN (client) on Windows - connecting to a Linux Server. 

I'm presuming you're connecting to the management interface on the Linux
server.


> I am wondering if a value isn't reported if there is no traffic - that could 
> be part of this 

I have a feeling this is the reality.  As I don't see any timer alarms
scheduled in the management part of the code.  So I need to see this
more in connection with the main part of the event loop code.  But I
believe this is the case.

> (though it would be better to report information anyways).
> 
> Make sense?

Yeah, I can see your point.  But isn't the information going to be
rather useless if it hasn't changed?  If there is no change, no need to
dump the same info once again.  What do you think?


kind regards,

David Sommerseth



> On Wed, Mar 17, 2010 04:01 PM, David Sommerseth 
>  wrote:
> 
> 
>>
> On 17/03/10 20:46, open...@rkmorris.us wrote:
>>> Hi,
>>>
>>> I am trying to write an application that monitors traffic over an OpenVPN 
>>> link - by using bytecount information from the management interface. 
>>> However, after I telnet in, and enter "bytecount 1" (for 1 second updates), 
>>> I find that the real-time bytecount updates are not really every second. 
>>> They seem to be initially, but soon slow down (to an update every 5-10 
>>> seconds).
>>>
>>> Is this expected, or a known issue?
>>
>> Hi,
>>
>> I'd say this is probably unexpected. But I'd like to know a little bit
>> more about your setup. What kind of OS are you running OpenVPN?
>>
>> It sounds like your OpenVPN process get lower priority somehow. But it
>> could also be that it is dependent on the amount of traffic passing over
>> the tunnel. I'll dig more into the code to see if there are some
>> oddities there before concluding.
>>
>>
>> kind regards,
>>
>> David Sommerseth
>>




Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread openvpn
Hi,

 

I'm running OpenVPN (client) on Windows - connecting to a Linux Server. I am 
wondering if a value isn't reported if there is no traffic - that could be part 
of this (though it would be better to report information anyways).

 

Make sense?

 

Thanks!

 

... Russell


On Wed, Mar 17, 2010 04:01 PM, David Sommerseth  
wrote:


> 
On 17/03/10 20:46, open...@rkmorris.us wrote:
> > Hi,
> > 
> > I am trying to write an application that monitors traffic over an OpenVPN 
> > link - by using bytecount information from the management interface. 
> > However, after I telnet in, and enter "bytecount 1" (for 1 second updates), 
> > I find that the real-time bytecount updates are not really every second. 
> > They seem to be initially, but soon slow down (to an update every 5-10 
> > seconds).
> > 
> > Is this expected, or a known issue?
> 
> Hi,
> 
> I'd say this is probably unexpected. But I'd like to know a little bit
> more about your setup. What kind of OS are you running OpenVPN?
> 
> It sounds like your OpenVPN process get lower priority somehow. But it
> could also be that it is dependent on the amount of traffic passing over
> the tunnel. I'll dig more into the code to see if there are some
> oddities there before concluding.
> 
> 
> kind regards,
> 
> David Sommerseth
> 

Re: [Openvpn-devel] Bytecount Reporting

2010-03-17 Thread David Sommerseth
On 17/03/10 20:46, open...@rkmorris.us wrote:
> Hi,
> 
> I am trying to write an application that monitors traffic over an OpenVPN 
> link - by using bytecount information from the management interface. However, 
> after I telnet in, and enter "bytecount 1" (for 1 second updates), I find 
> that the real-time bytecount updates are not really every second. They seem 
> to be initially, but soon slow down (to an update every 5-10 seconds).
> 
> Is this expected, or a known issue?

Hi,

I'd say this is probably unexpected.  But I'd like to know a little bit
more about your setup.  What kind of OS are you running OpenVPN?

It sounds like your OpenVPN process get lower priority somehow.  But it
could also be that it is dependent on the amount of traffic passing over
the tunnel.  I'll dig more into the code to see if there are some
oddities there before concluding.


kind regards,

David Sommerseth



[Openvpn-devel] Bytecount Reporting

2010-03-17 Thread openvpn
Hi,

 

I am trying to write an application that monitors traffic over an OpenVPN link 
- by using bytecount information from the management interface. However, after 
I telnet in, and enter "bytecount 1" (for 1 second updates), I find that the 
real-time bytecount updates are not really every second. They seem to be 
initially, but soon slow down (to an update every 5-10 seconds).

 

Is this expected, or a known issue?

 

Thanks!