Dear Alan,<br><br>I have gone through different statistics provided by radius server.<br><br>But as we discussed, the server does NOT keep track of statistics for each module return codes.<br><br>My aim is to achieve this. I want the statistics of each module return code. That is for e.g., Module X how many times returned OK or fail or reject etc. Now with this aim in mind I thought to modify the freeradius code:<br><br>The very first thing that I did was finding out the basic module structure in freeradius, if I am not wrong this is the basic module structure used:<br><br>typedef struct module_t {<br> uint64_t magic; //!< Used to validate module struct.<br> char const *name; //!< The name of the module (without rlm_ prefix).<br> int type; //!< One or more of the RLM_TYPE_* constants.<br> size_t inst_size; //!< Size of the instance data<br> CONF_PARSER const *config; //!< Configuration information<br> instantiate_t instantiate; //!< Function to use for instantiation.<br> detach_t detach; //!< Function to use to free module instance.<br> packetmethod methods[RLM_COMPONENT_COUNT]; //!< Pointers to the various section functions, <span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> // </span>ordering !< determines which function is mapped <span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span></span>//to!< which section. <br>} module_t;<br><br>Now I added an unsigned long array in this structure in which module return code act as an index. Please see the snippet below:<br><br>typedef enum module_statistics {<br> RLM_MODULE_REJECT = 0, //!< 0 methods index for reject return code.<br> RLM_MODULE_FAIL, //!< 1 methods index for fail return code.<br> RLM_MODULE_OK, //!< 2 methods index for OK return code.<br> RLM_MODULE_HANDLED, //!< 3 methods index for handled return code.<br> RLM_MODULE_INVALID, //!< 4 methods index for invalid return code.<br> RLM_MODULE_USERLOCK,//!< 5 methods index for userlock return code.<br> RLM_MODULE_NOTFOUND, //!< 6 methods index for notfound return code.<br> RLM_MODULE_NOOP,//!< 7 methods index for noop return code.<br><br> RLM_MODULE_UPDATED, //!< 8 methods index for updated return code.<br> <br><br> RLM_RETCODE_COUNT //!< 9 how many module return codes there are.<br>} module_statistics;<br><br>typedef struct module_t {<br> uint64_t magic; //!< Used to validate module struct.<br> char const *name; //!< The name of the module (without rlm_ prefix).<br> int type; //!< One or more of the RLM_TYPE_* constants.<br> size_t inst_size; //!< Size of the instance data<br> CONF_PARSER const *config; //!< Configuration information<br> instantiate_t instantiate; //!< Function to use for instantiation.<br> detach_t detach; //!< Function to use to free module instance.<br> packetmethod methods[RLM_COMPONENT_COUNT]; //!< Pointers to the various section functions, <span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span>//ordering<br> //!< determines which function is mapped to<br> //!< which section. <br> unsigned long rtcode[RLM_RETCODE_COUNT]; //Used for module return codes <br><br>} module_t;<br> <br>Is this approach OK?<br>Please suggest me. <br><br>Please advice me that how should I update this my unsigned long rtcode[RLM_RETCODE_COUNT] array with each module return code. <br><br>Regards,<br>Sonu <br><br><br>From: Alan DeKok <aland@deployingradius.com><br>Sent: Thu, 25 Sep 2014 21:47:49 <br>To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org><br>Subject: Re: Module Statistics in freeradius<br>Himanshu Pandey wrote:<br>
> I am a bit confused right now.<br>
<br>
You keep changing what you're asking for.<br>
<br>
The server already keeps track of total packet counts for<br>
Access-Request, Access-Accept, etc.<br>
<br>
The server does NOT keep track of statistics for module return codes.<br>
<br>
The server already keeps track of total packet counts for clients,<br>
listeners, and home servers.<br>
<br>
The server does NOT keep track of statistics (anything) per module.<br>
<br>
<br>
> You mean to say that if suppose I want<br>
> the number of authorize request that were OK,UPDATED,FAILED,HANDLED or<br>
> REJECTED to be printed then I can use the radmin. Since the server DOES<br>
> keep track of statistics per listener. And prints them out.<br>
> <br>
> Is it correct?<br>
<br>
No. If you run the "help" command from radmin, you will see what it's<br>
keepings statistics for. If you run the appropriate statistics command,<br>
you will see which statistics it keeps.<br>
<br>
It's that easy. You should try it, rather than asking confusion<br>
questions on the list. All of the answers are ALREADY in front of you.<br>
<br>
Alan DeKok.<br>
-<br>
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html<br>
<br><A HREF="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><IMG SRC="http://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/signatureline.htm@Middle"></A><table cellpadding="0" cellspacing="0"><tbody><tr><td><div style="font-family: Arial, Helvetica, sans-serif; font-size:14px">Get your own <span style="padding-bottom: 0px; background-color: #cc0000; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> website, <span style="padding-bottom: 0px; background-color: #c00; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> domain & <span style="padding-bottom: 0px; background-color: #c00; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> mobile app with Company email. </div></td><td><a href="http://track.rediff.com/click?url=___http://businessemail.rediff.com/email-ids-for-companies-with-less-than-50-employees?sc_cid=sign-1-10-13___&cmp=host&lnk=sign-1-10-13&nsrv1=host" style="font-family: Arial, Helvetica, sans-serif; color: #fff; font-size: 14px; color:#0000cc" target="_blank"><b>Know More ></b></a><!-- <in-put type="button" cl-ass="button" on-click="parent.location='http://track.rediff.com/click?url=___http://businessemail.rediff.com/company-email-hosting-services?sc_cid=signature-23-9-13___&cmp=signature-23-9-13&lnk=mypagelogout&nsrv1=host'" value="Know more >"> </input> --></td></tr></tbody></table>