bwendel_zen Absent Member.
Absent Member.
695 views

How to distinguish test computer from all other ones?

Hello,

we would like to display a list of computers where the disk space is running low. The query will be run directly against the ZenWorks database (zendb). We are using ZCM 2017 and a MS SQL Server.

The current query looks like this:

SELECT 
TOP 10
MachineName, FreeHardDiskSpace, TotalHardDiskSpace, LastSuccessfulScanDate
FROM NC_Workstation
where
IsDeleted is null
ORDER BY FreeHardDiskSpace ASC


This query lists all computers where the disk space is running low. There are also some test computers in the results where the low disk space doesn't matter. How do I need to amend the aformentioned query, so that test computer are excluded from the result list?

Thanks.
Labels (1)
0 Likes
3 Replies
MCCFL_MLA Absent Member.
Absent Member.

Re: How to distinguish test computer from all other ones?

I believe the field you are looking for is held in the table "zDevice" and the field is "IsTest"

0 = NO
1 = Yes


You could Join the two tables on the following I believe.


ZenWorksAgentID from NC_Workstation
ZUID from zDevice

~Patrick
0 Likes
MCCFL_MLA Absent Member.
Absent Member.

Re: How to distinguish test computer from all other ones?

I believe this would work:



SELECT
TOP 10
MachineName, FreeHardDiskSpace, TotalHardDiskSpace, LastSuccessfulScanDate, IsTest
FROM NC_Workstation JOIN zDevice
ON ZenWorksAgentID = ZUID
where
IsDeleted is null AND IsTest=0
ORDER BY FreeHardDiskSpace ASC
0 Likes
bwendel_zen Absent Member.
Absent Member.

Re: How to distinguish test computer from all other ones?

Thanks for pointing out the table, field and join condition. It works.

I could verify that the machines that are marked with IsTest = 1 are shown as Test Machines in the Web GUI.

Regards.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.