]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
first pass of fixing statistics
authorAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2023 15:28:50 +0000 (10:28 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2023 21:30:01 +0000 (16:30 -0500)
They still don't work, but at least there's a path forward

raddb/sites-available/status
src/modules/rlm_stats/rlm_stats.c

index 19132718cedf2dc9bc7541cc35e4889b7809a1e1..4d6c7254abda3f8ea00f955fbb6af7aceab70b87 100644 (file)
@@ -58,9 +58,13 @@ server status {
        }
 
        #
-       #  Simple authorize section.  The "Autz-Type Status-Server"
-       #  section will work here, too.  See "raddb/sites-available/default".
+       #  Receive a Status-Server packet
+       #
        recv Status-Server {
+               #
+               #  Add statistics based on the Vendor-Specific.FreeRADIUS.Stats4-* queries.
+               #
+               status
                ok
        }
 }
@@ -68,53 +72,19 @@ server status {
 #      Statistics can be queried via a number of methods:
 #
 #      All packets received/sent by the server (1 = auth, 2 = acct)
-#              FreeRADIUS-Statistics-Type = 3
-#
-#      All packets proxied by the server (4 = proxy-auth, 8 = proxy-acct)
-#              FreeRADIUS-Statistics-Type = 12
-#
-#      All packets sent && received:
-#              FreeRADIUS-Statistics-Type = 15
-#
-#      Internal server statistics:
-#              FreeRADIUS-Statistics-Type = 16
+#              Vendor-Specific.FreeRADIUS.Stats4-Type = Global
 #
 #      All packets for a particular client (globally defined)
-#              FreeRADIUS-Statistics-Type = 35
-#              FreeRADIUS-Stats-Client-IP-Address = 192.0.2.1
+#              Vendor-Specific.FreeRADIUS.Stats4-Type = Client
+#              Vendor-Specific.FreeRADIUS.Stats4-IPv4-Address = 192.0.2.1
 #
 #      All packets for a client attached to a "listen" ip/port
-#              FreeRADIUS-Statistics-Type = 35
-#              FreeRADIUS-Stats-Client-IP-Address = 192.0.2.1
-#              FreeRADIUS-Stats-Server-IP-Address = 127.0.0.1
-#              FreeRADIUS-Stats-Server-Port = 1812
-#
-#      All packets for a "listen" IP/port
-#              FreeRADIUS-Statistics-Type = 67
-#              FreeRADIUS-Stats-Server-IP-Address = 127.0.0.1
-#              FreeRADIUS-Stats-Server-Port = 1812
+#              Vendor-Specific.FreeRADIUS.Stats4-Type = Listener
+#              Vendor-Specific.FreeRADIUS.Stats4-IPv4-Address = 192.0.2.1
+#              Vendor-Specific.FreeRADIUS.Stats4-port = 1812
 #
-#      All packets for a home server IP / port
-#              FreeRADIUS-Statistics-Type = 131
-#              FreeRADIUS-Stats-Server-IP-Address = 192.0.2.2
-#              FreeRADIUS-Stats-Server-Port = 1812
 
-#
-#  By default it is zero (don't calculate it).  Useful values
-#  are between 100, and 10,000.  The server will calculate and
-#  remember the moving average for this window, and for 10 times
-#  that window.
-#
-
-#
-#  Some of this could have been simplified.  e.g. the proxy-auth and
-#  proxy-acct bits aren't completely necessary.  But using them permits
-#  the server to be queried for ALL inbound && outbound packets at once.
-#  This gives a good snapshot of what the server is doing.
 #
 #  Due to internal limitations, the statistics might not be exactly up
 #  to date.  Do not expect all of the numbers to add up perfectly.
-#  The Status-Server packets are also counted in the total requests &&
-#  responses.  The responses are counted only AFTER the response has
-#  been sent.
 #
index d84a4cb4f8ee79284084e61dbb5cbc287645c847..822a9479215c765f40ff9f572412ea5bc2d5642c 100644 (file)
@@ -320,6 +320,10 @@ static unlang_action_t CC_HINT(nonnull) mod_stats(rlm_rcode_t *p_result, module_
                }
        }
 
+       /*
+        *      @todo - do this only for RADIUS
+        *      key off of packet ID, and Stats4-Packet-Counters TLV.
+        */
        strcpy(buffer, "FreeRADIUS-Stats4-");
 
        for (i = 0; i < FR_RADIUS_CODE_MAX; i++) {