fix(athonet/epc): revert license active calculation method (#2941)

This commit is contained in:
qgarnier 2021-07-06 08:30:50 +02:00 committed by GitHub
parent c3ee8c4f4f
commit dbce757df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -259,6 +259,7 @@ my $map_status = { 0 => 'ok', 1 => 'expired', 2 => 'invalid' };
my $mapping = {
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
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
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
@ -266,7 +267,6 @@ my $mapping = {
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
};
my $oid_session_alloc = '.1.3.6.1.4.1.35805.10.2.12.9.1.7'; # gTPcSessionAllocated
sub manage_selection {
my ($self, %options) = @_;
@ -318,10 +318,7 @@ sub manage_selection {
}
if ($result->{max_active_sessions} > 0) {
$self->{license}->{global}->{sessions}->{used} = 0;
$snmp_result = $options{snmp}->get_table(oid => $oid_session_alloc);
$self->{license}->{global}->{sessions}->{used} += $_ foreach (values %$snmp_result);
$self->{license}->{global}->{sessions}->{used} = $result->{active_connections};
$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}->{prct_used} = $self->{license}->{global}->{sessions}->{used} * 100 / $result->{max_active_sessions};