( exists setting "__RelayServer1"of client ) AND ( setting "__RelayServer1"of client as string !="" ) AND ( ( preceding text of first "/"of following text of first "//"of ( value of setting "__RelayServer1"of client as string ) ) as lowercase != ( preceding text of first "/"of following text of first "//"of ( value of setting "__Relay_Control_RootServer"of client as string ) ) as lowercase )
(exists setting "__RelayServer1"of client) AND (setting "__RelayServer1"of client as string !="") AND ((preceding text of first "/"of following text of first "//"of (value of setting "__RelayServer1"of client as string)) as lowercase != (preceding text of first "/"of following text of first "//"of (value of setting "__Relay_Control_RootServer"of client as string)) as lowercase)
( ( notexists setting "__RelaySelect_Automatic"of client ) OR ( value ofit does not equal ( ( "1" ) as string ) ) of setting "__RelaySelect_Automatic"of client )
((notexists setting "__RelaySelect_Automatic"of client) OR (value ofit does not equal (("1") as string)) of setting "__RelaySelect_Automatic"of client)
( exists setting "_BESClient_Relay_NameOverride"of client andexistsitwhose ( existsitas integer ) of preceding texts of firsts "."of following texts of substrings "."of ( "." & ( value of setting "_BESClient_Relay_NameOverride"of client as string ) & "." ) ) AND ( notexistsitwhose ( it= value of setting "_BESClient_Relay_NameOverride"of client ) of addresses whose ( itas string !="0.0.0.0" ) of ip interfaces whose ( loopback ofit=false ) of network )
(exists setting "_BESClient_Relay_NameOverride"of client andexistsitwhose (existsitas integer) of preceding texts of firsts "."of following texts of substrings "."of ("." & (value of setting "_BESClient_Relay_NameOverride"of client as string) & ".")) AND (notexistsitwhose (it= value of setting "_BESClient_Relay_NameOverride"of client) of addresses whose (itas string !="0.0.0.0") of ip interfaces whose (loopback ofit=false) of network)
( ( ( sum of sizes of files of folders of folders ofit ) + ( sum of sizes of files ofit ) ) of folder "sha1"of folder ( if ( ( exists setting "_BESRelay_UploadManager_BufferDirectory"ofitandexists value of setting "_BESRelay_UploadManager_BufferDirectory"ofit ) of client ) then ( value of setting "_BESRelay_UploadManager_BufferDirectory"of client as string ) else ( if ( name of operating system startswith"Win" ) then ( parent folder of parent folder of client as string & "\BES Relay\UploadManagerData\BufferDir" ) else ( "/var/opt/BESRelay/UploadManagerData/BufferDir" ) ) ) >= it ) of ( if ( ( exists setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"ofitandexists value of setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"ofit ) of client ) then ( value of setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"of client as integer ) else ( 20971520 ) )
(((sum of sizes of files of folders of folders ofit) + (sum of sizes of files ofit)) of folder "sha1"of folder (if ((exists setting "_BESRelay_UploadManager_BufferDirectory"ofitandexists value of setting "_BESRelay_UploadManager_BufferDirectory"ofit) of client) then (value of setting "_BESRelay_UploadManager_BufferDirectory"of client as string) else (if (name of operating system startswith"Win") then (parent folder of parent folder of client as string & "\BES Relay\UploadManagerData\BufferDir") else ("/var/opt/BESRelay/UploadManagerData/BufferDir"))) >= it) of (if ((exists setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"ofitandexists value of setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"ofit) of client) then (value of setting "_BESRelay_UploadManager_BufferDirectoryMaxSize"of client as integer) else (20971520))
NOTexists setting "_BESClient_Resource_TrackingFile"whose ( exists value ofit ) of client ORNOTexists setting "_BESClient_Resource_TrackingCycleSeconds"whose ( exists value ofit ) of client ORNOTexists setting "_BESClient_Resource_TrackingCount"whose ( exists value ofit ) of client ORNOTexists setting "_BESClient_Resource_TrackingMaxFiles"whose ( exists value ofit ) of client
NOTexists setting "_BESClient_Resource_TrackingFile"whose (exists value ofit) of client ORNOTexists setting "_BESClient_Resource_TrackingCycleSeconds"whose (exists value ofit) of client ORNOTexists setting "_BESClient_Resource_TrackingCount"whose (exists value ofit) of client ORNOTexists setting "_BESClient_Resource_TrackingMaxFiles"whose (exists value ofit) of client
( free space of drive ( first 2of ( value "value"of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath"of x32 registry as string ) ) + ( sum of ( sizes of files of folders of folder ( ( if ( value of setting "_BESRelay_HTTPServer_ServerRootPath"of client ) ends with"\"then ( ( value of setting "_BESRelay_HTTPServer_ServerRootPath"of client ) & "bfmirror\downloads" ) else ( ( value of setting "_BESRelay_HTTPServer_ServerRootPath"of client ) & "\bfmirror\downloads" ) ) ) ) ) ) <free space of drive whose ( type ofit="DRIVE_FIXED"AND free space ofit= maximum of ( free spaces of drives whose ( type ofit="DRIVE_FIXED" ) ) )
(free space of drive (first 2of (value "value"of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath"of x32 registry as string)) + (sum of (sizes of files of folders of folder ((if(value of setting "_BESRelay_HTTPServer_ServerRootPath"of client) ends with"\"then ((value of setting "_BESRelay_HTTPServer_ServerRootPath"of client) & "bfmirror\downloads") else ((value of setting "_BESRelay_HTTPServer_ServerRootPath"of client) & "\bfmirror\downloads")))))) <free space of drive whose (type ofit="DRIVE_FIXED"AND free space ofit= maximum of (free spaces of drives whose (type ofit="DRIVE_FIXED")))
exists setting "_BESClient_Resource_TrackingFile"whose ( exists value ofit ) of client ORexists setting "_BESClient_Resource_TrackingCycleSeconds"whose ( exists value ofit ) of client ORexists setting "_BESClient_Resource_TrackingCount"whose ( exists value ofit ) of client ORexists setting "_BESClient_Resource_TrackingMaxFiles"whose ( exists value ofit ) of client
exists setting "_BESClient_Resource_TrackingFile"whose (exists value ofit) of client ORexists setting "_BESClient_Resource_TrackingCycleSeconds"whose (exists value ofit) of client ORexists setting "_BESClient_Resource_TrackingCount"whose (exists value ofit) of client ORexists setting "_BESClient_Resource_TrackingMaxFiles"whose (exists value ofit) of client
if ( ( itstartswith"127."ORitstartswith"::" ) of ( name of registration server as string ) ) then ( if ( ( exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit ) of client ) then"n/a (BES Relay Installed)"else"n/a (BES Server Installed)" ) else ( name of registration server as string )
if ((itstartswith"127."ORitstartswith"::") of (name of registration server as string)) then (if ((exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit) of client) then"n/a (BES Relay Installed)"else"n/a (BES Server Installed)") else (name of registration server as string)
if ( ( itstartswith"127."ORitstartswith"::" ) of ( name of registration server as string ) ) then ( if ( ( exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit ) of client ) then ( preceding text of first "/"of ( following text of first "//"of ( value of setting "_BESRelay_PostResults_ParentRelayURL"of client as string ) ) ) else"n/a (BES Server Installed)" ) else"n/a (BES Relay Not Installed)"
if ((itstartswith"127."ORitstartswith"::") of (name of registration server as string)) then (if ((exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit) of client) then (preceding text of first "/"of (following text of first "//"of (value of setting "_BESRelay_PostResults_ParentRelayURL"of client as string))) else"n/a (BES Server Installed)") else"n/a (BES Relay Not Installed)"
if ( ( itstartswith"127."ORitstartswith"::" ) of ( name of registration server as string ) ) then ( "n/a (Local Relay/Server)" ) else ( if ( ( exists setting "__RelaySelect_Automatic"of client ) and ( value of setting "__RelaySelect_Automatic"of client ="1" ) ) then"n/a (Automatic)"elseif ( ( notexists setting "__RelayServer1"of client ORnotexists value of setting "__RelayServer1"of client OR value of setting "__RelayServer1"of client ="" ) AND ( notexists setting "__RelayServer2"of client ORnotexists value of setting "__RelayServer2"of client OR value of setting "__RelayServer2"of client ="" ) ) then"Primary and Secondary Relay Not Set"elseif ( ( exists setting "__RelayServer1"of client ) AND ( exists setting "__RelayServer1"whose ( value ofitas string !="" ) of client ) AND ( ( preceding text of first "/"of following text of first "//"of ( value of setting "__RelayServer1"of client as string ) ) as lowercase ) = ( name of registration server as string as lowercase ) ) then"Using Primary Relay"elseif ( ( exists setting "__RelayServer2"of client ) AND ( exists setting "__RelayServer2"whose ( value ofitas string !="" ) of client ) AND ( ( preceding text of first "/"of following text of first "//"of ( value of setting "__RelayServer2"of client as string ) ) as lowercase ) = ( name of registration server as string as lowercase ) ) then"Using Secondary Relay"elseif ( ( name of registration server as string as lowercase ) = ( preceding text of first "/"of following text of first "//"of ( value of setting "__Relay_Control_RootServer"of client as string as lowercase ) ) ) then"Defaulting to Main BES Server"else"Unknown State" )
if ((itstartswith"127."ORitstartswith"::") of (name of registration server as string)) then ("n/a (Local Relay/Server)") else(if ((exists setting "__RelaySelect_Automatic"of client) and (value of setting "__RelaySelect_Automatic"of client ="1")) then"n/a (Automatic)"elseif ((notexists setting "__RelayServer1"of client ORnotexists value of setting "__RelayServer1"of client OR value of setting "__RelayServer1"of client ="") AND (notexists setting "__RelayServer2"of client ORnotexists value of setting "__RelayServer2"of client OR value of setting "__RelayServer2"of client ="")) then"Primary and Secondary Relay Not Set"elseif ((exists setting "__RelayServer1"of client) AND (exists setting "__RelayServer1"whose (value ofitas string !="") of client ) AND ((preceding text of first "/"of following text of first "//"of (value of setting "__RelayServer1"of client as string)) as lowercase) = (name of registration server as string as lowercase)) then"Using Primary Relay"elseif ((exists setting "__RelayServer2"of client) AND (exists setting "__RelayServer2"whose (value ofitas string !="") of client ) AND ((preceding text of first "/"of following text of first "//"of (value of setting "__RelayServer2"of client as string)) as lowercase) = (name of registration server as string as lowercase)) then"Using Secondary Relay"elseif ((name of registration server as string as lowercase) = (preceding text of first "/"of following text of first "//"of (value of setting "__Relay_Control_RootServer"of client as string as lowercase))) then"Defaulting to Main BES Server"else"Unknown State")
if ( exists setting "_BESClient_Download_LimitBytesPerSecond"whose ( exists value ofit ) of client ) then value of setting "_BESClient_Download_LimitBytesPerSecond"of client else"not set"
if (exists setting "_BESClient_Download_LimitBytesPerSecond"whose (exists value ofit) of client) then value of setting "_BESClient_Download_LimitBytesPerSecond"of client else"not set"
if ( exists service "BESRelay" ) then ( if ( exists setting "_BESGather_Download_LimitBytesPerSecond"whose ( exists value ofit ) of client ) then value of setting "_BESGather_Download_LimitBytesPerSecond"of client else"not set" ) else"BES Relay Not Installed"
if (exists service "BESRelay") then (if (exists setting "_BESGather_Download_LimitBytesPerSecond"whose (exists value ofit) of client) then value of setting "_BESGather_Download_LimitBytesPerSecond"of client else"not set") else"BES Relay Not Installed"