We're Hiring!
Take the next step in your career and work on diverse technology projects with cross-functional teams.
LEARN MORE
Mountain West Farm Bureau Insurance
office workers empowered by business technology solutions
BLOG
9
2
2019

Checking the Progress of Beekeeper Execution Jobs

Last updated:
9.16.2020
No items found.

We have received requests to see more detail around what is happening while Beekeeper applies patches for devices.  We have built a PowerShell script to query Beekeeper and the patched devices to display what is going on within Beekeeper and show the progress on individual patches.

To execute the script, you can run it on the Beekeeper server:

PS C:\_scripts> .\BK_CheckExecutionJobs.ps1


If you wish to run this script remotely, you will need to change the “localhost” references to your Beekeeper server name: (Ex: localhost to “JFHLABBK01”)

Before edit:

$ExecutionJobsRequestURI =
"http://localhost/BeekeeperApi/OPAS.svc/PatchRecords?`$filter=Status eq 'Running'"
$RunningJobsResults = Invoke-RestMethod -Uri $ExecutionJobsRequestURI -UseDefaultCredentials -Headers $URI_Headers
If($RunningJobsResults.value.Count -gt 0)
{
Write-Host "Current Beekeeper Execution Jobs:" -ForegroundColor Yellow
Write-Host " "
Foreach($Record in $RunningJobsResults.Value)
{
If($Record.'odata.type' -eq "OPASSvc.ClusterPatchRecord")
{
$Clustersrequesturi = "http://localhost/BeekeeperApi/OPAS.svc/Clusters?`$filter=ClusterId eq " + $Record.ClusterId
$Clusterresults = Invoke-RestMethod -Uri $ClustersrequestUri -UseDefaultCredentials -Headers $URI_Headers
Write-Host " Group currently Executing: " $Clusterresults.value.ClusterName " Node count: " $Record.NodeCount -ForegroundColor Cyan
}
If($Record.'odata.type' -eq "OPASSvc.NodePatchRecord")
{
$NodeRequestURI = "http://localhost/BeekeeperApi/OPAS.svc/ClusterNodes?`$filter=NodeId eq $($Record.NodeId)"
$NodeResults = Invoke-RestMethod -Uri $NodeRequestURI -UseDefaultCredentials -Headers $URI_Headers
Write-Host " On Node: " $NodeResults.value.NodeName -ForegroundColor Green
$EventRequestURI = "http://localhost/BeekeeperApi/OPAS.svc/Events?`$filter=(NodePatchRecordId eq $($Record.RecordId))"

After edit:

$ExecutionJobsRequestURI =
"http://JFHLABBK01/BeekeeperApi/OPAS.svc/PatchRecords?`$filter=Status eq 'Running'"
$RunningJobsResults = Invoke-RestMethod -Uri $ExecutionJobsRequestURI -UseDefaultCredentials -Headers $URI_Headers
If($RunningJobsResults.value.Count -gt 0)
{
Write-Host "Current Beekeeper Execution Jobs:" -ForegroundColor Yellow
Write-Host " "
Foreach($Record in $RunningJobsResults.Value)
{
If($Record.'odata.type' -eq "OPASSvc.ClusterPatchRecord")
{
$Clustersrequesturi = "http://JFHLABBK01/BeekeeperApi/OPAS.svc/Clusters?`$filter=ClusterId eq " + $Record.ClusterId
$Clusterresults = Invoke-RestMethod -Uri $ClustersrequestUri -UseDefaultCredentials -Headers $URI_Headers
Write-Host " Group currently Executing: " $Clusterresults.value.ClusterName " Node count: " $Record.NodeCount -ForegroundColor Cyan
}
If($Record.'odata.type' -eq "OPASSvc.NodePatchRecord")
{
$NodeRequestURI = "http://JFHLABBK01/BeekeeperApi/OPAS.svc/ClusterNodes?`$filter=NodeId eq $($Record.NodeId)"
$NodeResults = Invoke-RestMethod -Uri $NodeRequestURI -UseDefaultCredentials -Headers $URI_Headers
Write-Host " On Node: " $NodeResults.value.NodeName -ForegroundColor Green
$EventRequestURI = "http://JFHLABBK01/BeekeeperApi/OPAS.svc/Events?`$filter=(NodePatchRecordId eq $($Record.RecordId))"

Once you execute the script, it will show you Beekeeper’s progress:

Another example demonstrates more detail and actual status of individual patches.

Within the detail of a device’s patches, Evaluationstate is the progress phase and Compliancestate is the installed state.

This script is in our Github repository:

https://github.com/green-house-data/BeekeeperScripts/blob/master/BK_CheckExecutionJobs.ps1

Recent Blog Posts

lunavi logo alternate white and yellow
11.19.2024
11
.
8
.
2024
Load & Performance Testing with Azure Load Testing Service

Learn about load and performance testing in Microsoft Azure.

Learn more
lunavi logo alternate white and yellow
10.8.2024
09
.
25
.
2024
Maximizing Business Efficiency with Azure DevOps

For enterprises looking to adopt or mature their DevOps practices, Azure DevOps offers unmatched flexibility, scalability, and depth.

Learn more
lunavi logo alternate white and yellow
10.8.2024
09
.
09
.
2024
Exploring Microsoft Fabric: A Comprehensive Overview

Discover how Microsoft Fabric transforms data management and analytics with powerful tools for real-time insights and seamless collaboration, driving smarter, faster business decisions.

Learn more