snmp and you - aplura · many solutions, one goal. snmp and you kyle smith, integration developer,...

23
Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

Upload: others

Post on 15-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPandYou

KyleSmith,IntegrationDeveloper,Aplura,LLC

Page 2: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

WhoamI?

• KyleSmith• BaltimoreUGCo-Lead• WroteaBook• SplunkTrust• IRC/Slack/Answers/Community

Page 3: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

WhatisSNMP?• SimpleNetworkManagementProtocol• CollectsInformation• ConfiguresSettings

• 3Versions• SNMPv1

• Oldest,easiesttoconfigure.Simpleprotection• SNMPv2c

• Sameasv1,butwith64Bitcounters• SNMPv3

• Addsencryptionandauthenticationtov2c.Mostsecure,butcomplex.

https://www.logicmonitor.com/blog/whats-with-the-different-snmp-versions-s1-v2c-v3/

Page 4: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

MIBsandOIDs• MIBs• ManagementInformationBase

• Databasethatcontainsentitiesusedinacommunicationnetwork

• OIDs• ObjectIdentifiers

• ManagedElements• Hierarchicalinnature• Followsatreeformat

• IANAEnterpriseNumbers• Canberegisteredforanyorganization.• Aplurais50198

https://en.wikipedia.org/wiki/Object_identifierhttps://www.iana.org/assignments/enterprise-numbers

Page 5: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

Architecture

Page 6: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPPolling• Canbedoneonintervalstocollectmetricsinformation• OIDsofaspecificsystemcanbediscoveredby“walking”theMIB.(assupported)• Mustuseanagenttocollecttheinformation• UDPPort161• “Pull”• snmpwalk -v1-csplunk 192.168.1.11.3.6.1.4.1.8072

Page 7: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPTraps• AllowsSNMP-trapenabledequipmentto“reachoutandtouchsomeone”• UDPPort162• NOACK,sodatalosspossible.• Generallyindicateproblems/warnings/errors• “PUSH”

Page 8: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SplunkandSNMP

• Nonativefunctionality(input)topullSNMPdata.• CommunityApps• https://splunkbase.splunk.com/app/1537/

• MusthaveMIBstoperform“OIDTranslation”• PainPoints• autoresolving oids – gotta havecustomMIB• anythingreallyaroundsetupisaPITAcomparedtoothertools• ModularInputdoesn’tdiegracefully(oratall)

Page 9: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPPollingInput

Page 10: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SampleSNMPOutput

• NoAuto-Extractionofvariables/fields

• PossibletohaveOIDsandnotFieldnames(messydata)

Page 11: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPTrapsinSplunk• InstalltheSNMPTA• ConfiguretolistenforTraps

• USE0.0.0.0NOTlocalhost!

Page 12: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

TrapsSample

• NoAutoExtraction oftrapOIDInformation• NoCIMfields

Page 13: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

Collectd andSNMP

• Installcollectd• Enablesnmp andwrite_http plugins(/etc/collectd/collectd.conf• Useoutputplugins(CSV/HEC/MetricsStore)

Shhhh……..http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/GetMetricsInCollectd

Page 14: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPConfig – Collectd - HEC

Page 15: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPConfig – Collectd SNMP

Page 16: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPCollectd CSVOutput

• CanthenuseUFtoconsumethedata• Filenames/locationsconfigurable

Page 17: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

Tools

• MIBBrowser/TrapSender• Solarwinds ToolSet

• Windowsonly• AlargeamountofMIBs

• http://ireasoning.com/mibbrowser.shtml• CanusecustomMIBsasrequired• JAVA– MacOSX,Windows,etc.• Sends/receivesTraps• Walkthedevices

Page 18: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

Examplesanddashboards

Page 19: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

Questions?

• I’msuretherearesome.

Page 20: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPTA– CheckforMIBS

• FollowdocumentationtoseewhatMIBsaresupportedbydefault• AddnewMIBs(notworkingyet)• FindnewMIBS(weareusingUbiquitiasourtest)• Performedin“snmp_ta/bin”• Pipinstall-Ivpysnmp==4.2.5• build-pysnmp-mib -oUBNT-MIB.py ./UBNT-MIB• build-pysnmp-mib -oUBNT-UniFi-MIB.py ./UBNT-UniFi-MIB• BuildanEgg

Page 21: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPAppbyAplura

• Requirements:• Setupwizard(https://openui5.hana.ondemand.com/#/entity/sap.m.Wizard)• Net-snmp forsetupwizard• Collectd• SNMPpluginforcollectd (https://collectd.org/wiki/index.php/Plugin:SNMP)• Write_http pluginforcollectd (sendtoHEConHF)• MassivefuckingMIBList.• RESTendpointtoread/writethecollectd.conf file.

Page 22: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

SNMPAppbyApluraSteps

• CheckforandconfigureHEC.StoreTokensecurely• UseWizard:• “DataElements”:queryspecifichosttopullMIBs/OIDssupported.• Create“DataSet”,allownamebyuser.• Whitelist/blacklist

• AllowIPranges(iterateandmakehoststanzasforcollectd.conf)

Page 23: SNMP and You - Aplura · Many Solutions, One Goal. SNMP and You Kyle Smith, Integration Developer, Aplura, LLC

ManySolutions,OneGoal.

AddadditionalMIB

• Somestepsandexampleshere.