Does Casper enable or use SNMP on Mac clients?

znilsson
Contributor II

Sorry, my brain is fried on this one. Our network guys say our Mac clients are showing an immense amount of SNMP traffic on our network, but my understanding is that SNMP is disabled on Mac clients by default and that it has to be specifically enabled. I'm just trying to find out if SNMP is actually enabled on these Macs, and if so, why, so I can figure out if I can turn it off or not.

4 REPLIES 4

htse
Contributor III

unless there's a separate agent running, it's controlled by the org.net-snmp.snmpd LaunchDaemon

defaults read /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist Disabled

if it returns a 1 it's disabled

znilsson
Contributor II

@htse - Thanks for that. I'm a little confused about one thing, bear with me: When I run the script on a given Mac, here's what I get.

Running script smnp disabled?...
Script exit code: 0
Script result: 1

So as I understand it script exit code 0 means the script itself ran successfully. But then wouldn't that mean that script result 1 indicates that the script result was unsuccessful? Like it's looking for the word Disabled, so wouldn't a 1 indicate that it didn't find the word Disabled and therefore snmp is enabled?

This is an honest lack of understanding on my part, just trying to make sure I have it straight.

htse
Contributor III

sorry, that was kind of meant to to be quick and dirty, and run interactively, but that does sound about right.

this may provide a clearer result, or it can be placed as an Extension Attribute.

#!/bin/sh
disabled=/usr/bin/defaults read /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist Disabled if [ "$disabled" == "1" ];then
echo "<result>Disabled</result>"
else
echo "<result>Enabled</result>"
fi

znilsson
Contributor II

Oh ok I think you answered my question with the new script - I just had some confusion about both 0 and 1 equaling success but I think I get it now, haha. Thanks, I'll run that new script too, just to verify my results.