In large-scale environments, you might experience lag in response times while using session relevance to create Web Reports apparently due to high workloads. Typically, multiple Web Reports servers are set up to distribute the load, but the priority order in which the servers should respond to the queries was not configurable. With the feature described in this article however, you can determine the priority order BigFix needs to use to contact the Web Reports Servers, thereby exercising more granular control over the workload and which will result in an improved overall performance.
BigFix 10 introduces a new property for Web Reports servers called the server Priority which can be any positive integer from 0 to 254 - the higher the value set for a Web Reports server, the higher its priority. When a session relevance is called, the server with the highest priority becomes the first target. In case this server is unavailable, the request automatically gets passed on to another server with the second highest priority and so on and so forth.
How do you then check and manage the priorities of Web Reports servers? That’s easy – you now have two new REST APIs that can do the work for you - one to retrieve server details and the other one to set the priority of a selected server. You will find more details in the following sections.
GET REST API for server details
/api/webreports/details
With this API, you can retrieve information about the entire set of Web Reports servers connected to the BigFix server. The API response contains the information as shown in the following picture:
- Web Reports ID. The ID of a Web Reports server. Each server is identified by a unique ID with which you can reference a Web Reports server in an easy and distinctive way. These IDs are generated automatically every time a new Web Reports server is created.
- Web Reports Priority. The priority of a WebReports server. If the priority has never changed, the value defaults to 0. To change the default value, use the PUT REST API which is discussed in the following section.
- URL. The URL of the Web Reports server.
PUT REST API for server priority
/api/webreports/{id}
With the PUT REST API, you can modify the priority of a selected Web Reports server, and that’s pretty straight forward.
The API needs the following values as input:
- The ID of the server in question. Specify the ID directly in the API URL. For example, if you want to direct your requests server with ID 2 (and not to the one whose ID is 1), then the API URL goes like this: PUT /api/webreports/2
- The value for the server priority. Specify the new priority value in the request body based on the following request schema:
Following is an example of request body:
Attaching the request body to the PUT API /api/webreports/2 changes the priority of the server https://BN-SINNOH-WIN10:8083 to the value 20. Because it is a higher priority than that of the other server which has a value of 15, it becomes the first choice to be called in a session relevance.
To validate, call the /api/webreports/details API and check the order of the WebReports server.
If the server with ID 2 is not available, then the requests automatically get routed to the server with ID 1.
In closing, distributing workload is a common requirement for WebReports servers too. Appropriate management of resources is now easy with the two new REST APIs that provide you with the possibility of routing session relevance to any configured servers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author
Beniamino Negrini is a software engineer and a BigFixer based in Rome. He served as an intern at IBM and later worked as a scrum master in an energy company. He joined HCL as a developer in 2019 and is currently working on BigFix Platform projects.
Review and editorial credits
Shivi Sivasubramanian is a senior-level technical author and editor with a demonstrated history of working in the technology industry. A firm believer in the magical power of words, she loves helping the community deliver expressive, minimalist, and user-friendly content. Shivi currently leads a team of information developers in BigFix.