Sunteți pe pagina 1din 20

IBM® Cloud

ITSM System Operation

Restricting IBM Control Desk


Concurrent User Counts

Field Guide

Version 1.0
© Copyright International Business Machines Corporation 2016.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule
Contract with IBM Corp.
Field Guide

CONTENTS

List of Figures ................................................................................................................... iv 

List of Tables ..................................................................................................................... v 

Revision History ............................................................................................................... vi 

1  Overview................................................................................................................ 1 

1.1  Assumption of Use Case ........................................................................... 1 

1.2  Use Case ................................................................................................... 1 

2  Configuring IBM Control Desk Users..................................................................... 3 

2.1  Configuring Regular Users ........................................................................ 3 

2.2  Configuring Restricted Users ..................................................................... 3 

3  Defining New IBM Control Desk Message ............................................................ 4 

3.1  Creating new IBM Control Desk Message ................................................. 4 

4  Defining Automation Script .................................................................................... 5 

4.1  Creating the IBM Control Desk Script ........................................................ 5 

5  Verification ........................................................................................................... 10 

References ...................................................................................................................... 12 

iii
LIST OF FIGURES

Figure 1: 3rd restricted user failed to login to ICD system................................................................. 2 


Figure 2: Defining regular users as TYPE 1 user account ................................................................ 3 
Figure 3: Defining restricted users as TYPE 2 user account ............................................................. 4 
Figure 4: Creating IBM Control Desk Message Record .................................................................... 5 
Figure 5: Creating automation script CUST_LOGIN, step 1 of 3....................................................... 7 
Figure 6: Creating automation script CUST_LOGIN, step 2 of 3....................................................... 8 
Figure 7: Creating automation script CUST_LOGIN, step 3 of 3..................................................... 10 
Figure 8: 3rd restricted user failed to login to ICD system............................................................... 11 

iv
Field Guide

LIST OF TABLES

Table 1: Creating IBM Control Desk Message Record...................................................................... 4 


Table 2: Creating automation script CUST_LOGIN, step 1 of 3 ........................................................ 6 
Table 3: Creating automation script CUST_LOGIN, step 2 of 3 ........................................................ 7 

v
REVISION HISTORY

Date Version Revised By Comments


08/31/2016 1.0 LZ Created

vi
Field Guide

1 Overview
This field guide discusses one method to restrict the IBM Control Desk (ICD) concurrent
user count. You can change the methodology to fit your requirement.

1.1 Assumption of Use Case


There are two categories of ICD users, regular users and restricted users.

 Restricted users: A maximum two concurrent restricted users is allowed in the ICD
system at any moment for discussion purpose.

 Regular users: There is no restriction to the regular user login.

1.2 Use Case


The following use case is used to demo the feature.

1. Log in as restricted user “gtsuser1” in an Internet Explorer browser.

2. Log in as restricted user “gtsuser2” in a Firefox browser (or log in from a different
machine).

3. Attempt to log in as restricted user “gtsuser3” in a Chrome browser (or log in from
a different machine). The login fails because a maximum of two concurrent
restricted users can log in at any moment into the ICD system.

See the following screen capture. The error message can’t be modified as it’s
governed by the standard ICD login process.

1
Figure 1: 3rd restricted user failed to log in to ICD system

4. Log in as regular user "bob" to show that a regular user can still log in.

5. Log out restricted user "gtsuser1" from the Internet Explorer browser.

6. Attempt to log in as restricted user "gtsuser3" in a Chrome browser (or log in from
a different machine). This time, it works because only one restricted user is logged
in to the ICD system.

2
Field Guide

2 Configuring IBM Control Desk Users


There are different ways to configure regular users and restricted users. In this section,
one method is discussed.

2.1 Configuring Regular Users


Regular users such as bob, fred and maxadmin are defined as User Type “Type 1” ICD
user account.

Figure 2: Defining regular users as TYPE 1 user account

2.2 Configuring Restricted Users


Restricted users such as gtsuser1, gtsuser2 and gtsuser3 are defined as User Type “Type
2” ICD user account.

3
Figure 3: Defining restricted users as TYPE 2 user account

3 Defining New IBM Control Desk Message


A new ICD message is required in your automation script.

3.1 Creating a new IBM Control Desk Message


To create an ICD message record, complete the following steps:

1. Log in to ICD system. http://<ICD host>/maximo, maxadmin/<password>

2. Using the GoTo menu, select System Configuration -> Platform Configuration -
> Database Configuration.

3. From the More Action menu, select Messages.

4. Click New Row.

5. Enter the values in the following table.

Table 1: Creating IBM Control Desk Message Record

Field Value
Message Group CUST_MSG
Message Key CUST_LOGIN
Display Method MSGBOX
Message ID Prefix BMXZZ
Message ID Suffix E
Message ID BMXZZ0001E
Display ID? Yes
Value Restricted user concurrent login count is exceeded

4
Field Guide

Figure 4: Creating IBM Control Desk Message Record

6. Click OK.

4 Defining an Automation Script


In this section, you define a new automation script that contains the logic to restrict the
maximum concurrent user count of the restricted users.

4.1 Creating the IBM Control Desk Automation Script


A new automation script is created to monitor and control the concurrent login count of
“Type 2” user accounts.

1. Log in to the IBM Control Desk UI.

5
2. Select Go To -> System Configuration -> Platform Configuration ->
Automation Scripts.

3. Select More Options -> Create -> Script With Object Launch Point.

4. Enter data as shown in the following table.

Table 2: Creating automation script CUST_LOGIN, step 1 of 3

Field Value
Launch Point CUST_LOGIN
Description To monitor and control the restricted user concurrent login count
Active Checked
Object LOGINTRACKING
Event Save
Save Add
New Checked

6
Field Guide

Figure 5: Creating automation script CUST_LOGIN, step 1 of 3

5. Click Next.

6. Enter data as shown in the following table.

Table 3: Creating automation script CUST_LOGIN, step 2 of 3

Field Value
Script CUST_LOGIN
Description To monitor and control the restricted user concurrent login count
Script Language Python
Log Level Error

7
Figure 6: Creating automation script CUST_LOGIN, step 2 of 3

7. Click Next.

8. Enter the following script into the Source Code field.


from psdi.common.context import UIContext
from java.lang import Exception as javaException
from java.lang import System as javaSystem
from java.lang import String
from psdi.util import MXApplicationException;
from psdi.util import MXException;
from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.app.ci import CIRemote;
from psdi.mbo import Mbo, MboRemote,MboSet, MboSetRemote, MboConstants,
SqlFormat;
from psdi.server import MXServer
from java.io import IOException as javaIOException
from com.ibm.json.java import JSONArray, JSONObject;

if UIContext.getCurrentContext() is not None:


# retrieve the current login user type
login_user_type = mbo.getString("MAXUSER.TYPE")

8
Field Guide

# Counting the current Type 2 user login count


type2 = 0
if login_user_type=='TYPE 2':
# retrieve MAXSESSION table
maxsessionSet = MXServer.getMXServer().getMboSet("MAXSESSION",
mbo.getUserInfo())
maxsessionSet.reset()
sf_maxsession = SqlFormat("exists(select userid from maxuser A
where A.userid=userid)")
maxsessionSet.setWhere(sf_maxsession.format())
maxsessionSet.reset()

count = maxsessionSet.count()
index = 0

# retrieve MAXUSER.TYPE for each user in MAXSESSION table


while (index < count):
maxsessionMbo = maxsessionSet.getMbo(index)
if not (maxsessionMbo is None):
if maxsessionMbo.getString("MAXUSER.TYPE") == "TYPE 2":
type2 = type2 + 1
# end of if - if not (maxsessionMbo is None)
index = index + 1
# end of while - while (index < count)
# end of If - if login_user_type=='TYPE 2'

# Raise error condition when TYPE 2 user count is over the limit. For
POC purpose, two concurrent login of “Type 2” user accounts is allowed
if login_user_type=='TYPE 2' and type2 > 0:
print "Failed to login. errorkey=" + errorkey + ", errorgroup=" +
errorgroup
errorkey='CUST_LOGIN'
errorgroup='CUST_MSG'
# end of If - if login_user_type=='TYPE 2' and type2 > 1

# end of If - if UIContext.getCurrentContext() is not None

9
Figure 7: Creating automation script CUST_LOGIN, step 3 of 3

9. Click Create.

10. Close the message window.

11. Open the CUST_LOGIN automation script.

12. From the Common Actions menu, select Change Status.

13. Enter “Active” in the New Status field.

14. Click OK.

5 Verification
Execute the use case to complete the verification.

1. Log in as restricted user “gtsuser1” in an Internet Explorer browser.

2. Log in as restricted user “gtsuser2” in a Firefox browser (or log in from a different
machine).

3. Attempt to log in as restricted user “gtsuser3” in a Chrome browser (or log in from a
different machine). The login fails because maximum two concurrent restricted users
can log in at any moment into the ICD system.

10
Field Guide

See the following screen. The error message can’t be modified as it’s governed by the
standard ICD login process.

Figure 8: 3rd restricted user failed to login to ICD system

4. Log in as regular user “bob” to show that a regular user can still log in.

5. Log out restricted user “gtsuser1” from the IE browser.

6. Attempt to log in as restricted user “gtsuser3” in a Chrome browser (or log in from a
different machine). This time, it works because only one restricted user is logged in to
the ICD system.

11
REFERENCES

IBM Control Desk documentation in IBM Knowledge Center

12
Field Guide

®
© Copyright IBM Corporation 2016
IBM United States of America
Produced in the United States of America
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM
representative for information on the products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used.
Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be
used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program,
or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of
this document does not grant you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of Licensing


IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.

The following paragraph does not apply to the United Kingdom or any other country where such provisions are
inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PAPER “AS IS” WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow
disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes may be made periodically to the
information herein; these changes may be incorporated in subsequent versions of the paper. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this paper at any time without notice.

Any references in this document to non-IBM Web sites are provided for convenience only and do not in any manner serve
as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product
and use of those Web sites is at your own risk.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of
this document does not give you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of Licensing


IBM Corporation
4205 South Miami Boulevard
Research Triangle Park, NC 27709 U.S.A.

All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent
goals and objectives only.

This information is for planning purposes only. The information herein is subject to change before the products described
become available.

If you are viewing this information softcopy, the photographs and color illustrations may not appear.

13
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corporation in
the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in
this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks
owned by IBM at the time this information was published. Such trademarks may also be registered or common law
trademarks in other countries. A current list of IBM trademarks is available on the web at "Copyright and trademark
information" at http://www.ibm.com/legal/copytrade.shtml.
Other company, product, or service names may be trademarks or service marks of others.

14

S-ar putea să vă placă și