Table of Contents |
---|
Starting Situation
- Depending on the license model customers of a Commercial License are obliged to perform license measurement activities on a regular basis.
- The cmdlet
Get-JobSchedulerInventory
helps to keep track of JobScheduler Master and Agent instances in a network.- The JobScheduler Master instances are specified manually by the user.
- The JobScheduler Agent instances are discovered automatically from the JobScheduler Master instances.
Use Cases
Count licenses for a JobScheduler Master instance
The following sample shows how to create inventory information for license counting from a JobScheduler Master and respective Agents:
Code Block | ||||
---|---|---|---|---|
| ||||
Import-Module JobScheduler # Write the inventory information to the specified XML output file Get-JobSchedulerInventory http://localhost:4444 -OutputFile /tmp/inventory.xml # Append the inventory information to the specified XML output file Get-JobSchedulerInventory http://somehost:4444 -OutputFile /tmp/inventory.xml -Append # Append the inventory information and return the XML object $inventory = Get-JobSchedulerInventory http://localhost:4444 -OutputFile /tmp/inventory.xml -Append |
Explanations
- Line 4: The
Get-JobSchedulerInventory
cmdlet is used for the specified Master and writes the inventory information to the specified output file. - Line 7: The
Get-JobSchedulerInventory
cmdlet is used to append the inventory information for the specified Master to the specified output file. - Line 10: The
Get-JobSchedulerInventory
cmdlet is used to append the inventory information for the specified Master to the specified output file and to return the XML object.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="iso-8859-1"?> <Inventory> <Masters> <Master Id="scheduler110" Url="http://localhost:4444/" ProxyUrl="" Version="1.10.5" State="running" Pid="2832" RunningSince="2016-07-13T21:01:48Z" JobChainsExist="51" OrdersExist="32" JobsExist="121" TasksExist="0" TasksEnqueued="0" surveyCreated="2016-07-15T00:56:10Z"> <Agents> <Agent isTerminating="False" hostname="APMACWIN" currentTaskCount="0" startedAt="2016-07-13T21:01:52.591Z" version="1.10.5" totalTaskCount="0" Url="http://localhost:4445" MasterUrl="http://localhost:4444/" PSComputerName="localhost" RunspaceId="ec48894a-b518-4f30-a98d-814586cdb1cd" surveyCreated="2016-07-15T00:56:10Z" /> <Agent isTerminating="" hostname="" currentTaskCount="" startedAt="" version="" totalTaskCount="" Url="http://andreas-macbook-pro.local:4445" MasterUrl="http://localhost:4444/" PSComputerName="localhost" RunspaceId="343bcade-cec6-4f1b-ab93-a101ed54e5f5" surveyCreated="2016-07-15T00:56:10Z" /> <Agent isTerminating="" hostname="" currentTaskCount="" startedAt="" version="" totalTaskCount="" Url="http://wilma.sos:4445" MasterUrl="http://localhost:4444/" PSComputerName="localhost" RunspaceId="e9c5c335-d281-4f69-941d-30ead8d0ea4b" surveyCreated="2016-07-15T00:56:10Z" /> <Agent isTerminating="" hostname="" currentTaskCount="" startedAt="" version="" totalTaskCount="" Url="http://galadriel.sos:4110" MasterUrl="http://localhost:4444/" PSComputerName="localhost" RunspaceId="5e8415ef-7838-4459-bdb7-8d066eb04f96" surveyCreated="2016-07-15T00:56:10Z" /> </Agents> </Master> </Masters> </Inventory> |
Count licenses for a number of JobScheduler Master instances
The following sample shows how to create inventory information for license counting from a number of JobScheduler Master instances:
...