-
-
Notifications
You must be signed in to change notification settings - Fork 91
net snmp Tips
Oliver Gorwits edited this page Dec 30, 2018
·
3 revisions
snmpd -f -Lo -Dread_config -H 2>&1 | grep "config path" | head -1
For example (on MacOS):
read_config:path: config path used for snmpd: /etc/snmp:/usr/share/snmp:/usr/lib/snmp:/Users/oliver/.snmp (persistent path:/var/db/net-snmp)`
Or even better, use net-snmp-config
:
--configure-options display original configure arguments --prefix display the installation prefix --snmpd-module-list display the modules compiled into the agent --default-mibs display default list of MIBs --default-mibdirs display default list of MIB directories --snmpconfpath display default SNMPCONFPATH --persistent-directory display default persistent directory --perlprog display path to perl for the perl modules
-
SNMPCONFPATH
-
SNMP_PERSISTENT_DIR
-
MIBDIRS
-
MIB
-
Install the XCode command line toolset, either by running:
xcode-select --install
or visiting https://developer.apple.com/download/more/.
-
Install Homebrew: https://brew.sh/
-
Install net-snmp:
brew install net-snmp
-
Install PhantomJS:
brew cask install phantomjs
-
Install Perlbrew: https://perlbrew.pl/
-
Build a Perl and set it as the new default for your user:
perlbrew install perl-5.28.1 perlbrew switch perl-5.28.1
-
Configure your environment:
cat >> ~/.profile
export ND_PHANTOMJS='/usr/local/bin/phantomjs'
# net-snmp 5.8 from homebrew PATH="/usr/local/opt/net-snmp/bin:$PATH" PATH="/usr/local/opt/net-snmp/sbin:$PATH" LDFLAGS="-L/usr/local/opt/net-snmp/lib" CPPFLAGS="-I/usr/local/opt/net-snmp/include"
# perl 5.28.1 instead of system perl source ~/perl5/perlbrew/etc/bashrc
That’s it. You should not need local::lib
with this setup as perlbrew runs one for perl-5.28.1 for you automagically.