Top Banner
Monitoring Identity Manager by JMX Takayuki Okazaki Solutions Architect, Software Practice http://blogs.sun.com/okazaki
40
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Monitoring Identity Manager by JMX

MonitoringIdentity Manager by JMXTakayuki OkazakiSolutions Architect, Software Practicehttp://blogs.sun.com/okazaki

Page 2: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 2

GOAL

Understanding JMX monitoring featurewhich introduced from Identity Manager7.0

Page 3: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 3

NOTICE

• This is NOT officially verified documentof Identity Manager. All information in thisdocument are based upon personalresearch.

Page 4: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 4

Agenda• About JMX• Identity Manager and JMX• Configuration instruction• Demo• TIPS

Page 5: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 5

About JMX• Standard API for monitoring and managing JVM,

services, and applications.> JSR 3: Java Management Extensions (JMX)

• Monitoring and Managing from remote client> JSR 160: JMX Remote API

• Target use case of JMX> Referring and modifying application configuration> Gathering statistics about the application> Notify error or status change

Page 6: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 6

Benefit of JMX• Lightweight• Secure• Scalable monitoring & management architecture• Easy to engage existing management solutions (like

SNMP, WBEM)

Page 7: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 7

Scopeof JMX Specifications

Page 8: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 8

What canmonitor by JMX?• Java VM> OS and environment, JVM options, Memory and

Garbage collection, Threads

• Web Container> Performance statistics, Cache, status of a connections,

Connection pool, Thread pool

• Application> All exposed MBeans(Managed bean)

Page 9: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 9

Example

Memory

Class

Thread

CPU

Page 10: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 10

More use case• Notify events to JMX clients> Errors and warnings> Status change

• Invoking operations> Garbage collection> Test connection> State change

• Advanced use case> Self tuning and self management (like GlassFish v2)

Page 11: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 11

JMXRemote and Security• Authentication> UserId/Password authentication by MBean server

• Protecting connection> TLS and SSL

Authentication through userid/pwd

Page 12: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 12

SNMPand JMX• Several MBeans are monitored through SNMP> http://java.sun.com/javase/6/docs/technotes/guides/man

agement/snmp.html

• JVM related info can be monitored by SNMP> OS and environment, classpath and JMV options, JIT,

classloader, threads, GC, memory, memory pool andlogging

Page 13: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 13

JMX tools• JConsole> Bundled with JDK 5 or later

• MC4J (http://mc4j.org)> Open source monitoring tool

• Sun Java System Management Framework> Bundled with Java ES 5> Opensourced: http://proctor.dev.java.net

• More..> HP Openview, AdventNet ManagemeEngine Applications

Manager, ...

Page 14: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 14

JConsole• Graphical management tool• You can develop additional plugin for JConsole

Page 15: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 15

Identity Manager and JMX• Support starts from Identity Manager 7.0• Status of cluster/server, Scheduler, information

about Resources, status of ActiveSync

Page 16: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 16

Cluster

Attribute name Description

List of active IDM servers

List of known IDM servers

Most recent list of failed IDM servers

Alive Is polling thread alive?

ActiveServers

KnownServers

NewlyFailedServers

PollingInterval Polling interval (in milli-seconds)

ObjectName=IDM:type=Cluster

Page 17: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 17

Example: ClusterObjectName=IDM:type=Cluster

Page 18: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 18

Servers

Attribute name Description

Date of server created

Creator Name of user who create this server

Deleted Is this object deleted?

Most recent heart beat time

Status of this server

CreateDate

Heartbeat・HeartbeatDate

State・StateString

ObjectName=IDM:type=Cluster,service=Server,name=”<Server name>”

ObjectName=IDM:type=Server

Attribute name Description

Name Name of the server

Status of this serverStatus・StatusDisplay

Page 19: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 19

Example: Servers

All servers arelisted

Same server to JMXserver

ObjectName=IDM:type=Cluster,service=Server,name=”<Server name>”

ObjectName=IDM:type=Server

Page 20: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 20

Resources

Attribute name Description

Date of resource creation

Creator Creator user name

Deleted Is this object deleted?

Last modified date

Most recent activity

Most recent activity date

CreateDate

LastModificationDate

MostRecentActivity

MostRecentActivityDateMostRecentActivityDateMS

ObjectName=IDM:type=Cluster,service=Resource,resType=”<Resource type>”,name=”<Resource name>”

Test connection to each resource feature availble.

Page 21: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 21

Example: ResourcesObjectName=IDM:type=Cluster,service=Resource,resType=”<Resource type>”,name=”<Resource name>”

All resource type/resources are listed

Page 22: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 22

Connection test (IDM->Resource)Success case Invoke test connection

Failure case

Page 23: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 23

ActiveSync

Attribute name Description

Progress string

Error string

Last modification number

Last modification date

Last start time

Status of this active sync

ProgressString

ErrorStatusString

LastPollAttempt Last ActiveSync date

NextPollAttempt Next ActiveSync date

LastModNum

LastModDate

LastKnownServer Last server name which starts this ActiveSync

LastStartTime

State, StateString

ObjectName=IDM:type=Cluster,service=Synchronization,component=ActiveSyncresType=”<Resource type>”,name=”<resource name>”

Page 24: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 24

Example: ActiveSyncObjectName=IDM:type=Cluster,service=Synchronization,component=ActiveSyncresType=”<Resource type>”,name=”<Resource name>”

All ActiveSyncs which is:- currently running- failure or scheduled

Page 25: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 25

SPE SyncObjectName=IDM:type=Cluster,service=Synchronization,component=SPE SyncresType=”<Resource type>”,name=”<Resource Name>”

Attribute name Description

Progress string

Error string

Last SPE Sync date

Next SPE Sync date

Last modification number

Last modification date

Last server name which starts this SPE Sync

Last start time

Status of this SPE sync

ProgressString

ErrorStatusString

LastPollAttempt

NextPollAttempt

LastModNum

LastModDate

LastKnownServer

LastStartTime

State, StateString

Page 26: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 26

Scheduler 1 of 2

Attributes Description

Cycles ?

?

?

?

?

?

?

?

?

ErrorCount

ExpiredCount

FinishedCycleCounter

FinishedCycleTIme

LaunchedCount

ReadyCount

ReadyCycleCounter

ReadyCycleTime

ObjectName=IDM:type=Scheduler

Page 27: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 27

Scheduler 2 of 2

Attribute name Description

Most recent heart beat time

?

?

Status of scheduler

MostRecentHeartbeat

ScheduledCycleCounter

ScheduledCycleTime

Status・StatusDisplay

ObjectName=IDM:type=Scheduler

Page 28: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 28

Example: SchedulerObjectName=IDM:type=Scheduler

Page 29: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 29

Event notification

Heart beat events are notified ifyou subscribe to Scheduler event

Page 30: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 30

Configuration• Identity Manager• Application Server• JConsole

Page 31: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 31

Identity Manager 1 of 2(1) Settings

(2) Servers

(3) Click your server

Page 32: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 32

Identity Manager 2 of 2

(1) JMX

(2) Turn off default setting

(3)Turn on JMX

Page 33: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 33

Application Server

Turn off if you want touse JConsole

Admin Service

Authentication realm

Memorize Port number

Page 34: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 34

JConsole 1 of 2

JConsole bundled with JDK 5

JConsole bundled with JDK 6

Remote process

Page 35: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 35

JConsole 2 of 2

JMX URLservice:jmx:rmi:///jndi/rmi://<hostname>:<port>/management/rmi-jmx-connector

User name and password

Default setting of Sun Java System App Serveris “admin-realm”, which is same user of appserver administrator (default user name:“admin”)

Page 36: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 36

Demo environment

idm1

idmdb

idm2resource1

resource2

Solaris Container

JConsole

Page 37: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 37

Monitoring fromcommand line• Most customers already have corporate standard

monitoring tool, but it may not supports JMX• Most monitoring tools have a capability to invoking

monitoring command• Using scripting languages which running on Java> JRuby, JavaScript, Groovy, Pnuts, (JavaFX!)... etc> Easy to customize

Page 38: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 38

Example: JRuby#!/usr/bin/env jruby

include Javainclude_class 'javax.management.ObjectName'include_class 'javax.management.remote.JMXConnectorFactory'include_class 'javax.management.remote.JMXServiceURL'

jmxurl = 'service:jmx:rmi:///jndi/rmi://idm1:8686/jmxrmi'username, password = 'admin', 'adminadmin'

svcurl = JMXServiceURL.new(jmxurl)cred = java.lang.String[2].newcred[0], cred[1] = username, passwordenv = {'jmx.remote.credentials' => cred}conn = JMXConnectorFactory.connect(svcurl, env).getMBeanServerConnectionnames = conn.query_names(ObjectName.new('IDM:type=Cluster,service=Synchronization,component=ActiveSync,*'), nil)

names.each do |name|cname = name.get_canonical_nameif /name="(.+?)",resType="(.+?)"/ =~ cnameputs "Resource Type: #{$2}, Name: #{$1}, ”+ “Status: #{conn.get_attribute(name, 'StateString')}"

endend

Resource Type: FlatFileActiveSync, Name: My FlatFile, Status: downResource Type: LDAP, Name: SPE End-User Directory, Status: down

Gathering ActiveSync Status

Page 39: Monitoring Identity Manager by JMX

Copyright © 2007 Sun Microsystems K.K. 39

Information• Custom JMX clinet using JRuby (Japanese)> http://blogs.sun.com/nishigaya/entry/custom_jmx_client_

using_jruby> http://blogs.sun.com/nishigaya/entry/custom_jmx_client_

using_jruby1

Page 40: Monitoring Identity Manager by JMX

Takayuki [email protected]://blogs.sun.com/okazaki

JMXによるIdentity Managerシステムの監視