Location by subnet question

(imported topic written by hbkrules6991)

Hi all:

I have question on the location subnet. In our larger sites we simply define the subnets in Sites and Services by the first two octets.

Example:

153.14.0.0/16

132.14.0.0/16

In our smaller sites, we go to the 3rd octet to define them

152.145.130.0/23

If I use the “Create a retrieved property that maps subnet to location”, and use the above subnets(while removing the CIDR with the checkbox), only those on the 152.145.130.0 display their location. I fear it is because the /16 subnet is only occupying the first two octets. Am i correct in my assumption and is there a way around this other than to define each subnet via the third octet?

Thanks!!

(imported comment written by NoahSalzman)

Does this help? If not, search the forum for “cidr” and you will find other helpful threads.

http://forum.bigfix.com/viewtopic.php?id=5849

(Lots of times in the Console, if a Wizard doesn’t do exactly what you want, you can run the wizard and use the output as an example/guide that you then tweak for your exact needs.)

(imported comment written by hbkrules6991)

Thanks Noah,

Stealing his example:

unique values of (if (it starts with “10.31.104.”) then “Region1” else if (it starts with “10.31.105.”) then “Region2” else if (it starts with “10.31.”) then “Southeast Region” else “Unknown”) of (subnet addresses of adapters of network as string)

Is there a way to combine subnets say

if (it starts with “10.31.105.” or “10.31.106.”) then “Region2” else…

…we have hundreds and hundreds of subnets and doing each one will be a long and tedious task

(imported comment written by NoahSalzman)

Yep, you can do it this way:

if (it starts with “10.31.105.” or it starts with “10.31.106.” or it starts with “10.31.107.”) then “Region2” else…

(imported comment written by hbkrules6991)

Noah thanks…works like a charm…

(imported comment written by hbkrules6991)

OK I just tried this, but with about 100+ subnets for a single site(dont ask), and the Property looks correct as there are no red letters indicating and error and my last piece of it is

“else “Unknown”) of (subnet addresses of adapters of network as string)”

All machines are actually coming back as “Unknown”, but the machines are in fact on one of the subnets listed. Is there a max limit in the clause that can be causing it?

(imported comment written by NoahSalzman)

Can you try a shortened version and see if it works?

(imported comment written by hbkrules6991)

Hi Noah, yes it does, but I still would need hundreds of these relevances. I was looking at the “General Dynamic Setting Property:” and was wondering if I could maybe utilize that. Since BF does not like my putting in the two octect subnet(128.94.0.0/16), how about a clause of “it contains” , something like

unique value of (addresses of adapters of network as string) contains

or something like that.

Then on the next page where I define the value and key, i put in

128.94. SiteA

147.145.32 Site B

135.14 Site C

would this be possible?

(imported comment written by hbkrules6991)

bump :slight_smile:

(imported comment written by NoahSalzman)

So, with regards to the Location Property Wizard, if you are going to use it “out of the box” you need to make sure the format of the IP Address subnets matches up with appropriate radio button the first page. And, you can’t mix and match subnet ranges / subnet formats has you have above. So, the important first question is: is your list of subnet ranges all the same format (alll /16s, for example).

If no, then we are going to have to do a little custom work. We can use the Wizard to output chunks of Relevance that we will then combine to create our own single Location Property.