[RADIATOR] Radiator on Cacti with multiple threads

Hugh Irvine hugh at open.com.au
Thu Oct 6 02:58:50 CDT 2011


Hello Ronald, Hello Heikki -

There is an example showing how to do this in "goodies/hooks.txt".

Here is a copy:


----------------------------------------------------------------------


When using FarmSize n to enable multiple children, clauses like Monitor and SNMPAgent incorrectly share their Port with the parent process.

This hook runs in each child and closes the Monitor and SNMPAgent ports and reopens them on a different port number.

Requires Radiator 4.4 plus patches (September 22, 2009).

Add Identifier's to both clauses together with appropriate Port's (%O is the child number)  and a FarmChildHook:


.....

FarmSize 2
FarmChildHook file:"%D/etc/scripts/child-hook.pl"

<Monitor>
       Identifier MyMonitor
       Port 907%O
</Monitor>

<SNMPAgent>
       Identifier MySNMPAgent
       Port 908%O
       ROCommunity blahblah
</SNMPAgent>

......


Here is the hook code:


# child-hook.pl
# Hugh Irvine, Open System Consultants, 20090922

sub
{
       my $monitor = Radius::Configurable::find('Monitor', 'MyMonitor');
       if (defined $monitor)
       {
               $monitor->destroy();
               $monitor->activate();
       }

       my $snmpagent = Radius::Configurable::find('SNMPAgent', 'MySNMPAgent');
       if (defined $snmpagent)
       {
               $snmpagent->reinitialize();
               $snmpagent->activate();
       }

       return;
}


Here is the result:

-bash-3.2$ netstat -na
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
.....
tcp        0      0 0.0.0.0:9070                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:9071                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:9072                0.0.0.0:*                   LISTEN
.....
udp        0      0 0.0.0.0:9080                0.0.0.0:*
udp        0      0 0.0.0.0:9081                0.0.0.0:*
udp        0      0 0.0.0.0:9082                0.0.0.0:*


----------------------------------------------------------------------

regards

Hugh


On 6 Oct 2011, at 18:28, Heikki Vatiainen wrote:

> On 10/05/2011 06:11 PM, Ronald Pérez wrote:
> 
>> So, i can't monitor by snmp the traffic on radius with "FarmSize"
>> configured, or there is a way to do it?
> 
> The SNMP socket is created before fork, so there is not an easy way to
> do this.
> 
> The possible way might be something like this:
> - use FarmChildHook to get a handle to SNMP agent
> - close the socket for the existing SNMP_Session
> - undef the existing SNMP_Session
> - create a new SNMP_Session with child specific port. See activate() for
> an example of creating SNMP_Session.
> 
> This should give you one SNMP agent port per child. You could then
> monitor each farm child individually.
> 
> Thanks,
> Heikki
> 
> 
>> This is the current config on my radius's server
>> ================================================
>> 
>> # ---------------- General parameters --------------
>> 
>>       AuthPort 1812
>>       AcctPort
>> 
>>       FarmSize 8
>> 
>>        DisableMTUDiscovery
>> 
>> ## BindAddress
>>       Include /etc/radiator/host_includes/bindaddress_test.cfg
>> 
>> 
>> <SNMPAgent>
>>        ROCommunity private
>>        Managers 192.168.10.1
>>        Port 11930
>> 
>> ## BindAddress
>>      Include /etc/radiator/host_includes/bindaddress_snmp.cfg
>> </SNMPAgent>
>> 
>> ====================================================
>> 
>> 
>> BEst,
>> Ronald
>> 
>> 2011/10/5 Heikki Vatiainen <hvn at open.com.au <mailto:hvn at open.com.au>>
>> 
>>    On 10/04/2011 02:38 PM, Ronald Pérez wrote:
>> 
>>    Hello Ronald,
>> 
>>> I'm configuring Radiator on Cacti to graph different statistics, i can
>>> graph them without problem, however, when the config has a
>>    "FarmSize x"
>>> the graphs don't look right.
>> 
>>    Your SNMP requests are likely getting "farmed" to different instances
>>    just as the RADIUS requests are. Since the instances are individual
>>    processes they all have their own SNMP counters.
>> 
>>    Heikki
>> 
>>> This is my snmp config:
>>> 
>>> <SNMPAgent>
>>>        ROCommunity private
>>>        Managers 192.168.10.2
>>>        Port 11931
>>> 
>>> ## BindAddress
>>>      Include /etc/radiator/host_includes/bindaddress_snmp.cfg
>>> </SNMPAgent>
>>> 
>>> 
>>> Am i missing something in this kind of case?
>>> 
>>> 
>>> Regards,
>>> Ronald
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> radiator mailing list
>>> radiator at open.com.au <mailto:radiator at open.com.au>
>>> http://www.open.com.au/mailman/listinfo/radiator
>> 
>> 
>>    --
>>    Heikki Vatiainen <hvn at open.com.au <mailto:hvn at open.com.au>>
>> 
>>    Radiator: the most portable, flexible and configurable RADIUS server
>>    anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
>>    Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
>>    TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
>>    DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
>>    NetWare etc.
>> 
>> 
> 
> 
> -- 
> Heikki Vatiainen <hvn at open.com.au>
> 
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
> Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
> TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
> DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
> NetWare etc.
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator


--

Hugh Irvine
hugh at open.com.au

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, 
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. 
Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.



More information about the radiator mailing list