Skip to main content
Question

EA DNS Server "The networksetup binary is not present on this machine."

  • February 14, 2018
  • 5 replies
  • 29 views

Forum|alt.badge.img+3

Hello all,

Can I check if anyone else is getting "The networksetup binary is not present on this machine." using the DNS Server Extension Attribute ??

anyone found a fix?

Thanks
Craig W

5 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • February 14, 2018

I haven't looked at the EA, but networksetup is on my Mac (10.13.3):

Mac:~ dave$ which networksetup
/usr/sbin/networksetup

Might be that the EA has a typo or is looking in the wrong location.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • February 14, 2018

Looks like that message is coming from the EA

else echo "<result>The networksetup binary is not present on this machine.</result>"


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • February 14, 2018

Could you post a copy of the EA code?


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • February 14, 2018

sure its the one from the templates in JSS

!/bin/sh

OS=/usr/bin/sw_vers -productVersion | /usr/bin/colrm 5
if [[ "$OS" < "10.5" ]]; then
if [ -f /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup ];then NetworkInterface=/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -listnetworkserviceorder 2>&1 | grep $(/usr/sbin/netstat -rn 2>&1 | /usr/bin/grep -m 1 'default' | /usr/bin/awk '{ print $6 }') | sed -e "s/.Port: //g" -e "s/,.//g" echo "<result>/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -getdnsservers "$NetworkInterface" 2>&1</result>"
else echo "<result>The networksetup binary is not present on this machine.</result>"
fi
else
NetworkInterface=/usr/sbin/networksetup -listnetworkserviceorder 2>&1 | grep $(/usr/sbin/netstat -rn 2>&1 | /usr/bin/grep -m 1 'default' | /usr/bin/awk '{ print $6 }') | sed -e "s/.Port: //g" -e "s/,.//g"
echo "<result>/usr/sbin/networksetup -getdnsservers "$NetworkInterface" 2>&1</result>"
fi


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • February 14, 2018

A lot of the template EAs are quite old, and sometimes broken unfortunately.

It looks like the above EA is it's looking inside the ARDAgent.app for networksetup if the OS is lower than 10.5. I'm guessing in your case you're not running 10.5, in which case, the script is failing to read the OS correctly.

I would edit the code to remove that part.