Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1258202

Summary: How to remove "Monitoring add-on"?
Product: Red Hat Satellite 5 Reporter: Mishal A.S <mishal.alsaqr>
Component: WebUIAssignee: Grant Gainey <ggainey>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 570CC: cjenkins, dyordano, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-19 09:04:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
file1 none

Description Mishal A.S 2015-08-30 09:19:47 UTC
Created attachment 1068385 [details]
file1

Description of problem:
When we tried to import new certificate, error massage shows like below: 
we want to free XX Monitoring entitlements by following: 
Overview -> Subscription Management -> System Entitlements
But we are not unable to add or remove Monitoring add-on entitlement because there is no "Monitoring" in the drop-sown list (see the attached file1).

How reproducible:
always 

Steps to Reproduce:
1. Overview -> Subscription Management -> System Entitlements
2. Try to select one or more systems.
3. Then, try to add or remove (Monitoring Add-on) 
4. OR check the attached picture. 

Actual results:
There is no "Monitoring" in the drop-sown list.

Expected results:
It should be there, because in my case I wanted to free some monitoring entitlements in order to activate our new certificate without the following error: 

# rhn-satellite-activate --rhn-cert=/root/XXXX.xml -vvv
Certificate specifies 0 of monitoring entitled entitlements.
    There are 86 entitlements used by systems in the base (id 1) organization.
    You might need to unentitle some systems in the base organization.
    You need to free 86 entitlements to match the new certificate.
    In the WebUI, the entitlement is named Monitoring.
Activation failed, will now exit with no changes.


Additional info:
Workaround: 
We have edited the form "Add-On Entitlement" and change the value from "provisioning_entitled"  to "monitoring_entitled", and then the Monitoring entitlement was nicely removed.

Comment 1 Tomas Lestach 2015-08-31 09:57:36 UTC
Hello Mishal,
please, open a ticket with Red Hat Support https://access.redhat.com/support to help you with your issue. Thank you.

Comment 2 Chris Jenkins 2015-11-17 12:48:45 UTC
As a work around, you can use an API script to remove the Monitoring Add On entitlements for each system:

#!/usr/bin/perl
use Frontier::Client;
use Data::Dumper;

my $HOST = 'sat.example.com';
my $user = 'rhn-admin';
my $pass = 'password';

my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);
@e = 'monitoring_entitled';

my $systems = $client->call('system.listUserSystems', $session);
foreach my $system (@$systems) {
	$system_id = $system->{'id'};
	$results = $client->call('system.removeEntitlements',$session,$system_id,\@e);
	print " - Removing monitoring Add On for " . $system->{'name'}."\n";
}
$client->call('auth.logout', $session);

Comment 3 Tomas Lestach 2016-02-19 09:04:20 UTC
The correct procedure should be to re-activate satellite with the previous entitlement certificate, remove the monitoring add-on entitlements and activate satellite with the new certificate.

Chris, thank you for providing the API script. It looks good, however you need to run it for every organization.

I'm closing this BZ as NOTABUG.