Package: dms-collector
$ dms-collectorDMS is a Weblogic Dynamic Monitoring Service providing a massive amount of sensors about Weblogic and application components performance.
It can be accessed in a number of ways, such as Weblogic Scripting Tool (wlst), Java API or DMS Spy application. DMS Spy is used to access DMS metric tables by using a browser while it also provides endpoints to retrieve metric tables in XML format.dms-collector is a Python utility that retrieves DMS metrics from Weblogic DMS Spy application. It provides an API to access DMS tables' data and a CLI to query the DMS and display the data in CSV.InstallationYou can install the dms-collector with pip as follows:pip install dms-collectorUsageYou can use dms-collector CLI to query the DMS Spy running athttps://wls-domainwith usernameweblogicand passwordpassword1by running the following command:$ dms-collector --url https://wls-domain --connect weblogic/password1 --table JVM_Memory
datetime,timezone,Host,Parent,ServerName,pendingFinalization_value,verbose_value,Process,JVM,Name
"22-01-12 11:23:30",+0100,"domain-3.oraclevnc.com","/JVM/MxBeans","AdminServer",0,"TRUE","AdminServer:7101","JVM","memory"
"22-01-12 11:23:30",+0100,"fmw-poc-app10.oraclevcn.com","/JVM/MxBeans","soa_server2",0,"TRUE","soa_server2:8102","JVM","memory"
"22-01-12 11:23:30",+0100,"fmw-poc-app10.oraclevcn.com","/JVM/MxBeans","proc15010",0,"FALSE","machine2:15010","JVM","memory"
"22-01-12 11:23:30",+0100,"domain-3.oraclevcn.com","/JVM/MxBeans","proc69725",0,"FALSE","machine1:69725","JVM","memory"CLI OptionsThere are many options that you can use to control, for example, a number of calls the CLI will run, a delay between calls, fields to be included or excluded or rows to be filtered out in the result.For the full list of options please rundms-collector --help.FilteringIf you want to exclude certain fields from the output, such asProcessandParent, run the following command:$ dms-collector --url https://wls-domain --connect weblogic/password1 --table JVM_Memory \
  --exclude Process,ParentIf you want to only return rows that match a certain criteria, such as a server name, run the following command:$ dms-collector --url https://wls-domain --connect weblogic/password1 --table JVM_Memory \
  --filter "bool(re.match(r\"WLS_SOA[0-9]+\",str(ServerName)))"The--filterparameter accepts any valid Python expression with variable names matching table's header names. You can use all header names regardless whether they are included or excluded from the output.Timestamp and TimezoneThe dms-collector CLI adds two columns to the CSV output, namelydatetimeandtimezone. This is the current local time when the data is retrieved from the DMS and changes with every iteration. You can change the field names for both columns by using--datetimefieldand--timezonefieldrespectively as well as remove them from the output by using--excludeoption.Delay TimeYou can specify a number of seconds the dms-collector CLI should wait between iterations by using--delayparameter. Since reading the data may in some situations take more time to finish, the delay time needs to be adjusted so that dms-collector always retrieves the data at the same time and the overall running time can be determined. The time adjustment is however disabled when the time to retrieve the DMS data takes more than 2/3 of the delay time. You can disable the delay time adjustment by using--nodelayadjustor change the 2/3 limit by--nodelayperc.Logindms-collector uses DMS Spy login form by default. If you are collecting data from a DMS Spy of an earlier version such as FMW infrastructure 11g, you need to use--basicauthoption which uses HTTP basic authentication.Changes over previous version 1.1The version 2.0+ introduces the following changes:It is now possible to usedms-collectoras a Python module which providesDmsCollector classthat you can integrate into your Python applications.Several command-line arguments were removed such as linux pipelines and emitting the events, DMS reset and time adjustments.You can still access the previous version in1.1 branch.Licensefree and free as a bird