Concatenation of environment variables errors?

Hi All,

I have an analysis to concatenate all the environment variables of our Windows server fleet as follows;

concatenation ", " of (variables of environment as string)

This works fine for a few servers, however most are displaying an error result in the console. When hovering over the error the tooltip displays “…” Does not appear to be aligned with a particular version of Windows or anything (Windows 2003, 2008 & 2012 in fleet) . I’ve logged into individual servers returning an error and have plugged this exact query into the debugger and it returns the expected results, no problems.

I have also tried the just grabbing the info I want straight from the registry;

concatenation ", " of ((name of it & ", " & (it as string) ) of values of keys "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" of registry)

This appears to return a lot more results in the console, however a lot seem to be truncated or still returning errors. Again, logging onto any machine and running the query through the debugger returns the expected result.

What am I missing here? Is there anyway I can reliably list out a systems environment variables in the console so they can be readily copied into a spreadsheet or similar?

Open one of the failing systems, and in the “Summary” tab scroll down to your analysis. That should show the result or error message if it’s not displaying in the tooltip.

Hi Jason,

Summary tab says exactly the same thing, i.e “…”.

Think I may have found the issue though. Appears that string literals are limited to 512 characters;

All the servers I have checked to date that are having issues have output over this 512 character limit. I’m guessing this “…” response indicates it has been truncated?

Not sure I am going to be able to do this effectively via analysis in this case. May have to look at using a task to pump this info out to a csv or similar instead. No where near as convenient :frowning:

I’m not sure whether that limit applies to results, or just to quoted strings in a relevance statement. In any case, the limit was changed from 512 to 2048 in bigfix 9.5. What version are you using?

Can you return multiple results, instead of concatenating them?

1 Like

Were still using 9.2 here due to Windows 2003 still being in the environment for another year or so. I’m not sure as to were the limit applies either, however it seems as though the shoe fits here when a query works locally in the debugger and with multiple servers with a small list of environment variables. Servers that have extensive customized env variables are the ones being truncated.

The 512 limit is to strings within relevance statements, not relevance results. You may be hitting a limit, but it is not that one.

You can upgrade to 9.5 but keep an older client installed on the Windows 2003 machines. There is no harm in doing this, and it is what I would recommend.

I frequently have NEWER clients installed than the root server and relays on machines running OS X or Windows 10, but have OLDER clients installed on outdated systems like Windows 2003 / WinXP / Win2000, etc…

In general, it is best to have all clients updated to the newest version supported by their particular OS, and it is generally better for clients to have the same version as the root and relay, but it is not required.

Whenever you do a root server upgrade at anytime, I would actually recommend only upgrading the root server at first, wait a while, make sure things are working okay, and then upgrade the relays, but generally not all at once. Only once all of the relays are upgraded and have been in use for a while without issue should you start upgrading your clients, and you definitely should roll that out slowly as well. I have some relevance that automatically distributes the client updates over time so that they don’t all happen at once. This practice of rolling out the updates means that the client and root server versions will definitely not match during the transition.