Open Windows Explorer, Tools, Map Netword Drives,
enter FOLDER (eg \\acme1999\PIPPOPPRD) and click on "Connect Using a different user name", enter username and pw
If you get this message:
"the network folder specified is currently mapped using a different name and pw"
then open a command prompt, enter
net use
if you see \\acme1999\PIPPOPPRD in the list, issue a
net use \\acme1999\PIPPOPPRD /delete
and try again
Welcome to the wonderful world of Widows (TM).
Wednesday, May 30, 2012
Tuesday, May 29, 2012
Hyperic, my first WEBLOGIC working plugin (Still not working...)
java -Dplugins.include=mysecondplugin -Djmx.url=service:jmx:iiop://localhost:8001/jndi/weblogic.management.mbeanservers.runtime -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar -m discover -a metric -Dlog=debug
WebLogic Cluster Availability:
com.bea:type=ClusterRuntime,name=%name%:AliveServerCount:jmx.url=service%3Ajmx%3Aiiop%3A//localhost%3A8001/jndi/weblogic.management.mbeanservers.runtime,jmx.username=weblogic,jmx.password=
getValue failed for metric: WebLogic Cluster:com.bea:type=ClusterRuntime,name=%name%:AliveServerCount:jmx.url=service%3Ajmx%3Aiiop%3A//localhost%3A8001/jndi/weblogic.management.mbeanservers.runtime,jmx.username=weblogic,jmx.password=%jmx.password%
MetricUnreachableException: Can't connect to MBeanServer [{jmx.username=weblogic, jmx.url=service:jmx:iiop://localhost:8001/jndi/weblogic.management.mbeanservers.runtime}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
org.hyperic.hq.product.MetricUnreachableException: Can't connect to MBeanServer [{jmx.username=weblogic, jmx.url=service:jmx:iiop://localhost:8001/jndi/weblogic.management.mbeanservers.runtime}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
at org.hyperic.hq.product.jmx.MxUtil.unreachable(MxUtil.java:156)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:320)
at org.hyperic.hq.product.jmx.MxMeasurementPlugin.getValue(MxMeasurementPlugin.java:58)
at org.hyperic.hq.product.MeasurementPluginManager.getPluginValue(MeasurementPluginManager.java:171)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:269)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:130)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:122)
at org.hyperic.hq.product.util.PluginDumper.getValue(PluginDumper.java:644)
at org.hyperic.hq.product.util.PluginDumper.fetchMetrics(PluginDumper.java:790)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpProperties(PluginDiscoverer.java:375)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpProperties(PluginDiscoverer.java:424)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpServer(PluginDiscoverer.java:488)
at org.hyperic.hq.product.util.PluginDiscoverer.runtimeScan(PluginDiscoverer.java:563)
at org.hyperic.hq.product.util.PluginDiscoverer.start(PluginDiscoverer.java:321)
at org.hyperic.hq.product.util.PluginDumper.testDiscovery(PluginDumper.java:1148)
at org.hyperic.hq.product.util.PluginDumper.invoke(PluginDumper.java:456)
at org.hyperic.hq.product.util.PluginMain.main(PluginMain.java:321)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
at javax.management.remote.rmi.RMIConnector.connect(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
at org.hyperic.hq.product.jmx.MxUtil.getMBeanConnector(MxUtil.java:538)
at org.hyperic.hq.product.jmx.MxUtil.getCachedMBeanConnector(MxUtil.java:434)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:651)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:310)
... 15 more
class is org.hyperic.hq.product.servlet.client.JMXRemote
C:\Oracle\Middleware\user_projects\domains\prod_domain>java weblogic.Admin -url t3://localhost:8001 -username weblogic -password weblogic1 -pretty GET -type ClusterRuntime
---------------------------
MBeanName: "prod_domain:ServerRuntime=ms1,Name=mycluster,Type=ClusterRuntime,Location=ms1"
ActiveSingletonServices:
AliveServerCount: 1
CachingDisabled: true
CurrentMachine: mymachine
CurrentSecondaryServer:
DetailedSecondariesDistribution:
ForeignFragmentsDroppedCount: 0
FragmentsReceivedCount: 0
FragmentsSentCount: 109
HealthState: Component:null,State:HEALTH_OK,MBean:null,ReasonCode:[]
JobSchedulerRuntime:
MulticastMessagesLostCount: 0
Name: mycluster
Parent: ms1
PrimaryCount: 0
Registered: true
ResendRequestsCount: 0
SecondaryCount: 0
SecondaryDistributionNames:
SecondaryServerDetails:
ServerMigrationRuntime: ServerMigrationRuntime
ServerNames: ms1
Type: ClusterRuntime
UnicastMessaging: UnicastMessagingRuntime
WebLogic Cluster Availability:
com.bea:type=ClusterRuntime,name=%name%:AliveServerCount:jmx.url=service%3Ajmx%3Aiiop%3A//localhost%3A8001/jndi/weblogic.management.mbeanservers.runtime,jmx.username=weblogic,jmx.password=
getValue failed for metric: WebLogic Cluster:com.bea:type=ClusterRuntime,name=%name%:AliveServerCount:jmx.url=service%3Ajmx%3Aiiop%3A//localhost%3A8001/jndi/weblogic.management.mbeanservers.runtime,jmx.username=weblogic,jmx.password=%jmx.password%
MetricUnreachableException: Can't connect to MBeanServer [{jmx.username=weblogic, jmx.url=service:jmx:iiop://localhost:8001/jndi/weblogic.management.mbeanservers.runtime}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
org.hyperic.hq.product.MetricUnreachableException: Can't connect to MBeanServer [{jmx.username=weblogic, jmx.url=service:jmx:iiop://localhost:8001/jndi/weblogic.management.mbeanservers.runtime}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
at org.hyperic.hq.product.jmx.MxUtil.unreachable(MxUtil.java:156)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:320)
at org.hyperic.hq.product.jmx.MxMeasurementPlugin.getValue(MxMeasurementPlugin.java:58)
at org.hyperic.hq.product.MeasurementPluginManager.getPluginValue(MeasurementPluginManager.java:171)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:269)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:130)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:122)
at org.hyperic.hq.product.util.PluginDumper.getValue(PluginDumper.java:644)
at org.hyperic.hq.product.util.PluginDumper.fetchMetrics(PluginDumper.java:790)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpProperties(PluginDiscoverer.java:375)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpProperties(PluginDiscoverer.java:424)
at org.hyperic.hq.product.util.PluginDiscoverer.dumpServer(PluginDiscoverer.java:488)
at org.hyperic.hq.product.util.PluginDiscoverer.runtimeScan(PluginDiscoverer.java:563)
at org.hyperic.hq.product.util.PluginDiscoverer.start(PluginDiscoverer.java:321)
at org.hyperic.hq.product.util.PluginDumper.testDiscovery(PluginDumper.java:1148)
at org.hyperic.hq.product.util.PluginDumper.invoke(PluginDumper.java:456)
at org.hyperic.hq.product.util.PluginMain.main(PluginMain.java:321)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
at javax.management.remote.rmi.RMIConnector.connect(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
at org.hyperic.hq.product.jmx.MxUtil.getMBeanConnector(MxUtil.java:538)
at org.hyperic.hq.product.jmx.MxUtil.getCachedMBeanConnector(MxUtil.java:434)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:651)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:310)
... 15 more
class is org.hyperic.hq.product.servlet.client.JMXRemote
C:\Oracle\Middleware\user_projects\domains\prod_domain>java weblogic.Admin -url t3://localhost:8001 -username weblogic -password weblogic1 -pretty GET -type ClusterRuntime
---------------------------
MBeanName: "prod_domain:ServerRuntime=ms1,Name=mycluster,Type=ClusterRuntime,Location=ms1"
ActiveSingletonServices:
AliveServerCount: 1
CachingDisabled: true
CurrentMachine: mymachine
CurrentSecondaryServer:
DetailedSecondariesDistribution:
ForeignFragmentsDroppedCount: 0
FragmentsReceivedCount: 0
FragmentsSentCount: 109
HealthState: Component:null,State:HEALTH_OK,MBean:null,ReasonCode:[]
JobSchedulerRuntime:
MulticastMessagesLostCount: 0
Name: mycluster
Parent: ms1
PrimaryCount: 0
Registered: true
ResendRequestsCount: 0
SecondaryCount: 0
SecondaryDistributionNames:
SecondaryServerDetails:
ServerMigrationRuntime: ServerMigrationRuntime
ServerNames: ms1
Type: ClusterRuntime
UnicastMessaging: UnicastMessagingRuntime
Labels:
hyperic
NullPointerException in javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Ljavax.management.ObjectName;Ljava.lang.String;Ljavax.security.auth.Subject
####<May 29, 2012 9:15:21 AM CEST> <Warning> <RMI> <hqchnesoa104> <osbts1ms1> <[ACTIVE] ExecuteThread: '37' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9455361429c2e897:-625be7be:13750d021c6:-8000-000000000005d8ff> <1338275721766> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Ljavax.management.ObjectName;Ljava.lang.String;Ljavax.security.auth.Subject;)
java.lang.NullPointerException.
java.lang.NullPointerException
>
Still investigating....
java.lang.NullPointerException.
java.lang.NullPointerException
>
Still investigating....
Sunday, May 27, 2012
Extracting a single resultset row from sql:query resultset
I know, JSTL SQL breaks the MVC pattern. Who cares. It's quick and dirty and it works.
I simply hate complicated setups of MVC products, gimme the result now with minimal effort and I will be grateful to you.
So, all the examples are about retrieving a ResultSet with a sql:query:
<sql:query var="rsInterfaceNames" dataSource="jdbc/soainfra_dev2">
select unique InterfaceID from WLI_QS_REPORT_VIEW order by InterfaceID DESC
</sql:query>
and then do a
<c:forEach var="rowIF" items="${rsInterfaceNames.rows}">
do something with ${rowIF.someAttribute}
</c:forEach>
This simply doesn't apply when you retrieve a ResultSet with a single row, suck as in SELECT COUNT(*) FROM SOMETABLE;
Here is the javadoc of the object returned into the resultset var:
http://tomcat.apache.org/taglibs/standard/apidocs/org/apache/taglibs/standard/tag/common/sql/ResultImpl.html
and here is how you can get the value of count(*):
${rsInterfaceCount.getRowsByIndex()[0][0]}
in case you have trouble with conversions, just use select TO_CHAR(count(*)) ...
I simply hate complicated setups of MVC products, gimme the result now with minimal effort and I will be grateful to you.
So, all the examples are about retrieving a ResultSet with a sql:query:
<sql:query var="rsInterfaceNames" dataSource="jdbc/soainfra_dev2">
select unique InterfaceID from WLI_QS_REPORT_VIEW order by InterfaceID DESC
</sql:query>
and then do a
<c:forEach var="rowIF" items="${rsInterfaceNames.rows}">
do something with ${rowIF.someAttribute}
</c:forEach>
This simply doesn't apply when you retrieve a ResultSet with a single row, suck as in SELECT COUNT(*) FROM SOMETABLE;
Here is the javadoc of the object returned into the resultset var:
http://tomcat.apache.org/taglibs/standard/apidocs/org/apache/taglibs/standard/tag/common/sql/ResultImpl.html
and here is how you can get the value of count(*):
${rsInterfaceCount.getRowsByIndex()[0][0]}
in case you have trouble with conversions, just use select TO_CHAR(count(*)) ...
Book: Oracle WebLogic Administration Essentials
http://www.packtpub.com/oracle-weblogic-server-11gr2-administration-essentials/book
This book is good if you just want to be introduced to WebLogic; I could not find any really advanced information. Nevertheless, I found it quite comprehensive and well explained. A good starting point for whoever wants to become a professional WebLogic Administrator.
This book is good if you just want to be introduced to WebLogic; I could not find any really advanced information. Nevertheless, I found it quite comprehensive and well explained. A good starting point for whoever wants to become a professional WebLogic Administrator.
Labels:
books
Saturday, May 26, 2012
Replacing values in XML is easy with XmlTask
http://www.oopsconsultancy.com/software/xmltask/
especially the replace command is quite useful:
as explained in this excellent post, you can use it to customize a OSB project
especially the replace command is quite useful:
<xmltask source="../${env.BUILD_ENVIRONMENT}/tmp/System/SMTP_Servers/EmailServer.SMTPServer" dest="../${env.BUILD_ENVIRONMENT}/tmp/System/SMTP_Servers/EmailServer.SMTPServer"> <!-- change email server URL --> <replace path="/xml-fragment/*[local-name(.)='serverURL']/text()" withText="${EmailServer.smtp.Server_URL}"/> <!-- change email server port number --> <replace path="/xml-fragment/*[local-name(.)='portNumber']/text()" withText="${EmailServer.smtp.Port_Number}"/> </xmltask>
as explained in this excellent post, you can use it to customize a OSB project
Labels:
xml
The FTP MOVE operation with a JCA FTP Adapter
the difference between the case with RNFR-RNTO and the case of COPY/DELETE. The difference is simpls using
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"
in the dynamic JCA properties of the Business Service built on top the JCA FTPAdapter
THIS IS THE GOOD CASE, with
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"
the MOVE is done with a RNFR-RNTO:
[ INFO] 2012-05-25 23:41:17,664 [myuser] [10.19.10.100] RECEIVED: RNFR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,665 [myuser] [10.19.10.100] SENT: 350 Requested file action pending further information.
[ INFO] 2012-05-25 23:41:17,666 [myuser] [10.19.10.100] RECEIVED: RNTO /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,667 [myuser] [10.19.10.100] File rename from "/myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml" to "/myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml"
[ INFO] 2012-05-25 23:41:17,668 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, file renamed.
THIS IS THE BAD CASE, without using the "UseNative" options: the move is done by RETRIEVING locally the file, COPYING it to destination and DELETING the remote source:
[ INFO] 2012-05-25 23:47:17,806 [myuser] [10.19.10.100] RECEIVED: RETR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,807 [myuser] [10.19.10.100] File downloaded /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] Releasing unreserved passive port: 54862
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 226 Transfer complete.
[ INFO] 2012-05-25 23:47:17,847 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] RECEIVED: TYPE I
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] SENT: 200 Command TYPE okay.
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] RECEIVED: CWD /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] SENT: 250 Directory changed to /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] RECEIVED: PASV
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] SENT: 227 Entering Passive Mode (10,56,5,192,234,152)
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] RECEIVED: STOR POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] File uploaded /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] Releasing unreserved passive port: 60056
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.
[ INFO] 2012-05-25 23:47:17,854 [myuser] [10.19.10.100] SENT: 226 Transfer complete.
[ INFO] 2012-05-25 23:47:17,894 [myuser] [10.19.10.100] RECEIVED: CWD /
[ INFO] 2012-05-25 23:47:17,895 [myuser] [10.19.10.100] SENT: 250 Directory changed to /
[ INFO] 2012-05-25 23:47:17,896 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,897 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,898 [myuser] [10.19.10.100] RECEIVED: DELE /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] File delete : myuser - /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, deleted /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml.
note: those options are totally undocumented
you need to add this
in your BS at the end of the tran:provider-specific section
These events are visible also in the WLS logs if you enable java:alsb-jca-framework-adapter-debug in alsbdebug.xml
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"
in the dynamic JCA properties of the Business Service built on top the JCA FTPAdapter
THIS IS THE GOOD CASE, with
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"
the MOVE is done with a RNFR-RNTO:
[ INFO] 2012-05-25 23:41:17,664 [myuser] [10.19.10.100] RECEIVED: RNFR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,665 [myuser] [10.19.10.100] SENT: 350 Requested file action pending further information.
[ INFO] 2012-05-25 23:41:17,666 [myuser] [10.19.10.100] RECEIVED: RNTO /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,667 [myuser] [10.19.10.100] File rename from "/myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml" to "/myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml"
[ INFO] 2012-05-25 23:41:17,668 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, file renamed.
THIS IS THE BAD CASE, without using the "UseNative" options: the move is done by RETRIEVING locally the file, COPYING it to destination and DELETING the remote source:
[ INFO] 2012-05-25 23:47:17,806 [myuser] [10.19.10.100] RECEIVED: RETR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,807 [myuser] [10.19.10.100] File downloaded /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] Releasing unreserved passive port: 54862
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 226 Transfer complete.
[ INFO] 2012-05-25 23:47:17,847 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] RECEIVED: TYPE I
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] SENT: 200 Command TYPE okay.
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] RECEIVED: CWD /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] SENT: 250 Directory changed to /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] RECEIVED: PASV
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] SENT: 227 Entering Passive Mode (10,56,5,192,234,152)
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] RECEIVED: STOR POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] File uploaded /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] Releasing unreserved passive port: 60056
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.
[ INFO] 2012-05-25 23:47:17,854 [myuser] [10.19.10.100] SENT: 226 Transfer complete.
[ INFO] 2012-05-25 23:47:17,894 [myuser] [10.19.10.100] RECEIVED: CWD /
[ INFO] 2012-05-25 23:47:17,895 [myuser] [10.19.10.100] SENT: 250 Directory changed to /
[ INFO] 2012-05-25 23:47:17,896 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,897 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.
[ INFO] 2012-05-25 23:47:17,898 [myuser] [10.19.10.100] RECEIVED: DELE /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] File delete : myuser - /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, deleted /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml.
note: those options are totally undocumented
you need to add this
<jca:dynamic-endpoint-properties> <jca:endpoint-property> <jca:name>UseNativeRenameOperation</jca:name> <jca:value>true</jca:value> </jca:endpoint-property> <jca:endpoint-property> <jca:name>UseFtpRenameOperation</jca:name> <jca:value>true</jca:value> </jca:endpoint-property> </jca:dynamic-endpoint-properties>
in your BS at the end of the tran:provider-specific section
These events are visible also in the WLS logs if you enable java:alsb-jca-framework-adapter-debug in alsbdebug.xml
Labels:
ftpadapter,
JCA
Friday, May 25, 2012
BeanShell callout for OSB
Problem with Java Callouts is that they are a pain to maintain - separate Java project, need to build and deploy to OSB project.
If you have frequent, simple Java code to execute, you might avail yourself of an INTERPRETER like BeanShell
Just copy bsh-2.0b4.jar to $DOMAIN_HOME/lib directory, restart your server, and you are ready to use the BeanShellJavaCallout Java wrapper to BeanShell:
If you have frequent, simple Java code to execute, you might avail yourself of an INTERPRETER like BeanShell
Just copy bsh-2.0b4.jar to $DOMAIN_HOME/lib directory, restart your server, and you are ready to use the BeanShellJavaCallout Java wrapper to BeanShell:
package com.acme.javacallout; import bsh.EvalError; import bsh.Interpreter; public class BeanShellJavaCallout { public static String callBeanShell(String code) throws EvalError { Interpreter i = new Interpreter(); Object result = i.eval(code); return result.toString(); } }
package com.acme.javacallout; import static org.junit.Assert.*; import org.junit.Test; import bsh.EvalError; import bsh.Interpreter; public class BeanShellJavaCalloutTest { @Test public void callBeanShellTest() throws EvalError { System.setProperty("weblogic.Name", "osbdv1ms1"); String result = BeanShellJavaCallout.callBeanShell("return java.lang.System.getProperty(\"weblogic.Name\")"); assertEquals("osbdv1ms1", result); } }
Labels:
beanshell
Thursday, May 24, 2012
Resignation letter
I have found this email in my drafts of several years ago. I was on a project fighting desperately to keep it afloat - spending literally every day until 10 pm, every Saturday and Sunday at office... eventually I was kicked out - my criticism was too loud - and 2 years later the project has failed with almost 100 Million USD thrown down the drain.
I want to leave this project.
I cannot take any more the amount of negativity,
of finger pointing,
of approximation,
of improvisation,
of political talks in the corridor,
of blaming the meek and praising the powerful,
of lack of analysis,
of lack of design,
of total absence of any technical document,
of the omnipresence of buzzwording and obscure language,
of the left hand doesn't know what the right is doing,
of magical thinking,
of religious preaching,
of delegation of responsibility,
of mediocrity,
of irresponsible managers,
of heroic people who want to achieve something being subject to constant criticism by a cohort of useless mediocre unproductive guys,
of constant last minute destruction of things that have taken weeks of hard work to build,
of targets who keep moving so that it becomes impossible to reach them,
of slagging, accusing, backstabbing.
of 3 people who do something and 10 people criticize what the 3 people are doing.
I am resigning now. My last day will be the 19th of September, unless you decide to terminate my contract sooner.
Working for ACME has been a beautiful magical dream. Reality is different.
Now, I feel very proud for having been excluded from that gigantic failure.
I want to leave this project.
I cannot take any more the amount of negativity,
of finger pointing,
of approximation,
of improvisation,
of political talks in the corridor,
of blaming the meek and praising the powerful,
of lack of analysis,
of lack of design,
of total absence of any technical document,
of the omnipresence of buzzwording and obscure language,
of the left hand doesn't know what the right is doing,
of magical thinking,
of religious preaching,
of delegation of responsibility,
of mediocrity,
of irresponsible managers,
of heroic people who want to achieve something being subject to constant criticism by a cohort of useless mediocre unproductive guys,
of constant last minute destruction of things that have taken weeks of hard work to build,
of targets who keep moving so that it becomes impossible to reach them,
of slagging, accusing, backstabbing.
of 3 people who do something and 10 people criticize what the 3 people are doing.
I am resigning now. My last day will be the 19th of September, unless you decide to terminate my contract sooner.
Working for ACME has been a beautiful magical dream. Reality is different.
Now, I feel very proud for having been excluded from that gigantic failure.
Microsoft Windows performance tips that worked for me
- disable User Access Control http://www.petri.co.il/disable_uac_in_windows_vista.htm
- disable Indexing http://www.howtogeek.com/howto/28450/what-is-searchindexer.exe-and-why-is-it-running/
- disable Everything Search loading on startup (if you have installed it)
- in Control Panel\Performance Information and Tools , Adjust Visual Effects by unchecking everything and leave only Smooth Edges of Screen Fonts
- disable Indexing http://www.howtogeek.com/howto/28450/what-is-searchindexer.exe-and-why-is-it-running/
- disable Everything Search loading on startup (if you have installed it)
- in Control Panel\Performance Information and Tools , Adjust Visual Effects by unchecking everything and leave only Smooth Edges of Screen Fonts
Labels:
windows
logrotate
Doc here http://linuxcommand.org/man_pages/logrotate8.html
find / -name logrotate 2> /dev/null
/etc/cron.daily/logrotate
/usr/sbin/logrotate
less /etc/cron.daily/logrotate
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
less /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
minsize 1M
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
find / -name logrotate 2> /dev/null
/etc/cron.daily/logrotate
/usr/sbin/logrotate
less /etc/cron.daily/logrotate
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
less /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
minsize 1M
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
Labels:
logrotation
Wednesday, May 23, 2012
Hyperic versus Nagios
8.5M vs 860K.... by a factor of 10, Nagios is definitely more popular than Hyperic.
Here they say that "Hyperic customers have successfully transitioned from Nagios to Hyperic's deeper management capabilities and easier deployment. Many have identified Nagios' complex and time consuming setup and limited features as a main reason to migrate their management solution to Hyperic."
I don't have experience (sob) with Nagios, all I can say is that Hyperic is VERY easy to install and use, but when it comes to customization and documentation, it's really really poorly supported.
Tuesday, May 22, 2012
China ascent in Software... again
As we have noticed before, the ascent of China in the software bubsiness is FAST. These are the hits in the last month....give it another 3 months and China will be second only to USA and India.... then it will take over India... give it one year... things happen FAST.
The IO operation failed. BINDING.JCA-11096
We are using a JCA FTPAdapter,and occasionally, under load, the FTPMove operation fails:
Looking in the oracle.tip.adapter.ftp.outbound.FTPIoOperation, I find out that "S->R,T->R" means "Source=Remote, Target=Remote - in fact we are moving files on the remote destination only.
and I see in the logs:
and in this case the code executed is:
if(!alreadyMoved && success && move)
try
{
deleteFile(fs.getSourceAgent(), spec, fInfo);
}
catch(Exception e)
{
throw new FileRetriableResourceException(11096, new Object[] {
(new StringBuilder()).append("OPER[NOOP][").append(mode).append("]").toString(), (new StringBuilder()).append(targetDir).append("/").append(targetFile).toString()
}, e);
}
Error "Please ensure whether the remote file has delete permission" is 11434
The delete is actually done in oracle.tip.adapter.ftp.FTPClient:
in oracle.tip.adapter.ftp.FTPReply I find out that:
public static final int FILE_UNAVAILABLE = 550;
still no clue on what goes wrong...
I understand that there is a FTP RNTO mode, if you want to enable, specify the JCA activation property UseFtpRenameOperation=true or UseNativeRenameOperation=true.
This will entail using a move() operation rather than a copy followed by a delete (you have to look at FTPIoOperation.ioOnly() method).
PS I discovered after a lot of pain that we were generating twice the same filename on the destination.... not a good idea...
Unable to delete file '/messages/somefile.xml'; FTP command DELE returned unexpected reply code : 550 WSIF JCA Execute of operation ''FTPMove'' failed due to: The IO operation failed. The IO operation failed. The "OPER[NOOP][S->R,T->R]" IO operation for "/messages/somefile.xml" failed. ; nested exception is: BINDING.JCA-11096 The IO operation failed. The IO operation failed',null,null,null);
Looking in the oracle.tip.adapter.ftp.outbound.FTPIoOperation, I find out that "S->R,T->R" means "Source=Remote, Target=Remote - in fact we are moving files on the remote destination only.
and I see in the logs:
Error deleting file from FTP Server. Error deleting file from FTP Server. Unable to delete file from server. Please ensure whether the remote file has delete permission. at oracle.tip.adapter.ftp.FTPClient.deleteFile(FTPClient.java:1362) at oracle.tip.adapter.ftp.FTPAgent.deleteFile(FTPAgent.java:736) at oracle.tip.adapter.ftp.outbound.FTPIoOperation.deleteFile(FTPIoOperation.java:188) at oracle.tip.adapter.ftp.outbound.FTPIoOperation.ioOnly(FTPIoOperation.java:174)
and in this case the code executed is:
if(!alreadyMoved && success && move)
try
{
deleteFile(fs.getSourceAgent(), spec, fInfo);
}
catch(Exception e)
{
throw new FileRetriableResourceException(11096, new Object[] {
(new StringBuilder()).append("OPER[NOOP][").append(mode).append("]").toString(), (new StringBuilder()).append(targetDir).append("/").append(targetFile).toString()
}, e);
}
Error "Please ensure whether the remote file has delete permission" is 11434
The delete is actually done in oracle.tip.adapter.ftp.FTPClient:
public boolean deleteFile(FTPManagedConnection managedConnection, String file) throws IOException, ResourceException { Socket controlSocket = managedConnection.getControlSocket(); String replyStr = dele(controlSocket, file); int rc = getReplyCode(replyStr, m_ftpDesc.ftpHost); log((new StringBuilder()).append("FTPClient.deleteFile(): ").append(replyStr).toString(), 102); if(!m_ftpReplyValidator.isValidDELEReturnCode(rc)) { log((new StringBuilder()).append("Unable to delete file '").append(file).append("'; ").append("FTP command DELE returned unexpected reply code : ").append(rc).toString(), 100); FileResourceException frex = new FileResourceException(11434); frex.setEISErrorCode(String.valueOf(rc)); frex.setEISErrorMessage(replyStr); throw frex; } else { return true; } }
in oracle.tip.adapter.ftp.FTPReply I find out that:
public static final int FILE_UNAVAILABLE = 550;
still no clue on what goes wrong...
I understand that there is a FTP RNTO mode, if you want to enable, specify the JCA activation property UseFtpRenameOperation=true or UseNativeRenameOperation=true.
This will entail using a move() operation rather than a copy followed by a delete (you have to look at FTPIoOperation.ioOnly() method).
PS I discovered after a lot of pain that we were generating twice the same filename on the destination.... not a good idea...
Labels:
ftpadapter
SQLPlus command line instructions
echo exit | sqlplus dv1_soainfra/dv1_password@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myserver.acme.com)(PORT=1551)))(CONNECT_DATA=(SID=dosb01)))' @c:/pierre/sql/mycommands.sql
all in one :o)
all in one :o)
Labels:
sqlplus
Monday, May 21, 2012
Performance test of JDBCStore versus Local FileStore vs NFS FileStore
- created JDBCStore PerfTestJDBCStore1,2,3,4 in PROD, based on SOADataSource (RAC) and targeted to osbpr1ms1, 2, 3, 4 migratable
- created PerfTestJMSServer1,2,3,4 based on PerfTestJDBCStore1, 2, 3, 4
- created PerfTestJMSModule , subdeployment PerfTestSD with targets PerfTestJMSServer1,2,3,4
- created PerfTestJMSDQ, Uniform Distributed Queue , targetd PerfTestJMSServer1, 2,3,4
created a project JMSPerfTest with a PS PerfTestJMSPS reading from the queue (jms://pippo2-osbpr1ms1.acme.com:8001,pippo2-osbpr1ms2.acme.com:8001,pippo2-osbpr1ms3.acme.com:8001,pippo2-osbpr1ms4.acme.com:8001/weblogic.jms.XAConnectionFactory/jms.PerfTestJMSDQ) and routing to a BS PerfTestJMSBS which writes to the same queue
jms://pippo2-osbpr1ms1.acme.com:8001,pippo2-osbpr1ms2.acme.com:8001,pippo2-osbpr1ms3.acme.com:8001,pippo2-osbpr1ms4.acme.com:8001/weblogic.jms.XAConnectionFactory/jms.PerfTestJMSDQ
In practice the system reads and writes to the same queue, like a cat spinning on itself trying to catch his own tail (dogs do this more than cats)
I trigger the system by dropping a jmsmessage in each separate instance of the Distributed Queue. The message says “ ”. It’s of type String and it’s Persistent.
I enable monitoring on the PS. I observe 74K messages per minute.
I do the same by using a local FileStore instead of the JDBC store. The file location is /opt/oracle/domains/osbpr1do/servers/osbpr1ms1,2,3,4/data/store (local, no NFS)
I restart the managed servers just in case.
Observed speed is 600K messages per minute!
A third experiment is done with FileStore pointing to the NFS store:
/opt/oracle/domains/osbpr1do/shared/store/jms
Thruput: 140K messages per minute.
Morale is:
- all 3 setups (JDBCStore, Local FileStore, NFS FileStore) seem MORE than fast enough for our needs
- Local FileStore is faster, then NFS FileStore, then JDBCStore
I haven’t tested scenarios with Transactions Required.
- created PerfTestJMSServer1,2,3,4 based on PerfTestJDBCStore1, 2, 3, 4
- created PerfTestJMSModule , subdeployment PerfTestSD with targets PerfTestJMSServer1,2,3,4
- created PerfTestJMSDQ, Uniform Distributed Queue , targetd PerfTestJMSServer1, 2,3,4
created a project JMSPerfTest with a PS PerfTestJMSPS reading from the queue (jms://pippo2-osbpr1ms1.acme.com:8001,pippo2-osbpr1ms2.acme.com:8001,pippo2-osbpr1ms3.acme.com:8001,pippo2-osbpr1ms4.acme.com:8001/weblogic.jms.XAConnectionFactory/jms.PerfTestJMSDQ) and routing to a BS PerfTestJMSBS which writes to the same queue
jms://pippo2-osbpr1ms1.acme.com:8001,pippo2-osbpr1ms2.acme.com:8001,pippo2-osbpr1ms3.acme.com:8001,pippo2-osbpr1ms4.acme.com:8001/weblogic.jms.XAConnectionFactory/jms.PerfTestJMSDQ
In practice the system reads and writes to the same queue, like a cat spinning on itself trying to catch his own tail (dogs do this more than cats)
I trigger the system by dropping a jmsmessage in each separate instance of the Distributed Queue. The message says “
I enable monitoring on the PS. I observe 74K messages per minute.
I do the same by using a local FileStore instead of the JDBC store. The file location is /opt/oracle/domains/osbpr1do/servers/osbpr1ms1,2,3,4/data/store (local, no NFS)
I restart the managed servers just in case.
Observed speed is 600K messages per minute!
A third experiment is done with FileStore pointing to the NFS store:
/opt/oracle/domains/osbpr1do/shared/store/jms
Thruput: 140K messages per minute.
Morale is:
- all 3 setups (JDBCStore, Local FileStore, NFS FileStore) seem MORE than fast enough for our needs
- Local FileStore is faster, then NFS FileStore, then JDBCStore
I haven’t tested scenarios with Transactions Required.
WebLogic, how to run SQL commands without SQLPlus
few people know this :o) :
cd $DOMAIN_HOME
. ./bin/setDomainEnv.sh
java utils.Schema
Usage: java utils.Schema <url> <driver> [options] <SQL file>
where:
<url> JDBC driver URL.
<driver> JDBC driver class pathname.
<SQL file> Text file with SQL statements.
where options include:
-u <user> User name to be passed to database.
-p <password> User password to be passed to database.
-verbose Print SQL statements and database messages.
utils.Schema is a class in weblogic.jar
cd $DOMAIN_HOME
. ./bin/setDomainEnv.sh
java utils.Schema
Usage: java utils.Schema <url> <driver> [options] <SQL file>
where:
<url> JDBC driver URL.
<driver> JDBC driver class pathname.
<SQL file> Text file with SQL statements.
where options include:
-u <user> User name to be passed to database.
-p <password> User password to be passed to database.
-verbose Print SQL statements and database messages.
utils.Schema is a class in weblogic.jar
Saturday, May 19, 2012
Troubleshooting a "server down" or a "filesystem full"
Server myserver down:
ping myserver
ssh myuser@myserver
check if Hyperic monitoring agent is running:
ps -eaf|grep agent|grep java|grep -v grep
For a file system full or about to be full:
df –k
cd filesystemName
du 2> /dev/null | sort -nr | cut -f2- | xargs du -hs 2> /dev/null | more
(see http://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size)
ping myserver
ssh myuser@myserver
check if Hyperic monitoring agent is running:
ps -eaf|grep agent|grep java|grep -v grep
For a file system full or about to be full:
df –k
cd filesystemName
du 2> /dev/null | sort -nr | cut -f2- | xargs du -hs 2> /dev/null | more
(see http://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size)
Apple vs Microsoft
it's still very true.
It's one of the greatest mystery of life, why corporate IT departments insist on passing you this kind of crap, and then be surprised if 80% of IT projects fail.
Friday, May 18, 2012
Thursday, May 17, 2012
OSB Cannot create resource outside of a session
Today I was unable to activate a OSB session after making some changes.
The only way was to restart cluster and admin....
I suspect someone made some configuration changes in WebLogic and didn't restart.
Failing to restart after making configuration changes can lead to funny behaviour.
The only way was to restart cluster and admin....
I suspect someone made some configuration changes in WebLogic and didn't restart.
Failing to restart after making configuration changes can lead to funny behaviour.
Labels:
OSB
Wednesday, May 16, 2012
Monday, May 14, 2012
OSB RouterRuntimeCache and performance tuning
http://docs.oracle.com/cd/E25054_01/core.1111/e10108/osb.htm
I was unaware that
-Dcom.bea.wli.sb.pipeline.RouterRuntimeCache.size={size}
can be quite important in tuning performance in OSB projects entailing a large number of Proxies...
good to know!
Also the rest of the article is quite interesting.
I was unaware that
-Dcom.bea.wli.sb.pipeline.RouterRuntimeCache.size={size}
can be quite important in tuning performance in OSB projects entailing a large number of Proxies...
good to know!
Also the rest of the article is quite interesting.
Labels:
OSB
Hyperic and SNMP traps
http://support.hyperic.com/display/DOC/Configuring+HQ+as+an+SNMP+Trap+Receiver
I add
snmpTrapReceiver.listenAddress=udp:0.0.0.0/1620
to agent.properties
restart agent
netstat -an
UDP 0.0.0.0:1620 *:*
Click on Resources/New Platform/
name=TrapProxy
description=receiving SNMP traps
Platform type=Network device
agent connection=127.0.0.1:2144
fqdn=myhostSNMP.acme.com
ipaddress=10.56.64.190
mac=???
netmask=???
OK
now scroll down and click Edit in the "Configuration Properties"
interface.index=ifDescr
snmpIp=10.56.64.190
snmpCommunity=public
snmpPort=1620 (instead of the default 161)
OK
I get "Error contacting resource: Unable to connect to SNMP Agent (10.56.64.190:1620 v2c,public)"
http://communities.vmware.com/message/1939292
... to be continued....
I add
snmpTrapReceiver.listenAddress=udp:0.0.0.0/1620
to agent.properties
restart agent
netstat -an
UDP 0.0.0.0:1620 *:*
Click on Resources/New Platform/
name=TrapProxy
description=receiving SNMP traps
Platform type=Network device
agent connection=127.0.0.1:2144
fqdn=myhostSNMP.acme.com
ipaddress=10.56.64.190
mac=???
netmask=???
OK
now scroll down and click Edit in the "Configuration Properties"
interface.index=ifDescr
snmpIp=10.56.64.190
snmpCommunity=public
snmpPort=1620 (instead of the default 161)
OK
I get "Error contacting resource: Unable to connect to SNMP Agent (10.56.64.190:1620 v2c,public)"
http://communities.vmware.com/message/1939292
... to be continued....
Sunday, May 13, 2012
Hyperic, browse PostgreSQL DB
look in C:\pierre\hypericserver\server-4.6.5-EE\conf\hq-server.conf
server.database=PostgreSQL
server.database-driver=org.postgresql.Driver
server.database-url=jdbc:postgresql://127.0.0.1:9432/hqdb?protocolVersion=2
server.database-user=hqadmin
server.database-password=ENC(Nadmq0eNldP2+Cew2mu+fw==)
To browse the DB:
start HQ Server
C:\pierre\hypericserver\server-4.6.5-EE\bin\db-psql.bat
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
Warning: Console code page (437) differs from Windows code page (1252)
8-bit characters may not work correctly. See psql reference
page "Notes for Windows users" for details.
Useful commands
\h help with SQL commands
? help with psql commands
\du list roles/users
\l list databases
\c to choose a database
\d to list tables once in a database
\q quit
I do:
\c hqdb
\d
and I get plenty of eam_", hq_metric* and qrtz* tables. It looks quite complex.
select * from eam_platform;
select * from eam_resource;
here http://linux.die.net/man/1/psql the manual of psql
If you need a GUI, here http://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools a lost of GUI who support PostgreSQL
I have installed Squirrel, and copied postgresql-7.4.3.jar from Hyperic to C:\pierre\squirrel\lib (requires restart). It connects without problem (use jdbc:postgresql://127.0.0.1:9432/hqdb?protocolVersion=2 hqadmin hqadmin), but then I am lost in this UI.
server.database=PostgreSQL
server.database-driver=org.postgresql.Driver
server.database-url=jdbc:postgresql://127.0.0.1:9432/hqdb?protocolVersion=2
server.database-user=hqadmin
server.database-password=ENC(Nadmq0eNldP2+Cew2mu+fw==)
To browse the DB:
start HQ Server
C:\pierre\hypericserver\server-4.6.5-EE\bin\db-psql.bat
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
Warning: Console code page (437) differs from Windows code page (1252)
8-bit characters may not work correctly. See psql reference
page "Notes for Windows users" for details.
Useful commands
\h help with SQL commands
? help with psql commands
\du list roles/users
\l list databases
\c to choose a database
\d to list tables once in a database
\q quit
I do:
\c hqdb
\d
and I get plenty of eam_", hq_metric* and qrtz* tables. It looks quite complex.
select * from eam_platform;
select * from eam_resource;
here http://linux.die.net/man/1/psql the manual of psql
If you need a GUI, here http://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools a lost of GUI who support PostgreSQL
I have installed Squirrel, and copied postgresql-7.4.3.jar from Hyperic to C:\pierre\squirrel\lib (requires restart). It connects without problem (use jdbc:postgresql://127.0.0.1:9432/hqdb?protocolVersion=2 hqadmin hqadmin), but then I am lost in this UI.
Labels:
hyperic,
PostgreSQL
Hyperic: my first WORKING plugin
(after 1 day of pain and sorrow)
Run your test application:
java -Dproc.java.home=C:\Oracle\Middleware\jdk160_24 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.acme.hqautomation.jmx.SimpleAgent
and then run the monitoring plugin:
java -Dplugins.include=myfirstplugin -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar -m discover -a metric -Dlog=debug
BEWARE! the xml filename must be myfirstplugin-plugin.xml (I think the idea of adding the -plugin is REALLY stupid anyway, and it's not explained in the doc)
Here is SimpleAgent
Here is myfirstplugin-plugin.xml (the entity process-metrics.xml has been removed since I am not monitoring the process, only the jmx metrics)
In the autodiscovery, you should now find a "Java 1.6 C:\Oracle\Middleware\jdk160_24" resource name, add it, then in the Inventory you should find 2 metrics:
Java 1.6.x Copy Java GC
Java 1.6.x MarkSweepCompact Java GC
The result of running the plugin tester is:
C:\Oracle\Middleware\jdk160_24\bin>java -Dplugins.include=myfirstplugin -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar -m discover -a metric -Dlog=debug
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/pierre/hypericagent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
INFO [main] [ProductPluginManager] agent.pdkDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk
INFO [main] [ProductPluginManager] agent.pdkPluginDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk/plugins
INFO [main] [ProductPluginManager] agent.pdkWorkDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk/work
DEBUG [main] [ProductPluginManager] Initializing in client mode (pdk=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk)
INFO [main] [ConfigTrackPluginManager] Running on Server, FileMonitor not initiated
DEBUG [main] [MIBTree] C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\mibs MIB dir does not exist
INFO [main] [ProductPluginManager] Loading plugin: myfirstplugin-plugin.xml (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager] Manifest retrieval had an exception (continuing): error in opening zip file
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml expanding C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j...
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-jmx-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-remote-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-rjmx-2.1.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-tools-3.0.1.jar
INFO [main] [ProductPluginManager] Loading plugin: netservices-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\netservices-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - Net Services Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [ClientPluginDeployer] Unchanged file: C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\work\lib\netservices\dnsjava-2.0.6.jar
DEBUG [main] [PluginLoader] netservices-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\work\lib\netservices\dnsjava-2.0.6.jar
INFO [main] [MeasurementPlugin] Register TCP Socket proxy for domain: socket
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: http
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: url.availability
INFO [main] [MeasurementPlugin] Register FTP proxy for domain: ftp
INFO [main] [ProductPluginManager] Loading plugin: sqlquery-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\sqlquery-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - SQL Query Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [PluginLoader] sqlquery-plugin.jar expanding C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc...
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\msbase-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\mssqlserver-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\msutil-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\mysql-connector-java-commercial-5.1.10.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\ojdbc5-11.2.0.2.0.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\postgresql-7.4.3.jar
INFO [main] [SQLQueryMeasurementPlugin] Registered proxy for domain: sql
INFO [main] [ProductPluginManager] Loading plugin: system-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\system-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - System Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [SystemPlugin] sigar.mirror.procnet=null
DEBUG [main] [PluginDiscoverer] Adding Auto Scanners=[ServerSignature {stName=Java 1.5.x, match=[null], exclude=[null], regMatch=[null]}, ServerSignature {stName=Java 1.6.x, match=[null], exclude=[null], regMatch=[null]}]
DEBUG [main] [PluginDiscoverer] Adding Registry Scanners=[]
DEBUG [Thread-1] [NullScan] Running AutoServerDetector for: Java 1.5.x
DEBUG [Thread-1] [MxServerDetector] ptql=State.Name.sw=java,Args.*.sw=-Dproc.java.home= matched pids=[[J@12b6c89]
DEBUG [Thread-1] [MxServerDetector] C:\Oracle\Middleware\jdk160_24\jre\lib\fontconfig.Sun.2003.bfc does not exist, skipping
DEBUG [Thread-1] [NullScan] Running AutoServerDetector for: Java 1.6.x
DEBUG [Thread-1] [MxServerDetector] ptql=State.Name.sw=java,Args.*.sw=-Dproc.java.home= matched pids=[[J@e53220]
DEBUG [Thread-1] [MxServerDetector] classpath unchanged using: C:\Oracle\Middleware\jdk160_24
DEBUG [Thread-1] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [Thread-1] [MxServerDetector] Using the local pid to create jmx url: ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24
DEBUG [Thread-1] [WindowsRegistryScan] Windows Registry Scan starting...
DEBUG [Thread-1] [WindowsRegistryScan] Windows Registry Scan completed, took: 0
1 servers detected
Server: CH30-0FRNC59 Java 1.6.x [C:\Oracle\Middleware\jdk160_24]
AIID.....C:\Oracle\Middleware\jdk160_24
config...
product..jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,
metric...
control..null
DEBUG [main] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [main] [MxUtil] created new JMXConnector url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=, classloader=sun.misc.Launcher$AppClassLoader@17182c1
Java 1.6.x Loaded Class Count:
java.lang:type=ClassLoading:LoadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(1086.0) -> 1,086.0
=>1,086.0<=
Java 1.6.x Total Loaded Class Count:
java.lang:type=ClassLoading:TotalLoadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(1086.0) -> 1,086.0
=>1,086.0<=
Java 1.6.x Unloaded Class Count:
java.lang:type=ClassLoading:UnloadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
Java 1.6.x Total Compilation Time:
java.lang:type=Compilation:TotalCompilationTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(102.0) -> 102ms
=>102ms<=
Java 1.6.x Thread Count:
java.lang:type=Threading:ThreadCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(17.0) -> 17.0
=>17.0<=
Java 1.6.x Daemon Thread Count:
java.lang:type=Threading:DaemonThreadCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(16.0) -> 16.0
=>16.0<=
DEBUG [main] [PluginDiscoverer] Runtime discover for CH30-0FRNC59 Java 1.6.x, config=jmx.username=,jmx.password=******,jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,log=debug,installpath=C:\Oracle\Middleware\jdk160_24,
DEBUG [main] [ProductPluginManager] No ProductPlugin found for: Java 1.6.x
DEBUG [main] [MxServerDetector] [discoverServices] serverConfig=platform.log_track.level=Warn,jmx.username=,platform.log_track.enable=true,jmx.password=******,platform.config_track.enable=true,log=debug,installpath=C:\Oracle\Middleware\jdk160_24,platform.fqdn=CH30-0FRNC59.euc.nestle.com,platform.type=Win32,platform.ip=127.0.0.1,platform.name=localhost,platform.log_track.eventlogs=System,jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,
DEBUG [main] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [main] [MxUtil] created new JMXConnector url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=, classloader=sun.misc.Launcher$AppClassLoader@17182c1
DEBUG [main] [MxServerDetector] [discoverMxServices] url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24
DEBUG [main] [MxServerDetector] [discoverMxServices] objName=java.lang:type=Threading
DEBUG [main] [MxServerDetector] [discoverMxServices] objName=java.lang:type=Threading
DEBUG [main] [MxServerQuery] [findServices] servicePlugins={Java 1.6.x Java GC=null}
DEBUG [main] [MxServerQuery] [findServices] name=java.lang:type=GarbageCollector,*
DEBUG [main] [MxServerQuery] [findServices] services=(2)[java.lang:type=GarbageCollector,name=Copy, java.lang:type=GarbageCollector,name=MarkSweepCompact]
DEBUG [main] [MxServerDetector] discovered 2 services
DEBUG [main] [ProductPluginManager] No ControlPlugin found for: Java 1.6.x Java GC
DEBUG [main] [ProductPluginManager] No ControlPlugin found for: Java 1.6.x Java GC
DEBUG [main] [MxServerDetector] discovered 2 services
Runtime Resource Report...
Platform=Win32, fqdn=CH30-0FRNC59.euc.nestle.com (Microsoft Windows 2008)
config...
product..null
metric...platform.log_track.level=Warn,platform.log_track.eventlogs=System,platform.log_track.enable=true,platform.config_track.enable=true,
control..null
cprops...cpuSpeed=4 @ 2394 MHz,secondaryDNS=160.213.132.241,defaultGateway=0.0.0.0,arch=x86,ram=2992 MB,vendor=Microsoft,vendorVersion=2008,primaryDNS=160.213.132.237,ip=10.60.160.46,version=6.0,
CH30-0FRNC59 Java 1.6.x cprops:
CH30-0FRNC59 Java 1.6.x services:
CH30-0FRNC59 Java 1.6.x Copy Java GC
config...
product..name=Copy,
metric...
control..null
rt.......null
Java 1.6.x Java GC Collection Count:
java.lang:type=GarbageCollector,name=Copy:CollectionCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(8.0) -> 8.0
=>8.0<=
Java 1.6.x Java GC Collection Time:
java.lang:type=GarbageCollector,name=Copy:CollectionTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(12.0) -> 12.0
=>12.0<=
CH30-0FRNC59 Java 1.6.x MarkSweepCompact Java GC
config...
product..name=MarkSweepCompact,
metric...
control..null
rt.......null
Java 1.6.x Java GC Collection Count:
java.lang:type=GarbageCollector,name=MarkSweepCompact:CollectionCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
Java 1.6.x Java GC Collection Time:
java.lang:type=GarbageCollector,name=MarkSweepCompact:CollectionTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
C:\Oracle\Middleware\jdk160_24\bin>
Run your test application:
java -Dproc.java.home=C:\Oracle\Middleware\jdk160_24 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.acme.hqautomation.jmx.SimpleAgent
and then run the monitoring plugin:
java -Dplugins.include=myfirstplugin -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar -m discover -a metric -Dlog=debug
BEWARE! the xml filename must be myfirstplugin-plugin.xml (I think the idea of adding the -plugin is REALLY stupid anyway, and it's not explained in the doc)
Here is SimpleAgent
package com.acme.jmx; import javax.management.*; import java.lang.management.*; public class SimpleAgent { private MBeanServer mbs = null; public SimpleAgent() { // Get the platform MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); // Unique identification of MBeans Hello helloBean = new Hello(); ObjectName helloName = null; try { // Uniquely identify the MBeans and register them with the platform MBeanServer helloName = new ObjectName("SimpleAgent:name=hellothere"); mbs.registerMBean(helloBean, helloName); } catch(Exception e) { e.printStackTrace(); } } // Utility method: so that the application continues to run private static void waitForEnterPressed() { try { System.out.println("Press to continue..."); System.in.read(); } catch (Exception e) { e.printStackTrace(); } } public static void main(String argv[]) { SimpleAgent agent = new SimpleAgent(); System.out.println("SimpleAgent is running..."); SimpleAgent.waitForEnterPressed(); } }
Here is myfirstplugin-plugin.xml (the entity process-metrics.xml has been removed since I am not monitoring the process, only the jmx metrics)
<?xml version="1.0"?> <!DOCTYPE plugin> <plugin package="org.hyperic.hq.plugin.java"> <classpath> <include name="pdk/lib/mx4j"/> </classpath> <filter name="template" value="${OBJECT_NAME}:${alias}"/> <metrics name="Class Loading Metrics"> <metric name="Loaded Class Count" indicator="false" category="THROUGHPUT"/> <metric name="Total Loaded Class Count" indicator="false" category="THROUGHPUT"/> <metric name="Unloaded Class Count" indicator="false" category="THROUGHPUT"/> </metrics> <metrics name="Compilation"> <metric name="Total Compilation Time" indicator="false" category="THROUGHPUT" collectionType="trendsup" units="ms"/> </metrics> <metrics name="Garbage Collector"> <metric name="Collection Count" indicator="false" category="THROUGHPUT" collectionType="trendsup"/> <metric name="Collection Time" indicator="false" category="THROUGHPUT" collectionType="trendsup"/> </metrics> <metrics name="Memory"> <metric name="Object Pending Finalization Count" category="THROUGHPUT" indicator="false"/> </metrics> <metrics name="Threading"> <metric name="Thread Count" category="UTILIZATION" indicator="false"/> <metric name="Daemon Thread Count" category="UTILIZATION" indicator="false"/> </metrics> <server name="Java" version="1.5.x"> <property name="HAS_BUILTIN_SERVICES" value="true"/> <property name="VERSION_FILE" value="jre/lib/fontconfig.Sun.2003.bfc"/> <property name="DEFAULT_PROGRAM" value="bin/java"/> <property name="domain" value="Java"/> <config> <option name="jmx.url" description="JMX URL to MBeanServer" default="service:jmx:rmi:///jndi/rmi://localhost:6969/jmxrmi"/> <option name="jmx.username" description="JMX username" optional="true" default=""/> <option name="jmx.password" description="JMX password" optional="true" default="" type="secret"/> <!--option name="process.query" description="PTQL for Java Process" default="State.Name.eq=java,Args.*.ct=proc.java.home"/--> </config> <!--metric name="Availability" template="sigar:Type=ProcState,Arg=%process.query%:State" indicator="true"/--> <property name="OBJECT_NAME" value="java.lang:type=ClassLoading"/> <metrics include="Class Loading Metrics"/> <property name="OBJECT_NAME" value="java.lang:type=Compilation"/> <metrics include="Compilation"/> <property name="OBJECT_NAME" value="java.lang:type=Memory"/> <plugin type="log_track" class="org.hyperic.hq.product.jmx.MxNotificationPlugin"/> <property name="OBJECT_NAME" value="java.lang:type=Threading"/> <metrics include="Threading"/> <!-- derive installpath from JAVA_HOME env prop... --> <property name="PROC_HOME_ENV" value="JAVA_HOME"/> <!-- derive installpath from -Dproc.java.home=... --> <property name="PROC_HOME_PROPERTY" value="proc.java.home"/> <plugin type="autoinventory" class="org.hyperic.hq.product.jmx.MxServerDetector"/> <plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/> <service name="Java GC"> <plugin type="autoinventory"/> <property name="OBJECT_NAME" value="java.lang:type=GarbageCollector,name=*"/> <metrics include="Garbage Collector"/> </service> </server> <server name="Java" version="1.6.x" include="1.5.x"> <property name="VERSION_FILE" value="jre/lib/management-agent.jar"/> </server> <!-- ==================== Plugin Help =========================== --> <help name="Java"> <![CDATA[ <p> <h3>Configure HQ for monitoring Java</h3> </p> <p> 1) Add this line to the java options when executing the binary. <br> "-Dcom.sun.management.jmxremote \ <br> -Dcom.sun.management.jmxremote.port=6969 \ <br> -Dcom.sun.management.jmxremote.ssl=false \ <br> -Dcom.sun.management.jmxremote.authenticate=false" <br> </p> ]]> </help> <help name="Java 1.5.x" include="Java"/> <help name="Java 1.6.x" include="Java"/> </plugin>
In the autodiscovery, you should now find a "Java 1.6 C:\Oracle\Middleware\jdk160_24" resource name, add it, then in the Inventory you should find 2 metrics:
Java 1.6.x Copy Java GC
Java 1.6.x MarkSweepCompact Java GC
The result of running the plugin tester is:
C:\Oracle\Middleware\jdk160_24\bin>java -Dplugins.include=myfirstplugin -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar -m discover -a metric -Dlog=debug
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/pierre/hypericagent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
INFO [main] [ProductPluginManager] agent.pdkDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk
INFO [main] [ProductPluginManager] agent.pdkPluginDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk/plugins
INFO [main] [ProductPluginManager] agent.pdkWorkDir=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk/work
DEBUG [main] [ProductPluginManager] Initializing in client mode (pdk=C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk)
INFO [main] [ConfigTrackPluginManager] Running on Server, FileMonitor not initiated
DEBUG [main] [MIBTree] C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\mibs MIB dir does not exist
INFO [main] [ProductPluginManager] Loading plugin: myfirstplugin-plugin.xml (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager] Manifest retrieval had an exception (continuing): error in opening zip file
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml expanding C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j...
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-jmx-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-remote-3.0.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-rjmx-2.1.1.jar
DEBUG [main] [PluginLoader] myfirstplugin-plugin.xml += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\mx4j\mx4j-tools-3.0.1.jar
INFO [main] [ProductPluginManager] Loading plugin: netservices-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\netservices-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - Net Services Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [ClientPluginDeployer] Unchanged file: C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\work\lib\netservices\dnsjava-2.0.6.jar
DEBUG [main] [PluginLoader] netservices-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\work\lib\netservices\dnsjava-2.0.6.jar
INFO [main] [MeasurementPlugin] Register TCP Socket proxy for domain: socket
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: http
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: url.availability
INFO [main] [MeasurementPlugin] Register FTP proxy for domain: ftp
INFO [main] [ProductPluginManager] Loading plugin: sqlquery-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\sqlquery-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - SQL Query Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [PluginLoader] sqlquery-plugin.jar expanding C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc...
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\msbase-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\mssqlserver-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\msutil-1.2.2.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\mysql-connector-java-commercial-5.1.10.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\ojdbc5-11.2.0.2.0.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\jdbc\postgresql-7.4.3.jar
INFO [main] [SQLQueryMeasurementPlugin] Registered proxy for domain: sql
INFO [main] [ProductPluginManager] Loading plugin: system-plugin.jar (C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins)
DEBUG [main] [ProductPluginManager]
--- Manifest entries for: jar:file:C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\system-plugin.jar!/ ---
Implementation-Title - Hyperic HQ Plugin - System Plugin
Implementation-Version - 4.6.5
Implementation-Vendor-Id - org.hyperic.hq.plugin
Build-Jdk - 1.6.0_29
Built-By - bob
Manifest-Version - 1.0
Specification-Title - HQ Plugin
Created-By - Apache Maven
Specification-Version - 4.6.5
Build-Date - 20120301-1052
Archiver-Version - Plexus Archiver
DEBUG [main] [SystemPlugin] sigar.mirror.procnet=null
DEBUG [main] [PluginDiscoverer] Adding Auto Scanners=[ServerSignature {stName=Java 1.5.x, match=[null], exclude=[null], regMatch=[null]}, ServerSignature {stName=Java 1.6.x, match=[null], exclude=[null], regMatch=[null]}]
DEBUG [main] [PluginDiscoverer] Adding Registry Scanners=[]
DEBUG [Thread-1] [NullScan] Running AutoServerDetector for: Java 1.5.x
DEBUG [Thread-1] [MxServerDetector] ptql=State.Name.sw=java,Args.*.sw=-Dproc.java.home= matched pids=[[J@12b6c89]
DEBUG [Thread-1] [MxServerDetector] C:\Oracle\Middleware\jdk160_24\jre\lib\fontconfig.Sun.2003.bfc does not exist, skipping
DEBUG [Thread-1] [NullScan] Running AutoServerDetector for: Java 1.6.x
DEBUG [Thread-1] [MxServerDetector] ptql=State.Name.sw=java,Args.*.sw=-Dproc.java.home= matched pids=[[J@e53220]
DEBUG [Thread-1] [MxServerDetector] classpath unchanged using: C:\Oracle\Middleware\jdk160_24
DEBUG [Thread-1] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [Thread-1] [MxServerDetector] Using the local pid to create jmx url: ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24
DEBUG [Thread-1] [WindowsRegistryScan] Windows Registry Scan starting...
DEBUG [Thread-1] [WindowsRegistryScan] Windows Registry Scan completed, took: 0
1 servers detected
Server: CH30-0FRNC59 Java 1.6.x [C:\Oracle\Middleware\jdk160_24]
AIID.....C:\Oracle\Middleware\jdk160_24
config...
product..jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,
metric...
control..null
DEBUG [main] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [main] [MxUtil] created new JMXConnector url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=, classloader=sun.misc.Launcher$AppClassLoader@17182c1
Java 1.6.x Loaded Class Count:
java.lang:type=ClassLoading:LoadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(1086.0) -> 1,086.0
=>1,086.0<=
Java 1.6.x Total Loaded Class Count:
java.lang:type=ClassLoading:TotalLoadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(1086.0) -> 1,086.0
=>1,086.0<=
Java 1.6.x Unloaded Class Count:
java.lang:type=ClassLoading:UnloadedClassCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
Java 1.6.x Total Compilation Time:
java.lang:type=Compilation:TotalCompilationTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(102.0) -> 102ms
=>102ms<=
Java 1.6.x Thread Count:
java.lang:type=Threading:ThreadCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(17.0) -> 17.0
=>17.0<=
Java 1.6.x Daemon Thread Count:
java.lang:type=Threading:DaemonThreadCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(16.0) -> 16.0
=>16.0<=
DEBUG [main] [PluginDiscoverer] Runtime discover for CH30-0FRNC59 Java 1.6.x, config=jmx.username=,jmx.password=******,jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,log=debug,installpath=C:\Oracle\Middleware\jdk160_24,
DEBUG [main] [ProductPluginManager] No ProductPlugin found for: Java 1.6.x
DEBUG [main] [MxServerDetector] [discoverServices] serverConfig=platform.log_track.level=Warn,jmx.username=,platform.log_track.enable=true,jmx.password=******,platform.config_track.enable=true,log=debug,installpath=C:\Oracle\Middleware\jdk160_24,platform.fqdn=CH30-0FRNC59.euc.nestle.com,platform.type=Win32,platform.ip=127.0.0.1,platform.name=localhost,platform.log_track.eventlogs=System,jmx.url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24,
DEBUG [main] [MxUtil] ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24 resolved to vmid=7960, jmx.url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=
DEBUG [main] [MxUtil] created new JMXConnector url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDEwLjYwLjE2MC40NgAA5W6mztbP3rJ3QmqDpA4AAAE3QdfsrYACAHg=, classloader=sun.misc.Launcher$AppClassLoader@17182c1
DEBUG [main] [MxServerDetector] [discoverMxServices] url=ptql:State.Name.sw=java,Args.*.eq=-Dproc.java.home=C:\Oracle\Middleware\jdk160_24
DEBUG [main] [MxServerDetector] [discoverMxServices] objName=java.lang:type=Threading
DEBUG [main] [MxServerDetector] [discoverMxServices] objName=java.lang:type=Threading
DEBUG [main] [MxServerQuery] [findServices] servicePlugins={Java 1.6.x Java GC=null}
DEBUG [main] [MxServerQuery] [findServices] name=java.lang:type=GarbageCollector,*
DEBUG [main] [MxServerQuery] [findServices] services=(2)[java.lang:type=GarbageCollector,name=Copy, java.lang:type=GarbageCollector,name=MarkSweepCompact]
DEBUG [main] [MxServerDetector] discovered 2 services
DEBUG [main] [ProductPluginManager] No ControlPlugin found for: Java 1.6.x Java GC
DEBUG [main] [ProductPluginManager] No ControlPlugin found for: Java 1.6.x Java GC
DEBUG [main] [MxServerDetector] discovered 2 services
Runtime Resource Report...
Platform=Win32, fqdn=CH30-0FRNC59.euc.nestle.com (Microsoft Windows 2008)
config...
product..null
metric...platform.log_track.level=Warn,platform.log_track.eventlogs=System,platform.log_track.enable=true,platform.config_track.enable=true,
control..null
cprops...cpuSpeed=4 @ 2394 MHz,secondaryDNS=160.213.132.241,defaultGateway=0.0.0.0,arch=x86,ram=2992 MB,vendor=Microsoft,vendorVersion=2008,primaryDNS=160.213.132.237,ip=10.60.160.46,version=6.0,
CH30-0FRNC59 Java 1.6.x cprops:
CH30-0FRNC59 Java 1.6.x services:
CH30-0FRNC59 Java 1.6.x Copy Java GC
config...
product..name=Copy,
metric...
control..null
rt.......null
Java 1.6.x Java GC Collection Count:
java.lang:type=GarbageCollector,name=Copy:CollectionCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(8.0) -> 8.0
=>8.0<=
Java 1.6.x Java GC Collection Time:
java.lang:type=GarbageCollector,name=Copy:CollectionTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(12.0) -> 12.0
=>12.0<=
CH30-0FRNC59 Java 1.6.x MarkSweepCompact Java GC
config...
product..name=MarkSweepCompact,
metric...
control..null
rt.......null
Java 1.6.x Java GC Collection Count:
java.lang:type=GarbageCollector,name=MarkSweepCompact:CollectionCount:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
Java 1.6.x Java GC Collection Time:
java.lang:type=GarbageCollector,name=MarkSweepCompact:CollectionTime:jmx.url=ptql%3AState.Name.sw%3Djava%2CArgs.*.eq%3D-Dproc.java.home%3DC%3A\Oracle\Middleware\jdk160_24,jmx.username=%jmx.username%,jmx.password=
DEBUG [main] [UnitsFormat] format(0.0) -> 0.0
=>0.0<=
C:\Oracle\Middleware\jdk160_24\bin>
Labels:
hyperic
You don't need shoes
all so true!
I have started walking and biking barefoot and it's a LOT better....I have also a maltracking patella and plenty of problems in my legs, and walking barefoot on grass is the best possible physiotherapy.
Think about it. My father's generation - as all the earlier generations since the origin of time - would almost NEVER wear shoes. Shoes are a relatively recent invention, like the combustion engine, and it creates more problems than it solves - just like the combustion engine (of, if you believe that 6 degrees more for average Earth temperature, due to excessive CO2 and methane from combustion engines and heating, is not a problem, wait and see year 2100, when few survivors will have to live in caves to escape from the fury of hurricanes and 500 Km/h winds).
Don't fool with the Crows
today I was biking in the woods along the lake, and I heard a crow caw... caw! caw! caw!
As I often do, I played the mocking bird and I replied "caw! caw! caw!".
Well, the crow didn't like that. Seconds after, I felt the crow banging on my bald head at full speed with his claws. It hurt a little, but it didn't bleed.
So.... don't fool with crows, they don't have much sense of humour!
As I often do, I played the mocking bird and I replied "caw! caw! caw!".
Well, the crow didn't like that. Seconds after, I felt the crow banging on my bald head at full speed with his claws. It hurt a little, but it didn't bleed.
So.... don't fool with crows, they don't have much sense of humour!
Hyperic plugin software factory
After many errors and botch-ups, I am persuaded that the best way to develop a plugin is:
a C:\pierre\workspace\HypericAutomation\plugins where to keep in SVN the plugin xml
a C:\pierre\workspace\HypericAutomation\scripts with:
copyAllPlugins.bat:
stopall.bat
startall.bat
and the sequence is:
edit the plugin
stopapp
copyAllPlugins
startall
this because I have the impression that the agent plugin get overwritten when you restart the server
Also, make sure you shutdown and restart your monitored applications whenever your IP address is changed (if you are on DHCP) !
a C:\pierre\workspace\HypericAutomation\plugins where to keep in SVN the plugin xml
a C:\pierre\workspace\HypericAutomation\scripts with:
copyAllPlugins.bat:
copy ..\plugins\*-plugin.xml C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins\ copy ..\plugins\*-plugin.xml C:\pierre\hypericserver\server-4.6.5-EE\hq-engine\hq-server\webapps\ROOT\WEB-INF\hq-plugins
stopall.bat
cd C:\pierre\hypericagent\agent-4.6.5-EE\bin call C:\pierre\hypericagent\agent-4.6.5-EE\bin\hq-agent.bat stop cd C:\pierre\hypericserver\server-4.6.5-EE\bin call C:\pierre\hypericserver\server-4.6.5-EE\bin\hq-server.bat stop
startall.bat
cd C:\pierre\hypericagent\agent-4.6.5-EE\bin call C:\pierre\hypericagent\agent-4.6.5-EE\bin\hq-agent.bat start cd C:\pierre\hypericserver\server-4.6.5-EE\bin call C:\pierre\hypericserver\server-4.6.5-EE\bin\hq-server.bat start
and the sequence is:
edit the plugin
stopapp
copyAllPlugins
startall
this because I have the impression that the agent plugin get overwritten when you restart the server
Also, make sure you shutdown and restart your monitored applications whenever your IP address is changed (if you are on DHCP) !
Labels:
hyperic
Saturday, May 12, 2012
SOAPUI, OSB, WSDL and FrontEnd address and port
(guest post, thanks Luis Verge (vergegon pisellon!) Gonzales for this)
Yesterday while using SOAPUI for defining some projects for testing I saw that if I try to use the dynamic?WSDL address I got an error as described below:
1st. Open the Internet explorer and type the address of your WSDL:
http://10.56.5.192:8105/SSS_GetUsers/ProxyServices/GetUsers_PS?wsdl
Then you will see the wsdl and the soap address (HINT: where does that 9980 port come from???):
If you create a SOAPUI project and you use the dynamic address:
(notice: port is 8105, not 9980!)
Your process will remain running trying to solve the address:
(notice again the 9980!)
If you see the previous image you will notice something estrange, the port you were using 8105 is now 9980. Your first question is why?
The response is given in the weblogic configuration, in the cluster configuration and to be more precise: in the HTTP cluster configuration (see image below)
it't the FRONTEND HTTP PORT!!!
If you read the explanation in oracle documentation:
http://docs.oracle.com/cd/E12840_01/wls/docs103/webserv/setenv.html#wp220521
and in middleware magic:
http://middlewaremagic.com/weblogic/?p=1938
You will understand how it works.
Apparently, in our current configuration (with network proxies) when we try to use a dynamic address , we don’t get it because is redirecting it to the frontend port and address defined in the cluster.
Normally in that part of the weblogic configuration we should have the loadbalancer address, but unfortunately we have none in dev.
I was wondering on using as the default port in the frontend configuration in the cluster the port 8105, so every request not solved will be redirected to 8105.
That change will require a restart.
Yesterday while using SOAPUI for defining some projects for testing I saw that if I try to use the dynamic?WSDL address I got an error as described below:
1st. Open the Internet explorer and type the address of your WSDL:
http://10.56.5.192:8105/SSS_GetUsers/ProxyServices/GetUsers_PS?wsdl
Then you will see the wsdl and the soap address (HINT: where does that 9980 port come from???):
If you create a SOAPUI project and you use the dynamic address:
(notice: port is 8105, not 9980!)
Your process will remain running trying to solve the address:
(notice again the 9980!)
If you see the previous image you will notice something estrange, the port you were using 8105 is now 9980. Your first question is why?
The response is given in the weblogic configuration, in the cluster configuration and to be more precise: in the HTTP cluster configuration (see image below)
it't the FRONTEND HTTP PORT!!!
If you read the explanation in oracle documentation:
http://docs.oracle.com/cd/E12840_01/wls/docs103/webserv/setenv.html#wp220521
and in middleware magic:
http://middlewaremagic.com/weblogic/?p=1938
You will understand how it works.
Apparently, in our current configuration (with network proxies) when we try to use a dynamic address , we don’t get it because is redirecting it to the frontend port and address defined in the cluster.
Normally in that part of the weblogic configuration we should have the loadbalancer address, but unfortunately we have none in dev.
I was wondering on using as the default port in the frontend configuration in the cluster the port 8105, so every request not solved will be redirected to 8105.
That change will require a restart.
Hyperic Plugin HowTo
http://support.hyperic.com/display/hyperforge/Deploying+Plugins+-+Basic+How+To
you must deploy the plugin on both the server and agent side
server and agent:
Windows
C:\pierre\hypericserver\server-4.6.5-EE\hq-engine\hq-server\webapps\ROOT\WEB-INF\hq-plugins
c:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins
Linux
/opt/hyperic/server/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/hq-plugins
/opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/plugins
http://support.hyperic.com/display/DOCS46/JMX+Plugin+Tutorial
see immediately this for help http://communities.vmware.com/message/1939306
"I tried running the commands with the argument -Dproc.java.home= and it is able to match the processes running."
(of course Hyperic documentation make a lot of blablabla but they forget to tell you clearly how to set each property, and leave to you the reverse engineering of their product...)
this is a SERVER plugin ("Java"), exposing SERVICES ("Java GC")
Here how to get the HQ source code:
svn co http://svn.hyperic.org/projects/hq/trunk hyperic-hq
How to have SIGAR discover a WebLogic server:
ps State.Name.eq=java,CredName.User.eq=soa,Args.*.ct=-Dweblogic.Name=osbpp1ms1
where osbpp1ms1 is the server name
you must deploy the plugin on both the server and agent side
server and agent:
Windows
C:\pierre\hypericserver\server-4.6.5-EE\hq-engine\hq-server\webapps\ROOT\WEB-INF\hq-plugins
c:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\plugins
Linux
/opt/hyperic/server/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/hq-plugins
/opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/plugins
http://support.hyperic.com/display/DOCS46/JMX+Plugin+Tutorial
see immediately this for help http://communities.vmware.com/message/1939306
"I tried running the commands with the argument -Dproc.java.home=
(of course Hyperic documentation make a lot of blablabla but they forget to tell you clearly how to set each property, and leave to you the reverse engineering of their product...)
this is a SERVER plugin ("Java"), exposing SERVICES ("Java GC")
Here how to get the HQ source code:
svn co http://svn.hyperic.org/projects/hq/trunk hyperic-hq
How to have SIGAR discover a WebLogic server:
ps State.Name.eq=java,CredName.User.eq=soa,Args.*.ct=-Dweblogic.Name=osbpp1ms1
where osbpp1ms1 is the server name
Labels:
hyperic
Jconsole fails with "Remote thread failed for unknown reason"
"VMPanel.connect" java.lang.InternalError: Remote thread failed for unknown reason
This happens if you run JConsole by double clicking on it, rather than running from a DOC prompt- on Windows Vista.
Yes, I have to use Windows Vista because this is a company laptop. You can laugh at me, laughing makes good blood as we say in Italy.
This happens if you run JConsole by double clicking on it, rather than running from a DOC prompt- on Windows Vista.
Yes, I have to use Windows Vista because this is a company laptop. You can laugh at me, laughing makes good blood as we say in Italy.
Hyperic on Oracle DB
http://support.hyperic.com/display/DOC/Set+Up+Oracle
(full DDL to create tablespaces at the bottom of the above document....)
create temporary tablespace TEMP_HQDB
tempfile 'TEMP_HQDB.DBF' size 2G extent management local;
this will create a file
C:\oraclexe\app\oracle\product\10.2.0\server\database\TEMP_HQDB.DBF
create tablespace TS_HQDB logging datafile 'TS_HQDB.dbf' size 3g extent management local;
this will create a file
C:\oraclexe\app\oracle\product\10.2.0\server\database\TS_HQDB.DBF
This could take several minutes.
CREATE USER HQUSER IDENTIFIED BY HQPASSWORD DEFAULT TABLESPACE TS_HQDB;
GRANT CONNECT, RESOURCE, CREATE VIEW TO HQUSER;
copy ojdbc6.jar to the installer (what? you need to reinstall Hyperic Server to switch to Oracle DB? Oh no :o(((( ....)
(full DDL to create tablespaces at the bottom of the above document....)
create temporary tablespace TEMP_HQDB
tempfile 'TEMP_HQDB.DBF' size 2G extent management local;
this will create a file
C:\oraclexe\app\oracle\product\10.2.0\server\database\TEMP_HQDB.DBF
create tablespace TS_HQDB logging datafile 'TS_HQDB.dbf' size 3g extent management local;
this will create a file
C:\oraclexe\app\oracle\product\10.2.0\server\database\TS_HQDB.DBF
This could take several minutes.
CREATE USER HQUSER IDENTIFIED BY HQPASSWORD DEFAULT TABLESPACE TS_HQDB;
GRANT CONNECT, RESOURCE, CREATE VIEW TO HQUSER;
copy ojdbc6.jar to the installer (what? you need to reinstall Hyperic Server to switch to Oracle DB? Oh no :o(((( ....)
Labels:
hyperic
Oracle DB: check constraints enumeration
Traditionally, if you want to restrict the values allowed for a column, you use a foreign key to a reference column in another table.
This can be quite boring, and lead to a proliferation of reference tables.
A simple alternative is using ENUM
CHECK (col1 IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday', 'Sunday')
SQL developer supports this in the "check constraints", just create a constraint and type MYCOLUMNNAME IN ('Monday', 'Tuesday')
This can be quite boring, and lead to a proliferation of reference tables.
A simple alternative is using ENUM
CHECK (col1 IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday', 'Sunday')
SQL developer supports this in the "check constraints", just create a constraint and type MYCOLUMNNAME IN ('Monday', 'Tuesday')
Labels:
oracledb
Friday, May 11, 2012
Hyperic JMX Plugin tutorial
this presentation is a bit fuzzy
Notable classes:
MxServerDetector
MxNotificationPlugin
MBeanServer
This one is a lot better (although video quality sucks, too many skipped frames) on how to query JMX Mbeans in the Hyperic console. I wish the sample code was attached.
Notable classes:
MxServerDetector
MxNotificationPlugin
MBeanServer
This one is a lot better (although video quality sucks, too many skipped frames) on how to query JMX Mbeans in the Hyperic console. I wish the sample code was attached.
Labels:
hyperic
Getting Service Name from SID in Oracle DB
select sys_context('userenv','service_name') from dual
select sys_context('userenv','instance_name') from dual
to get all available service_name s: (needs privileged access)
select value from v$parameter where name = 'service_names';
for more info on the sys_context, read here
select sys_context('userenv','instance_name') from dual
to get all available service_name s: (needs privileged access)
select value from v$parameter where name = 'service_names';
for more info on the sys_context, read here
Labels:
oracledb
OSB sending emails
Just reblogging 3 excellent articles by Chris Thomkins
https://blogs.oracle.com/christomkins/entry/sending_an_email_from_oracle_s
https://blogs.oracle.com/christomkins/entry/sending_an_email_from_aqualogi
https://blogs.oracle.com/christomkins/entry/sending_an_email_with_an_attac
too bad that his blog is not active any more... all the best things in life seem to last very little...
https://blogs.oracle.com/christomkins/entry/sending_an_email_from_oracle_s
https://blogs.oracle.com/christomkins/entry/sending_an_email_from_aqualogi
https://blogs.oracle.com/christomkins/entry/sending_an_email_with_an_attac
too bad that his blog is not active any more... all the best things in life seem to last very little...
Thursday, May 10, 2012
Hyperic, GridLink and JDBCConnectionPoolRuntime
DataSource=SOADataSource
Host Server="Weblogic 10.3 osbpp1do osbpp1ms1" (osbpp1do=wldomain, osbpp1ms1=wlserver)
Resource Type="Weblogic 10.3 JDBC Connection Pool"
jdbc.conn=SOADataSource
JDBC URL=jdbc:oracle:thin:@mydbserver.acme.com:1551:osbdb1
JDBC Driver Name : oracle.jdbc.OracleDriver
MBean as constructed by Hyperic:
'osbpp1do:Location=osbpp1ms1,ServerRuntime=osbpp1ms1,Name=SOADataSource2,Type=JDBCConnectionPoolRuntime,ApplicationRuntime=SOADataSource1'
Name=SOADataSource2 is the content of jdbc.conn (JDBC Connection Pool name)
ApplicationRuntime=SOADataSource1 is the content of application (Application name)
application must be at least 1 characters long
java weblogic.Admin -url t3://myserver:8001 -username weblogic -password weblogic1 GET -pretty -type JDBCConnectionPoolRuntime
osbpp1do:ServerRuntime=osbpp1ms1,Name=ACMEDataSource,Type=JDBCConnectionPoolRuntime,Location=osbpp1ms1
SOADataSource has a JDBCOracleDataSourceRuntime
(wls:/osbpp1do/serverRuntime/JDBCServiceRuntime/osbpp1ms1/JDBCDataSourceRuntimeMBeans/SOADataSource)
GridLink stuff is a
JDBCOracleDataSourceRuntime extends JDBCDataSourceRuntime which extends a ComponentRuntime
while a Generic DataSource is a JDBCDataSourceRuntime extends ComponentRuntime
so... I am afraid you can't monitor GridLink Datasources with Hyperic OOTB, using a traditional prototype "Weblogic 10.3 JDBC Connection Pool": you need to write a custom JMX plugin for that.
Host Server="Weblogic 10.3 osbpp1do osbpp1ms1" (osbpp1do=wldomain, osbpp1ms1=wlserver)
Resource Type="Weblogic 10.3 JDBC Connection Pool"
jdbc.conn=SOADataSource
JDBC URL=jdbc:oracle:thin:@mydbserver.acme.com:1551:osbdb1
JDBC Driver Name : oracle.jdbc.OracleDriver
MBean as constructed by Hyperic:
'osbpp1do:Location=osbpp1ms1,ServerRuntime=osbpp1ms1,Name=SOADataSource2,Type=JDBCConnectionPoolRuntime,ApplicationRuntime=SOADataSource1'
Name=SOADataSource2 is the content of jdbc.conn (JDBC Connection Pool name)
ApplicationRuntime=SOADataSource1 is the content of application (Application name)
application must be at least 1 characters long
java weblogic.Admin -url t3://myserver:8001 -username weblogic -password weblogic1 GET -pretty -type JDBCConnectionPoolRuntime
osbpp1do:ServerRuntime=osbpp1ms1,Name=ACMEDataSource,Type=JDBCConnectionPoolRuntime,Location=osbpp1ms1
SOADataSource has a JDBCOracleDataSourceRuntime
(wls:/osbpp1do/serverRuntime/JDBCServiceRuntime/osbpp1ms1/JDBCDataSourceRuntimeMBeans/SOADataSource)
GridLink stuff is a
JDBCOracleDataSourceRuntime extends JDBCDataSourceRuntime which extends a ComponentRuntime
while a Generic DataSource is a JDBCDataSourceRuntime extends ComponentRuntime
so... I am afraid you can't monitor GridLink Datasources with Hyperic OOTB, using a traditional prototype "Weblogic 10.3 JDBC Connection Pool": you need to write a custom JMX plugin for that.
Labels:
hyperic
Wednesday, May 9, 2012
Hyperic SIGAR PTQL (Process Table Query Language)
java -jar /opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/lib/sigar-1.6.4.jar
to find a WebLogic process:
ps State.Name.eq=java,CredName.User.eq=soa,Args.*.ct=-Dweblogic.Name=osbdv2ms1
to find all processes:
ps
to find all Java processes:
ps State.Name.eq=java
sigar> ps State.Name.eq=java
6300 pvernet 09:08 1.2G 81M - R 0:15 java:weblogic.Server
9512 ??? ??? 340M 107M - R ??? java
7728 ??? ??? 311M 42M - R ??? java
4784 ??? ??? 908M 325M - R ??? java
4512 pvernet 10:30 262M 18M - R 0:1 java:org.hyperic.sigar.cmd.Runner
you can do ps 6300
sigar> ps 6300
6300 pvernet 09:08 1.2G 82M - R 0:15 java:weblogic.Server
Official doc of Process Table Query Language
SIGAR doc (SIGAR=System Information Gatherer)
You even have a SIGAR API
to find a WebLogic process:
ps State.Name.eq=java,CredName.User.eq=soa,Args.*.ct=-Dweblogic.Name=osbdv2ms1
to find all processes:
ps
to find all Java processes:
ps State.Name.eq=java
sigar> ps State.Name.eq=java
6300 pvernet 09:08 1.2G 81M - R 0:15 java:weblogic.Server
9512 ??? ??? 340M 107M - R ??? java
7728 ??? ??? 311M 42M - R ??? java
4784 ??? ??? 908M 325M - R ??? java
4512 pvernet 10:30 262M 18M - R 0:1 java:org.hyperic.sigar.cmd.Runner
you can do ps 6300
sigar> ps 6300
6300 pvernet 09:08 1.2G 82M - R 0:15 java:weblogic.Server
Official doc of Process Table Query Language
SIGAR doc (SIGAR=System Information Gatherer)
You even have a SIGAR API
Monday, May 7, 2012
Hyperic, Anatomy of a JMX plugin
http://support.hyperic.com/display/DOC/JMX+Plugin
http://support.hyperic.com/display/DOC/JMX+Plugin+Tutorial
More modern (for 4.6.5):
http://support.hyperic.com/display/EVO/JMX+Plugin
java -Duser=weblogic -Dpass=weblogic1 -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:rmi:///jndi/rmi://myhost:8888/jmxrmi
(8888 is the remote jmx port)
java -Duser=weblogic -Dpass=weblogic1 -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
(8001 is the listen port of the WLS)
you will get:
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
so you will add -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
and a we have this:
java -cp C:\Oracle\Middleware\wlserver_10.3\server\lib\wlfullclient.jar -Duser=weblogic -Dpass=weblogic1 -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
but adding the wlfullclient.jar is not enough, because the classpath is set in the MANIFEST.MF of the hq-pdk-4.6.5.jar:
all those classes are in
C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib
I copy there the wlfullclient.jar
and I run
java -cp "C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\*" -Duser=weblogic -Dpass=weblogic1 -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Dplugins.include=jmx org.hyperic.hq.product.util.PluginMain jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
and I get
Were on earth is this "t3://localhost:7001" ? crap!!!
First, enable your Java process to be monitored by remote jmx (see help name="Java" at the end of the myfirstplugin.xml plugin below)
take this file myfirstplugin.xml and put it into $HQ_AGENT_HOME/pdk/plugins
(like /opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/plugins)
and adjust the localhost:6969 bit:
restart the agent:
./hq-agent.sh restart
http://support.hyperic.com/display/DOC/JMX+Plugin+Tutorial
More modern (for 4.6.5):
http://support.hyperic.com/display/EVO/JMX+Plugin
java -Duser=weblogic -Dpass=weblogic1 -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:rmi:///jndi/rmi://myhost:8888/jmxrmi
(8888 is the remote jmx port)
java -Duser=weblogic -Dpass=weblogic1 -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
(8001 is the listen port of the WLS)
you will get:
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
so you will add -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
and a we have this:
java -cp C:\Oracle\Middleware\wlserver_10.3\server\lib\wlfullclient.jar -Duser=weblogic -Dpass=weblogic1 -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Dplugins.include=jmx -jar C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\hq-pdk-4.6.5.jar jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
but adding the wlfullclient.jar is not enough, because the classpath is set in the MANIFEST.MF of the hq-pdk-4.6.5.jar:
Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: bob Build-Jdk: 1.6.0_29 Main-Class: org.hyperic.hq.product.util.PluginMain Class-Path: hq-common-4.6.5.jar hq-util-4.6.5.jar commons-logging-1.0. 4.jar httpclient-4.1.1.jar httpcore-4.1.jar commons-codec-1.4.jar com mons-validator-1.3.1.jar commons-beanutils-1.7.0.jar commons-digester -1.6.jar commons-collections-2.1.1.jar xml-apis-1.3.04.jar jsch-0.1.4 2.jar log4j-1.2.14.jar velocity-1.6.3.jar commons-lang-2.4.jar oro-2. 0.8.jar sigar-1.6.4.jar jdom-1.1.jar spring-beans-3.0.5.RELEASE.jar s pring-asm-3.0.5.RELEASE.jar spring-context-3.0.5.RELEASE.jar spring-a op-3.0.5.RELEASE.jar aopalliance-1.0.jar spring-expression-3.0.5.RELE ASE.jar org.springframework.roo.file.monitor-1.0.2.RELEASE.jar org.sp ringframework.roo.support-1.0.2.RELEASE.jar org.springframework.roo.f ile.monitor.polling-1.0.2.RELEASE.jar wrapper-3.5.6.jar xstream-1.3.1 .jar xpp3_min-1.1.4c.jar hibernate-3.2.6.ga.jar asm-attrs-1.5.3.jar d om4j-1.6.1.jar antlr-2.7.6.jar cglib-2.1_3.jar asm-1.5.3.jar spring-t x-3.0.5.RELEASE.jar jboss-remoting-2.2.2.SP8.jar jboss-common-logging -spi-2.0.4.GA.jar hq-lather-4.6.5.jar backport-util-concurrent-3.1.ja r getopt-1.0.13.jar geronimo-j2ee-management_1.0_spec-1.1.jar snmp4j- 1.11.jar xalan-2.7.1.jar serializer-2.7.1.jar cm-file-monitor-1.0.1.j ar cm-versioncontrol-1.0.1.jar slf4j-log4j12-1.6.1.jar slf4j-api-1.6. 1.jar jcl-over-slf4j-1.6.1.jar org.eclipse.jgit-1.0.0.201106090707-r. jar org.eclipse.jgit.junit-1.0.0.201106090707-r.jar spring-oxm-3.0.5. RELEASE.jar jpathwatch-0-94.jar jaxb-api-2.1.jar stax-api-1.0-2.jar a ctivation-1.1.jar jaxb-impl-2.1.3.jar
all those classes are in
C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib
I copy there the wlfullclient.jar
and I run
java -cp "C:\pierre\hypericagent\agent-4.6.5-EE\bundles\agent-4.6.5\pdk\lib\*" -Duser=weblogic -Dpass=weblogic1 -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Dplugins.include=jmx org.hyperic.hq.product.util.PluginMain jmx MBeanDumper service:jmx:iiop://myhost:8001/jndi/weblogic.management.mbeanservers.runtime
and I get
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root ex ception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is: java.net.ConnectException: Connection refused: connect; No available router to destination] at javax.management.remote.rmi.RMIConnector.connect(Unknown Source) at javax.management.remote.JMXConnectorFactory.connect(Unknown Source) at org.hyperic.hq.product.jmx.MxUtil.getMBeanConnector(MxUtil.java:538) at org.hyperic.hq.product.jmx.MxUtil.connect(MxUtil.java:564) at org.hyperic.hq.product.jmx.MxUtil.getMBeanServer(MxUtil.java:621) at org.hyperic.hq.product.jmx.MBeanDumper.getMBeanServer(MBeanDumper.java:138) at org.hyperic.hq.product.jmx.MBeanDumper.dump(MBeanDumper.java:164) at org.hyperic.hq.product.jmx.MBeanDumper.dump(MBeanDumper.java:160) at org.hyperic.hq.product.jmx.MBeanDumper.main(MBeanDumper.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.hyperic.hq.product.util.PluginMain.runMain(PluginMain.java:218) at org.hyperic.hq.product.util.PluginMain.main(PluginMain.java:317)
Were on earth is this "t3://localhost:7001" ? crap!!!
First, enable your Java process to be monitored by remote jmx (see help name="Java" at the end of the myfirstplugin.xml plugin below)
take this file myfirstplugin.xml and put it into $HQ_AGENT_HOME/pdk/plugins
(like /opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/plugins)
and adjust the localhost:6969 bit:
<?xml version="1.0"?> <!DOCTYPE plugin [<!ENTITY process-metrics SYSTEM "/pdk/plugins/process-metrics.xml">]> <plugin package="org.hyperic.hq.plugin.java"> <classpath> <include name="pdk/lib/mx4j"/> </classpath> <filter name="template" value="${OBJECT_NAME}:${alias}"/> <metrics name="Class Loading Metrics"> <metric name="Loaded Class Count" indicator="false" category="THROUGHPUT"/> <metric name="Total Loaded Class Count" indicator="false" category="THROUGHPUT"/> <metric name="Unloaded Class Count" indicator="false" category="THROUGHPUT"/> </metrics> <metrics name="Compilation"> <metric name="Total Compilation Time" indicator="false" category="THROUGHPUT" collectionType="trendsup" units="ms"/> </metrics> <metrics name="Garbage Collector"> <metric name="Collection Count" indicator="false" category="THROUGHPUT" collectionType="trendsup"/> <metric name="Collection Time" indicator="false" category="THROUGHPUT" collectionType="trendsup"/> </metrics> <metrics name="Memory"> <metric name="Object Pending Finalization Count" category="THROUGHPUT" indicator="false"/> </metrics> <metrics name="Threading"> <metric name="Thread Count" category="UTILIZATION" indicator="false"/> <metric name="Daemon Thread Count" category="UTILIZATION" indicator="false"/> </metrics> <server name="Java" version="1.5.x"> <property name="HAS_BUILTIN_SERVICES" value="true"/> <property name="VERSION_FILE" value="jre/lib/fontconfig.Sun.2003.bfc"/> <property name="DEFAULT_PROGRAM" value="bin/java"/> <property name="domain" value="Java"/> <config> <option name="jmx.url" description="JMX URL to MBeanServer" default="service:jmx:rmi:///jndi/rmi://localhost:6969/jmxrmi"/> <option name="jmx.username" description="JMX username" optional="true" default=""/> <option name="jmx.password" description="JMX password" optional="true" default="" type="secret"/> <option name="process.query" description="PTQL for Java Process" default="State.Name.eq=java,Args.*.ct=proc.java.home"/> </config> <metric name="Availability" template="sigar:Type=ProcState,Arg=%process.query%:State" indicator="true"/> &process-metrics; <property name="OBJECT_NAME" value="java.lang:type=ClassLoading"/> <metrics include="Class Loading Metrics"/> <property name="OBJECT_NAME" value="java.lang:type=Compilation"/> <metrics include="Compilation"/> <property name="OBJECT_NAME" value="java.lang:type=Memory"/> <plugin type="log_track" class="org.hyperic.hq.product.jmx.MxNotificationPlugin"/> <property name="OBJECT_NAME" value="java.lang:type=Threading"/> <metrics include="Threading"/> <!-- derive installpath from JAVA_HOME env prop... --> <property name="PROC_HOME_ENV" value="JAVA_HOME"/> <!-- derive installpath from -Dproc.java.home=... --> <property name="PROC_HOME_PROPERTY" value="proc.java.home"/> <plugin type="autoinventory" class="org.hyperic.hq.product.jmx.MxServerDetector"/> <plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/> <service name="Java GC"> <plugin type="autoinventory"/> <property name="OBJECT_NAME" value="java.lang:type=GarbageCollector,name=*"/> <metrics include="Garbage Collector"/> </service> </server> <server name="Java" version="1.6.x" include="1.5.x"> <property name="VERSION_FILE" value="jre/lib/management-agent.jar"/> </server> <!-- ==================== Plugin Help =========================== --> <help name="Java"> <![CDATA[ <p> <h3>Configure HQ for monitoring Java</h3> </p> <p> 1) Add this line to the java options when executing the binary. <br> "-Dcom.sun.management.jmxremote \ <br> -Dcom.sun.management.jmxremote.port=6969 \ <br> -Dcom.sun.management.jmxremote.ssl=false \ <br> -Dcom.sun.management.jmxremote.authenticate=false" <br> </p> ]]> </help> <help name="Java 1.5.x" include="Java"/> <help name="Java 1.6.x" include="Java"/> </plugin>
restart the agent:
./hq-agent.sh restart
Labels:
hyperic
Subscribe to:
Posts (Atom)