BigFix action script reference parameter

Hi Jason,
Thx for pointing that out, It’s now working with the parameter.

Next question and that might be a bit more challenging is following
We have workstations that have multiple NIC’s, and in that scenario I would like to be able to discover the location for each IP Subnet. I’ve already search the forum and did not find real solution for While Loop using Action Scripts. The possibility of using VBScript could be done but makes it complex as we have mixed environment of Windows, Linux, HP-UX so would have to come up with script/solution for each flavor if we want to down that path. I might do it anyway for Windows devices but if there is any other way how to achieve this would be appreciated.

Issue trying to solve is the following. We have sites (mainly plant operations) where workstations have multiple NIC’s. Some of these NIC’s are connected to internal networks (10.x.x.x/172.16.x.x) but at same time also have primary NIC which is used to communicate to BigFix and other systems, this also determine which relay should be used for downloading software/os patches etc. With our current discovery script we run into issues where workstation was downloading content from regional relay vs. local relay because of multiple NIC’s and incorrect site assignment.

Below is some sample code I’m working with.
If you look at parameter “_SubnetAddress1” where I have 3 IP Subnets I would like to get location for each subnet and then determine best option.

IPSubnetInfo.csv has following format
155.119.0.0;255.255.0.0;EU - BELGIUM - BRUSSELS INNOVATION CENTER - 0257

The file is being distributed through BigFix as file part of the Master Action Site.

parameter “_SubnetAddress” = "{concatenation “;” of (subnet addresses of it as string) whose (it != “127.0.0.0”) of ip interfaces of network}"
parameter “_NrSubnets” = “{number of ((addresses of it as string) whose (it != “127.0.0.1”) of ip interfaces of network)}”

parameter “_SubnetAddress1” = "155.119.0.0;192.168.0.0;143.44.33.0"
parameter “_SubnetAddress2” = "155.119.0.0"
parameter “_NrSubnets1” = “{number of “155.119.0.0;192.168.0.0;143.44.33.0”}”

parameter “_SN0” = "{tuple string item 0 of concatenation “, " of substrings separated by “;” of “155.119.0.0;192.168.0.0;143.44.33.0”}”

parameter “_IPFile” = “D:\Data\IPSubnetInfo.csv”

parameter “_Region” = "{if exists (lines of it) whose (it contains (parameter “_SN0”)) of file (parameter “_IPFile”) then tuple string item 0 of (concatenation ", " of (substrings separated by " - " of tuple string item 2 of (concatenation “, " of (substrings separated by “;” of (lines of file (parameter “_IPFile”)) whose (it as string contains (parameter “_SN0”)))))) else “NOK”}”

parameter “_Country” = "{if exists (lines of it) whose (it contains (parameter “_SN0”)) of file (parameter “_IPFile”) then tuple string item 1 of (concatenation ", " of (substrings separated by " - " of tuple string item 2 of (concatenation “, " of (substrings separated by “;” of (lines of file (parameter “_IPFile”)) whose (it as string contains (parameter “_SN0”)))))) else “NOK”}”

parameter “_SiteName” = "{if exists (lines of it) whose (it contains (parameter “_SN0”)) of file (parameter “_IPFile”) then tuple string item 2 of (concatenation ", " of (substrings separated by " - " of tuple string item 2 of (concatenation “, " of (substrings separated by “;” of (lines of file (parameter “_IPFile”)) whose (it as string contains (parameter “_SN0”)))))) else “NOK”}”

parameter “_SAPID” = "{if exists (lines of it) whose (it contains (parameter “_SN0”)) of file (parameter “_IPFile”) then tuple string item 3 of (concatenation ", " of (substrings separated by " - " of tuple string item 2 of (concatenation “, " of (substrings separated by “;” of (lines of file (parameter “_IPFile”)) whose (it as string contains (parameter “_SN0”)))))) else “NOK”}”

Thx for all the help.

1 Like