Bug 13838

Summary: OpenVPN: No statistics are shown on page "OpenVPN: Road Warrior Statistics"
Product: IPFire Reporter: datamorgana <datamorgana>
Component: ---Assignee: Adolf Belka <adolf.belka>
Status: ASSIGNED --- QA Contact:
Severity: Minor Usability    
Priority: - Unknown - CC: adolf.belka, Hartmut.Manz, tim
Version: 2   
Hardware: x86_64   
OS: Linux   
See Also: https://bugzilla.ipfire.org/show_bug.cgi?id=13834

Description datamorgana 2025-04-02 19:37:01 UTC
This bug has been mentioned the first time in:
https://community.ipfire.org/t/no-statistics-are-shown-on-openvpn-road-warrior-statistics/13881

Preconditions:

- Platform: IPFire 2.29 (x86_64) - Core-Update 192

- In the page "Services > OpenVPN", do the following:
  -- Delete all clients
  -- Delete the CA
  -- Create a new CA
  -- Create a new client

- Delete old statistics files:
  -- As root: # /etc/init.d/collectd stop && rm /var/log/rrd/collectd/localhost/openvpn-*/* && /etc/init.d/collectd start

- Configure a new client,
  -- named "clientA"
  -- with OpenVPN für Android 0.7.57 by Arne Schwabe on an Android 15 phone.

Test steps:

1. With the new client "clientA", establish a new connection to the IPFire
2. Keep the session for at least 5 minutes.
3. During the session, watch and reload the page on IPFire "Status > OpenVPN: Road Warrior Statistics".

Expected result:
- Traffic statistics are visible in a graph for client "clientA", similar to page "Status >  Net-Traffic graphs (external)".

Actual result:
- Page stays empty, no graphs are visible.

Addition Information:

- During the session, the following file was created and constantly updated: /var/log/rrd/collectd/localhost/openvpn-clientA/if_octets.rrd


Thanks!
Comment 1 Adolf Belka 2025-04-02 20:32:25 UTC
The names of the rrd files for the openvpn data were obviously changed with collectd-5.12.0

It looks like the word derive in the filenames has been removed with the new version.

Needs to find all locations where the old filenames were used and replace them with the new name.
Comment 2 Tim Zakharov 2025-04-04 19:06:02 UTC
I do not believe all of your preconditions need to apply.  My existing OpenVPN system has stopped graphing as well after updating to Core192.  I did not have to delete and recreate clients, CAs, etc.  The existing users continue to work after updating to Core192, but graphing stopped working after the update.
Comment 3 datamorgana 2025-04-07 14:35:44 UTC
(In reply to Tim Zakharov from comment #2)
> I do not believe all of your preconditions need to apply.

Correct, it is not always necessary and in your case you have added a valid and new perspective to the bug. In general it is common practice in the testing business to create a defined starting position (aka pre-condition) to allow anyone to get same results when following the steps of the test case.
Comment 5 Hartmut Manz 2025-04-08 16:44:40 UTC
to fix BUG 13834 I had to apply the following change in addition to get it working:

in File /srv/web/ipfire/cgi-bin/netexternal.cgi
I have changed the line 62 from:

if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-tun0.rrd"){

to

if (-e "/var/log/rrd/collectd/localhost/interface-tun0/if_octets.rrd"){

Maybe the same change would be required for ipsec0 interface.

Now its working again
Comment 6 Adolf Belka 2025-04-09 08:52:25 UTC
(In reply to Hartmut Manz from comment #5)
> to fix BUG 13834 I had to apply the following change in addition to get it
> working:
> 
> in File /srv/web/ipfire/cgi-bin/netexternal.cgi
> I have changed the line 62 from:
> 
> if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-tun0.rrd"){
> 
> to
> 
> if (-e "/var/log/rrd/collectd/localhost/interface-tun0/if_octets.rrd"){
> 
> Maybe the same change would be required for ipsec0 interface.
> 

Yes that change is needed but also the ipsec0 and tun0 changes have to also be made in the initscript for the red networking startup.

Also changes need to be made for the net2net openvpn.

Some of these changes are needed in the WUI cgi page code but also some need to be made in the graphs.pl file.

I hope to be able to submit a patch for these othe changes somewhere in the next few days but my time is constrained at the moment.

However, I am sure it will end up in CU194.