Cool Solutions

Wanna read information from #ZENworks using REST?

jblackett

By:

September 5, 2018 3:42 am

Reads:327

Comments:0

Score:Unrated

Print/PDF

Greetings from Malaysia! This week I’ve been doing some more exploring with ZENworks Reporting in my hotel time and I found that there’s a great solution available for those of you who want to get some data programmatically for integration with some other application in your environment. ZENworks Reporting provides a REST interface that makes it easy to execute domain queries against anything that has a Domain available and responds with the data. This cool solution will show you how to do this.

To get started you need the following things:

  1. A ZENworks Reporting Server appliance connected to your ZENworks server.
  2. JasperStudio needs to be installed and configured to connect to your ZENworks Reporting Server. You can see how to do this in this cool solution.
  3. A tool for generating REST requests and reviewing the responses. In this Cool Solution, I’ll be using the free version of Insmonia.

Let’s get started:

  1. Build a tabular Adhoc View that has the data you want to get via REST. This isn’t a hard requirement, but its the easiest way to get the name of the Domain fields that you want to return and use for a filter. There have been several cool solutions that include information on how to do this, or check out this video. For this solution I created a report from the ZENworks Bundle domain that looks like this:

  2. Create a Report based on the Adhoc View. To do this simply choose to do a Save as and Create Reporting for the Adhoc Editor. This creates a JRXML report in the repository that we’ll need for the next step.
  3. Now fire up JasperStudio so that you can find out what fields were used in your report. You’ll need the field names and filter string to build the XML document you need to submit with your query.
    1. Start JasperStudio.
    2. Under servers, expand your server and browse to where you saved your report. You can see mine below, be sure to expand your report as shown:

    3. Right-click mainReport.xml, then click the Source tab at the bottom of the middle pane in JasperStudio. Find the Field list similar to what you see below:

    4. Make a note of the fields in a text file somewhere that correspond to the values you included in the report.
    5. Right-click and open the state.jrxml in the report.
    6. Find the filter expression string that corresponds to the filter you added in the adhoc view. Make a note it in your text file.

    7. Close the report files, you don’t need to do anything else in JasperStudio.
  4. Now write your REST query using the data you found in the report. Here’s I’ll use Insomnia as the REST client.
    1. Open up Insomnia.
    2. Create a New Request.
    3. Name the Request ZENworks Bundle List and select the type as POST.
    4. In the Body Type, select XML.
    5. Click Create.
    6. Next, you need to know the path to the Domain that you want to query in the ZENworks repository.  You can find this by opening the ZENworks Reporting console, finding the domain in the repository and then right-clicking and selecting Properties. It should show you something like the dialog below:

    7. In Insomnia enter the URL as shown below. Replace zenrpt.zendemo.com:8443 with your server and replace /Domains/ZENworks_Bundle_Domain with whatever domain you want to query. 

    8. Next, you need to enter the query that you want to make. For this you need to use the fields and filter data that you identified from JasperStudio earlier. The format is shown below:

    9. Click the Auth tab and select Basic Authentication. Specify a credential set that has permissions to login to ZENworks reporting as shown below:

    10. You now have everything you need to run the query, so click the Send button next to the URL.
  5. Depending on the data you asked for and the amount of data in the database it may take some time to retrieve the data. Once its completed, review the response that came back. You can see a sample below. The response is an XML file that describes the table.

  6. You could then have application logic that would parse this output as you see fit.

Using this method you can get any information available to any of the available domains, including the ZENworks Domain, ZENworks Bundle Domain, ZENworks Audit Domain, ZENworks Service Desk Domain or the Micro Focus Desktop Containers Server Usage Domain and use that data in your consuming application.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...

Tags: , , , ,
Categories: End-user How-to, Endpoint Security, IT Operations Management, Security, Technical, Unified Endpoint Management, ZENworks, ZENworks Asset Management, ZENworks Configuration Management, ZENworks Endpoint Security Management, ZENworks Full Disk Encryption, ZENworks Patch Management, ZENworks Reporting, ZENworks Suite

0

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS