Custom counter aggregating data from two sources - freeradius 3.0.x
Hello, Can you suggest how can I make a custom counter that uses e.g. sql query and redis query in single counter? Is there any possibility to include ulang logic into sqlcounter conf, make a redis query and/or combine data? Or should I use some other module? Is there a possibility to make queries using different sql pools inside one counter? I would like to cache some data in redis and reuse it if available. If it is not available - then make a full sql query (long lasting…). The same logic I would like to implement in several different counters. I would be grateful for any advice. Regards, Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Sep 24, 2015, at 10:37 AM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
Can you suggest how can I make a custom counter that uses e.g. sql query and redis query in single counter?
You can't do it in a module. The counter module does one thing, and one thing only.
Is there any possibility to include ulang logic into sqlcounter conf, make a redis query and/or combine data?
You need to write the logic yourself, and then combine the counters manually.
Is there a possibility to make queries using different sql pools inside one counter?
No.
I would like to cache some data in redis and reuse it if available. If it is not available - then make a full sql query (long lasting…).
You can cache data in redis, but you need to write the redis queries yourself. Alan DeKok.
You can't do it in a module. The counter module does one thing, and one thing only.
You need to write the logic yourself, and then combine the counters manually.
So all logic shall be placed in authorize section and check if certain radcheck parameter exists - if so - provide all logic, compare values, explicitly set accept/reject and set proper radreply messages? ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Sep 24, 2015, at 11:26 AM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
So all logic shall be placed in authorize section and check if certain radcheck parameter exists - if so - provide all logic, compare values, explicitly set accept/reject and set proper radreply messages?
Yes. Alan DeKok.
So all logic shall be placed in authorize section and check if certain radcheck parameter exists - if so - provide all logic, >>compare values, explicitly set accept/reject and set proper radreply messages?
Yes.
Thank you for clarification. Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
participants (2)
-
Alan DeKok -
Michal Tomaszewski