Sample Header Ad - 728x90

FreeRADIUS 3 - discard certain accounting types

1 vote
1 answer
1169 views
I am using FreeRADIUS 3.0.13 on a CentOS 7 server for accounting data from a telephony device, and we want to simply drop certain record types - specifically, for this application, I want to only record Stop messages. We're specifically writing to a detail log, and then using the bufferedsql module to read from that log, and write to the database server. Everything is working normally, until I get a record such as an Accounting-On, or Start. I've worked around some of this by writing the unwanted records to a database that simply gets purged, but I'd prefer a more elegant solution. One of the things I saw in the documentation was to replace the query with a SELECT TRUE;, but since this doesn't update records, FreeRADIUS seems to choke on it. It reports "No response to request" and keeps the record in the detail file, attempting to re-process it every 30 seconds. When I run radiusd -X, I see output similar the following. This output is from a received Accounting-On packet, and I just want to discard the message: (22) accounting { (22) sql: EXPAND %{tolower:type.%{Acct-Status-Type}.query} (22) sql: --> type.accounting-on.query (22) sql: Using query template 'query' rlm_sql (sql): Reserved connection (0) (22) sql: EXPAND %{User-Name} (22) sql: --> (22) sql: SQL-User-Name set to '' (22) sql: EXPAND SELECT TRUE; (22) sql: --> SELECT TRUE; (22) sql: Executing query: SELECT TRUE; (22) sql: SQL query returned: success (22) sql: -1 record(s) updated (22) sql: No additional queries configured rlm_sql (sql): Released connection (0) (22) [sql] = noop (22) } # accounting = noop (22) detail (/var/log/radius/radacct/detail-ca-fallback/detail-ca-fallback-log): No response to request. Will retry in 30 seconds (22) Finished request (22) Cleaning up request packet ID 0 with timestamp +660 Ready to process requests How can I configure my dialup.conf to simply drop these types of accounting records? The device generating the accounting data does not support any kind of configuration to only send specific accounting messages. This is the relevant section of my custom dialup.conf file: accounting { reference = "%{tolower:type.%{Acct-Status-Type}.query}" type { accounting-on { # This is a no-op. We don't log this anywhere. query = "SELECT TRUE;" } accounting-off { # This is a no-op. We don't log this anywhere. query = "SELECT TRUE;" } start { # This is a no-op. We don't log this anywhere. query = "INSERT INTO blackhole \ () \ VALUES ()" } interim-update { # This is a no-op. We don't log this anywhere. uery = "INSERT INTO blackhole \ () \ VALUES ()" } stop { query = "INSERT INTO ${....acct_table1} \ () \ VALUES ()" } # # No Acct-Status-Type == ignore the packet # none { query = "SELECT true" } } }
Asked by csyria (265 rep)
May 7, 2018, 08:30 PM
Last activity: May 10, 2018, 07:35 AM