fix(athonet/epc): revert license active calculation method (#2941)
This commit is contained in:
parent
c3ee8c4f4f
commit
dbce757df2
|
@ -259,6 +259,7 @@ my $map_status = { 0 => 'ok', 1 => 'expired', 2 => 'invalid' };
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
users_connected => { oid => '.1.3.6.1.4.1.35805.10.2.99.1' }, # usersConnected
|
users_connected => { oid => '.1.3.6.1.4.1.35805.10.2.99.1' }, # usersConnected
|
||||||
users_idle => { oid => '.1.3.6.1.4.1.35805.10.2.99.2' }, # usersIdle
|
users_idle => { oid => '.1.3.6.1.4.1.35805.10.2.99.2' }, # usersIdle
|
||||||
|
active_connections => { oid => '.1.3.6.1.4.1.35805.10.2.99.4' }, # activeConnections
|
||||||
hss_provisioned_users => { oid => '.1.3.6.1.4.1.35805.10.2.99.7' }, # hssProvisionedUsers
|
hss_provisioned_users => { oid => '.1.3.6.1.4.1.35805.10.2.99.7' }, # hssProvisionedUsers
|
||||||
max_active_users => { oid => '.1.3.6.1.4.1.35805.10.4.1' }, # maxActiveUsers
|
max_active_users => { oid => '.1.3.6.1.4.1.35805.10.4.1' }, # maxActiveUsers
|
||||||
max_active_sessions => { oid => '.1.3.6.1.4.1.35805.10.4.2' }, # maxActiveSessions
|
max_active_sessions => { oid => '.1.3.6.1.4.1.35805.10.4.2' }, # maxActiveSessions
|
||||||
|
@ -266,7 +267,6 @@ my $mapping = {
|
||||||
max_provisioned_usim => { oid => '.1.3.6.1.4.1.35805.10.4.6' }, # maxProvisionedUSIM
|
max_provisioned_usim => { oid => '.1.3.6.1.4.1.35805.10.4.6' }, # maxProvisionedUSIM
|
||||||
status => { oid => '.1.3.6.1.4.1.35805.10.4.5', map => $map_status } # licenseStatus
|
status => { oid => '.1.3.6.1.4.1.35805.10.4.5', map => $map_status } # licenseStatus
|
||||||
};
|
};
|
||||||
my $oid_session_alloc = '.1.3.6.1.4.1.35805.10.2.12.9.1.7'; # gTPcSessionAllocated
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
@ -318,10 +318,7 @@ sub manage_selection {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result->{max_active_sessions} > 0) {
|
if ($result->{max_active_sessions} > 0) {
|
||||||
$self->{license}->{global}->{sessions}->{used} = 0;
|
$self->{license}->{global}->{sessions}->{used} = $result->{active_connections};
|
||||||
$snmp_result = $options{snmp}->get_table(oid => $oid_session_alloc);
|
|
||||||
$self->{license}->{global}->{sessions}->{used} += $_ foreach (values %$snmp_result);
|
|
||||||
|
|
||||||
$self->{license}->{global}->{sessions}->{total} = $result->{max_active_sessions};
|
$self->{license}->{global}->{sessions}->{total} = $result->{max_active_sessions};
|
||||||
$self->{license}->{global}->{sessions}->{free} = $result->{max_active_sessions} - $self->{license}->{global}->{sessions}->{used};
|
$self->{license}->{global}->{sessions}->{free} = $result->{max_active_sessions} - $self->{license}->{global}->{sessions}->{used};
|
||||||
$self->{license}->{global}->{sessions}->{prct_used} = $self->{license}->{global}->{sessions}->{used} * 100 / $result->{max_active_sessions};
|
$self->{license}->{global}->{sessions}->{prct_used} = $self->{license}->{global}->{sessions}->{used} * 100 / $result->{max_active_sessions};
|
||||||
|
|
Loading…
Reference in New Issue