I am trying to write a fixlet with relevance that will find all of
the Macs in my site with static IP addresses. The eventual idea is to
change the DNS server for those found, but I don’t need to do that for
the DHCP clients. Here is what I have so far:
This finds the Macs that are running OS X 10.7 or later.
(name of operating system = "Mac OS X") AND (if system version >= "10.7" then version of client >= "8.2" else true) AND (architecture of operating system = "i386" OR architecture of operating system = "x86_64") AND (if exists property "in proxy agent context" then ( not in proxy agent context ) else true)
This is supposed to list all of the Macs with static IP addresses, but it doesn’t.
if ( exists true whose (if true then ( exists ip interfaces of network) else false) ) then addresses whose (it as string !="0.0.0.0" AND dhcp disabled of it) of ip interfaces whose (not loopback of it) of network as string else nothing
version of client >= "8.2" AND system version >= "10.7" AND (mac of it AND ("i386" = it OR "x86_64" = it) of architecture of it) of operating system AND (if exists property "in proxy agent context" then ( not in proxy agent context ) else true)
The second fails due to “dhcp disabled” not being available at least on the Mac. I’ll take a look and see what if anything could be used. Additionally the “nothing” inspector is deprecated and again Mac only so I’d not suggest it be used.
There may be a file that could be queried on OS X to determine what the DNS server is set to.
Another option is to have a task that will run a command once a day and write the current DNS server to a file, then it can be queried with relevance. (similarly this could be done to determine if the client is using DHCP or not)
Another option would be to create a group of all DHCP clients based upon subnet address, if that is easily definable. Then the static clients would be all of those not in that group. This would be the group you would target to change the DNS settings.
Our DHCP client’s subnets are kind of mixed with the static folks. We use static reservations in DHCP to ensure the client always get the same address (silly, I know…). I do like the idea of referencing a file on the machine. However, scheduling daily tasks on OS X has become a real bear with launchctl. Thanks for the idea!
You misunderstand what I mean by scheduling tasks in OS X. I am not referring to using something like launchctl, I am suggesting using purely BigFix/IEM itself.
You create a task that dumps the results of a command to a text file. By convention I put the results in the log folder of the BES Client with a name like results_nameOfCommand.txt
You then have an open action that runs this task on all endpoints once every X hours, or X days, depending on the need.
You can basically use BigFix/IEM as a way to create scheduled tasks without needing to use Cron, launchctl, or Windows Scheduled Tasks. You just use relevance and the take action dialog in combination to set the parameters of what computers should get the scheduled tasks and under what conditions, and the scheduled task can do anything you can do in actionscript, which is anything that can be invoked on the command line. The trick is to set the task to never expire and to repeat indefinitely, but only on the interval you choose.