+ All Categories
Home > Documents > The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M...

The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M...

Date post: 22-Sep-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
60
MACADMINS CONFERENCE AT PENN STATE® The awesome world of SimpleNetworkManagementProtocol François Joannette – FJ Consultant Manuel Deschambault – Symbiotic System Design Feedback http://j.mp/psumac2015-132
Transcript
Page 1: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

The awesome world of SimpleNetworkManagementProtocol

François Joannette – FJ Consultant Manuel Deschambault – Symbiotic System Design

Feedback http://j.mp/psumac2015-132

Page 2: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond…. extending… crazy stuff… Manuel?

Page 3: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 4: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 5: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 6: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 7: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 8: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 9: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

sysUpTime —> .1.3.6.1.2.1.3

DISMAN-EVENT-MIB::sysUpTimeInstance

.1.3.6.1.2.1.1.3.0

Timeticks: (450831) 1:15:08.31

Page 10: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 11: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 12: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 13: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 14: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond….

Page 15: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• What is SNMP?

• Ports, firewall and NAT

• Components

• Versions

• MIB and OIDs

• Commands

• Must check out

• Going beyond…. extending… crazy stuff… Manuel?

Page 16: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

Q&A

Feedback http://j.mp/psumac2015-132

Page 17: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

How to make SimpleNetworkManagementProtocol

useful on the Macintosh

Manuel Deschambault Support Tool Architect

Page 18: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Configure SNMP

• Extend SNMP

Query

Traps

Page 19: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Configure SNMP

• Extend SNMP

Query

Traps X

Page 20: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Configure SNMP

• Extend SNMP

Page 21: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Almost always off

• Only need to activate

• Configure SNMP

• Extend SNMP

Page 22: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Configure SNMP

• Monolithic config file

• Not easy to manage

• Not easy to automate

• Extend SNMP

Page 23: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

/etc/snmp

snmpd.conf

Standard anatomy of SNMP folder

Page 24: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

New anatomy of SNMP folder

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

Page 25: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

New anatomy of SNMP folder

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

Page 26: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

New anatomy of SNMP folder

• Only configs requiring snmpd.conf editing

Page 27: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

New anatomy of SNMP folder

• Only configs requiring snmpd.conf editing

• Code any configs needed into text files

Page 28: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

New anatomy of SNMP folder

• Only configs requiring snmpd.conf editing

• Code any configs needed into text files

• Edit autoconfig.sh parser accordingly

Page 29: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMP

Monolithic & not manageable

move /etc/snmp/snmpd.conf to /etc/snmp/snmp.conf.previous

set default values for:-rocommunity (public)-syslocation (not specified)-syscontact (not specified)

read:-/etc/snmp/Components/rocommunity.txt-/etc/snmp/Components/syslocation.txt-/etc/snmp/Components/syscontact.txt

are values valid?

override defaults

use defaults

YesNo

list all scripts in /etc/snmp/Components/Extensions

push rocommunity > /etc/snmp/snmpd.confpush syslocation >> /etc/snmp/snmpd.confpush syscontact >> /etc/snmp/snmpd.conf

for each script do:

extract the OID

compose the OID

push "extend <OID> <name> <script path> >> /etc/snmp/snmpd.conf

is it last one

take next script

Yes

No

restart net-snmp daemon

extract the name

autoconfig.sh parser script

Page 30: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMPNot easy to automate

New anatomy of SNMP folder

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

Page 31: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMPNot easy to automate

New anatomy of SNMP folder

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

• Set as watch folder with launchd task

Page 32: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMPNot easy to automate

New anatomy of SNMP folder

/etc/snmp

Components

snmpd.conf

rocommunity.txt

syscontact.txt

syslocation.txt

Extensions examplescript.sh

autoconfig.sh

• Set as watch folder with launchd task

• Run autoconfig.sh script when modified

Page 33: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMPNot easy to automate

Demo

Page 34: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Activate SNMP

• Configure SNMP

• Extend SNMP

• Not a lot of pertinent data by default

• Net-SNMP agent can be extended to add useful data to our queries

Page 35: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

• Benefits of extending the Net-SNMP agent

• Format of extension scripts

• Output of extension scripts

• Net-SNMP extensions vs remote SSH commands

• Standardizing

Page 36: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

• Benefits of extending the Net-SNMP agent

• Returns the output of ANY script via SNMP query

• Allows very granular data to be returned

• Format of extension scripts

• Output of extension scripts

• Net-SNMP extensions vs remote SSH commands

• Standardizing

Page 37: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

• Benefits of extending the Net-SNMP agent

• Format of extension scripts

• extend <OID> <name> <script path>

• Name get ascii encoded in OID, keep very short

• Output of extension scripts

• Net-SNMP extensions vs remote SSH commands

• Standardizing

Page 38: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

• Benefits of extending the Net-SNMP agent

• Format of extension scripts

• Output of extension scripts

• Returns a table (1 or more values if multiple components)

• Returns a single exit value, even if multiple values in table

• Net-SNMP extensions vs remote SSH commands

• Standardizing

Page 39: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocolConfigure SNMPNot easy to automate

Demo

Page 40: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

• Benefits of extending the Net-SNMP agent

• Format of extension scripts

• Output of extension scripts

• Net-SNMP extensions vs remote SSH commands

• Standardizing

Page 41: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

Net-SNMP extension for S.M.A.R.T. Status

SNMP Query

SNMP Server

Net-SNMP extension model

Method comparison

Page 42: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

SSH command sent to Mac to get S.M.A.R.T. status SNMP Server

Remote SSH model

Method comparison

Page 43: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPMethod comparison

Pros

Net-SNMP extensions Remote SSH commands

• Does not require SNMP setup of Mac• All development done on SNMP server• Data encrypted by default• Modifications can be stored in

expansion packs depending on NMS

• Very little setup on NMS server side• NMS server expansion pack can be

cross platform if OID structure is

followed also on Linux machines• Data encrypted if SNMPv3 used• Net-SNMP setup can be automated

within current deployment/

management solution• SSH can be disabled on Mac

Page 44: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMP

Net-SNMP extension for S.M.A.R.T. Status

SNMP Query

SNMP Server

Net-SNMP extension model

Method comparison

Page 45: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPMethod comparison

Cons

Net-SNMP extensions Remote SSH commands

• Requires SSH enabled with credentials• NMS server admin must be able to

script all platforms to monitor• Heavy processor load on NMS server

with large device count• Must make a separate expansion pack

per platform to monitor

• Configuration burden is mostly on the

computer to monitor

Page 46: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPStandardizing

• What we would want to standardize

• Benefits of standardizing

• How to put this in play

• Contact me to sign-up / be updated

Page 47: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPStandardizing

• What we would want to standardize

• OID structure per data point (on 43776.99)

• Scripts

• Benefits of standardizing

• How to put this in play

• Contact me to sign-up / be updated

Page 48: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPStandardizing

• What we would want to standardize

• Benefits of standardizing

• Benefit from expertise of coders/scripters world wide

• NMS expansion packs can be shared, making deployment very fast and easy

• How to put this in play

• Contact me to sign-up / be updated

Page 49: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPStandardizing

• What we would want to standardize

• Benefits of standardizing

• How to put this in play

• I will host an open source project for this later this summer or in the fall

• Contact me to sign-up / be updated

Page 50: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

ConsultantFrançois Joannette

FJ Consultant

Manuel DeschambaultSupport Tool Architect

Symbiotic System Design

Feedback http://j.mp/psumac2015-132

Page 51: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Extra marks (if time permits) a.k.a. “brown nosing section”

Extend SNMP

Page 52: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol

• Extra marks (if time permits) a.k.a. “brown nosing section”

• What about roaming machines?

• Making extension scripts that work off the LAN

• Calling those scripts on a schedule when off the LAN

• Modifications to the anatomy of the SNMP folder

Extend SNMPRoaming solution

Page 53: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

• Identifying two classes of data point

• Identifying the scripts we want to work when roaming

• Knowing if the script is called by SNMP server or while roaming

• Acting on alert

Page 54: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

• Identifying two classes of data point

• Classify each data point as performance metric or status

• Isolate status scripts since those will reflect failures to alert on

• Identifying the scripts we want to work when roaming

• Knowing if the script is called by SNMP server or while roaming

• Acting on alert

Page 55: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

• Identifying two classes of data point

• Identifying the scripts we want to work when roaming

• Name the extension scripts that return status data as SA_<name of script>.sh (for Stand Alone)

• Knowing if the script is called by SNMP server or while roaming

• Acting on alert

Page 56: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

• Identifying two classes of data point

• Identifying the scripts we want to work when roaming

• Knowing if the script is called by SNMP server or while roaming

• When script is called by the scheduled launchd task, pass it a variable. If this is empty, then the script was called by SNMP query and is on the LAN.

• Acting on alert

Page 57: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

roamingcheck.sh was executed per schedule

get /etc/snmp/snmpserver.txt

Is it empty

?

Machine not configured for roaming.

Exit script

Does IP

ping?

SNMP Server can be reached.

Exit script

List and execute all scripts in/etc/snmp/Components/Extensions

that start with SA_

Exit script

YesNoYes

No

roamingcheck.sh script

Page 58: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

Start of script StandAlone=$1 Gather Data Point

Was threshold exceeded

?theExit=1

Generate the alert message

Pass message to/etc/snmp/roamalert.sh

echo data point

How was script

executed?

More data

points?

End of script

Exit with exit code

Yes

theExit=0

echo data point

No

SNMP Query

Roaming

No

Yes

SA_Example.sh script

Page 59: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

SimpleNetworkManagementProtocol Extend SNMPRoaming solution

• Identifying two classes of data point

• Identifying the scripts we want to work when roaming

• Knowing if the script is called by SNMP server or while roaming

• Acting on alert

• roamalert.sh script is called with error message

• personalize roamalert.sh to execute the alert mechanism of your choice

Page 60: The awesome world of S N M P€¦ · MACADMINS CONFERENCE AT PENN STATE® S imple N etwork M anagement P rotocol • What is SNMP? • Ports, firewall and NAT • Components •

MACADMINSCONFERENCE

AT PENN STATE®

François Joannette – FJ Consultant Manuel Deschambault – Symbiotic System Design

Feedback http://j.mp/psumac2015-132


Recommended