SlideShare a Scribd company logo
Rob Hassing
Rob.hassing@deltics.nl
@rhassing
SNMP Explained!
Introduction
Deltics / OSMC
SNMP
Deltics / OSMC
WHY?
Simple network management protocol
Availability
Supported by most vendors
No third party software needed
Deltics / OSMC
How does it work?
Deltics / OSMC
UDP ports 161 & 162
SNMP header
● SNMP version
● Community (in version 1 and 2c)
● PDU type (what do we want to do?)
SNMP versions
● SNMPv1
● SNMPv2c
● SNMPv3
Most commonly used
Supports encryption, overhead, not used very often
How does it work?
Deltics / OSMC
NMS Router
Check interface status!
GET
REPLY
E1
How does it work?
Deltics / OSMC
NMS Router
E1
TRAP!
Deltics / OSMC
SNMP: Protocol
Deltics / OSMC
Community
PDU (Protocol Data Units)
● 0 – get
● 1 – get-next
● 2 – response
● 3 – set
● 4 – trap
● 5 – getbulkrequest (version > 2c)
● 6 – getinformrequest (version > 2c)
SNMP: Protocol (wireshark)
Deltics / OSMC
SNMP: Protocol (wireshark)
Deltics / OSMC
Deltics / OSMC
SNMP: Variables
Deltics / OSMC
mib-2 (1)
system (1) printer (43)
enterprises
(1)
Cisco (9)
Microsoft
(311)
Apple (63)
directory (1) mgmt (2)
experimental
(3)
private (4)
iso (1)
org (3)
iso (1)
dod (6)
internet (1)
SNMP: simple example
Deltics / OSMC
● The path in the OID tree:
● iso.org.dod.internet.mgmt.mib-2.system.sysContact.0
● (= .1.3.6.1.2.1.1.4.0)
● iso.org.dod.internet.mgmt.mib-2.system.sysName.0
● (= .1.3.6.1.2.1.1.5.0)
● iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0
● (= .1.3.6.1.2.1.1.6.0)
● Or we can use a shorter method
● sysContact
● sysName
● sysLocation
SNMP: What are MIBs?
Deltics / OSMC
SNMP: What are MIBs?
Deltics / OSMC
● Easier to read, like DNS for an IP address
● Different type of variables:
● Integer, Timestamp, Counter, IpAddress, Displaystring, …..
● Standardized SMIv2 (RFC2579)
● Max access:
● Not-accessible / read-only / read-write
● Status
● Current / Obsolete / Deprecated
● Description
SNMP: SNMPv2-MIB
Deltics / OSMC
sysUpTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The time (in hundredths of a second) since the
network management portion of the system was last
re-initialized."
::= { system 3 }
sysContact OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The textual identification of the contact person for
this managed node, together with information on how
to contact this person. If no contact information is
known, the value is the zero-length string."
::= { system 4 }
Deltics / OSMC
SNMP: Tables (Storage)
Deltics / OSMC
For a variable number of values
(eg. networkinterface, Storagedevices)
snmpwalk -v2c -c public 192.168.1.1 .1.3.6.1.2.1.25.2.3.1
Index Type Description AllocationUnits Size Used
1 Other Memory Buffers 1024 bytes 2065816 144968
2 RAM Real Memory 1024 bytes 2065816 1996312
3 VirtualMemory Swap Space 1024 bytes 4192760 84908
4 FixedDisk / 4096 bytes 117738760 8718286
5 FixedDisk /boot 1024 bytes 101018 22542
SNMP: Tables (Storage)
Deltics / OSMC
SNMP creates an index number for each individual device
For example:
HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2
HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3
HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5
Table variables can be recognized by the index value that NOT equals 0
If a variable is not part of an table, the index value will always be 0.
SNMP: Tables (Storage)
Deltics / OSMC
The index number corresponds with the device number:
In this example the .4 corresponds with all information about
the / (root) partition.
The size is: 117738460 blocks of 4096 bytes:
That makes the partition: 117738460 x 4096 / 1024 / 1024 / 1024 = 450GB
HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.5 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 117738760
HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 101018
SNMP: Tables (Storage)
Deltics / OSMC
Tables are defined in the MIB files (short example):
hrStorageEntry OBJECT-TYPE
SYNTAX HrStorageEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A (conceptual) entry for one logical storage area on
the host. As an example, an instance of the
hrStorageType object might be named hrStorageType.3"
INDEX { hrStorageIndex }
::= { hrStorageTable 1 }
HrStorageEntry ::= SEQUENCE {
hrStorageIndex Integer32,
hrStorageType AutonomousType,
hrStorageDescr DisplayString,
hrStorageAllocationUnits Integer32,
hrStorageSize Integer32,
hrStorageUsed Integer32,
hrStorageAllocationFailures Counter32
}
Deltics / OSMC
SNMP: Tools (CLI)
Deltics / OSMC
SNMPGET
snmpget -v2c -c public 192.168.1.1 sysContact.0
SNMPWALK
snmpwalk -v2c -c public 192.168.1.1 system
SNMPSET
snmpset -v2c -c secret 192.168.1.1 syscontact.0 string noc@deltics.nl
SNMPNETSTAT
snmpnetstat -v2c -c public -Ca 192.168.1.1
SNMP: Tools (iReasoning)
Deltics / OSMC
SNMP: Tools (iReasoning)
Deltics / OSMC
SNMP: Tools (iReasoning)
Deltics / OSMC
Deltics / OSMC
SNMP: SNMPTRAP
Deltics / OSMC
● An SNMPTRAP is send by a device when a status
change occurs
● A single UPD package on port 162
● Mostly unreadable by human, just an OID
● Configuration in /etc/snmp/snmptrapd.conf
SNMP: SNMPTRAP config
Deltics / OSMC
Configuration in /etc/snmp/snmptrapd.conf
####
authCommunity log,execute public
traphandle default /usr/sbin/snmptt
####
● This means the SNMPTRAP is authenticated by a communitystring
● log the details of the notification
● pass the details of the trap to a specified handler program
● All traps are send to the program snmptt
Deltics / OSMC
SNMP: SNMPTT
Deltics / OSMC
SNMPTRAP Translator:
● Makes SNMPTRAPS more “Human Readable”
● Define the actions in a config file
● MIB files can be used to create config files
(snmpttconvertmib)
SNMP: SNMPTT
Deltics / OSMC
snmpttconvertmib --in=aruba-trap.my 
--out=snmptt.aruba 
--exec=”/usr/local/bin/snmptrap.sh $r 
snmptrap OK “$* $x - $X: $D”
This command will convert all traps defined in aruba-
trap.my to a snmptt config file called snmptt.aruba with
a default action.
Deltics / OSMC
#!/bin/sh
# $1 = host_name (Short name of host that the service is
# associated with)
# $2 = svc_description (Description of the service)
# $3 = state_string (A string representing the status of
# the given service - "OK", "WARNING", "CRITICAL"
# or "UNKNOWN")
# $4 = plugin_output (A text string that should be used
# as the plugin output for the service checks)
#
# Convert the state string to the corresponding return code
return_code=-1
case "$3" in
OK)
return_code=0
;;
WARNING)
return_code=1
;;
CRITICAL)
return_code=2
;;
UNKNOWN)
return_code=-1
;;
esac
/usr/bin/printf "%st%st%st%sn" "$1" "$2" "$return_code" "$4" | 
/usr/sbin/send_nsca 127.0.0.1 -c /etc/nagios/send_nsca.cfg
/usr/local/bin/snmptrap.sh
Deltics / OSMC
How does it work?
Deltics / OSMC
NMS Router
E1
TRAP!
/.../snmptrap.sh
$r snmptrap-interface
CRITICAL
"link down"
/usr/bin/printf
"%st%st%st%sn"
"$1" "$2"
"$return_code" "$4"
| /usr/sbin/send_nsca 127.0.0.1
-c /etc/nagios/send_nsca.cfg
Snmptrapd:
oid
.1.3.6.1.6.3.1.1.5.3
Deltics / OSMC
SNMP: Nagios
Deltics / OSMC

More Related Content

What's hot

Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basics
Juraj Hantak
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
wallyqs
 
Apache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and TomcatApache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and Tomcat
Jean-Frederic Clere
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
Scott Leberknight
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
Sean Chang
 
Docker and Fargate
Docker and FargateDocker and Fargate
Docker and Fargate
Shinji Miyazato
 
Openstack Networking Internals - first part
Openstack Networking Internals - first partOpenstack Networking Internals - first part
Openstack Networking Internals - first part
lilliput12
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
Ronny
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Zabbix
 
Netty from the trenches
Netty from the trenchesNetty from the trenches
Netty from the trenches
Jordi Gerona
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
Omid Vahdaty
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
Philippe Bogaerts
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networking
Sim Janghoon
 
Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2
Jim Jagielski
 
Nagios nrpe
Nagios nrpeNagios nrpe
Nagios nrpe
sharad chhetri
 
Apache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse ProxyApache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SPPrimeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Zabbix BR
 
OpenNMS introduction
OpenNMS introductionOpenNMS introduction
OpenNMS introduction
Guider Lee
 

What's hot (18)

Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basics
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
 
Apache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and TomcatApache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and Tomcat
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
 
Docker and Fargate
Docker and FargateDocker and Fargate
Docker and Fargate
 
Openstack Networking Internals - first part
Openstack Networking Internals - first partOpenstack Networking Internals - first part
Openstack Networking Internals - first part
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
 
Netty from the trenches
Netty from the trenchesNetty from the trenches
Netty from the trenches
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networking
 
Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2Acus08 Advanced Load Balancing Apache2.2
Acus08 Advanced Load Balancing Apache2.2
 
Nagios nrpe
Nagios nrpeNagios nrpe
Nagios nrpe
 
Apache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse ProxyApache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse Proxy
 
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SPPrimeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
 
OpenNMS introduction
OpenNMS introductionOpenNMS introduction
OpenNMS introduction
 

Similar to OSMC 2017 | SNMP explained by Rob Hassing

A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
Insight Technology, Inc.
 
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios PluginsNagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios
 
Hunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationHunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentation
OlehLevytskyi1
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
Brendan Gregg
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
Rishu Seth
 
Ltsp talk
Ltsp talkLtsp talk
Ltsp talk
Kanchilug
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
Rohini Sharma
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
Sam Kim
 
Intro To Hacking
Intro To HackingIntro To Hacking
Intro To Hacking
nayakslideshare
 
Tcpdump
TcpdumpTcpdump
Tcpdump
Sourav Roy
 
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael SchwartzkopffOSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
NETWAYS
 
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
spark-project
 
Snmp class
Snmp classSnmp class
Snmp class
aduitsis
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
Nagios
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & Heartbeat
Chris Barber
 
The Art of Grey-Box Attack
The Art of Grey-Box AttackThe Art of Grey-Box Attack
The Art of Grey-Box Attack
Prathan Phongthiproek
 
Bt0076 tcp ip
Bt0076  tcp ipBt0076  tcp ip
Bt0076 tcp ip
smumbahelp
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
MuthuramanElangovan
 
Hacking Fundamentals - Jen Johnson , Miria Grunick
Hacking Fundamentals - Jen Johnson , Miria GrunickHacking Fundamentals - Jen Johnson , Miria Grunick
Hacking Fundamentals - Jen Johnson , Miria Grunick
amiable_indian
 

Similar to OSMC 2017 | SNMP explained by Rob Hassing (20)

A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
 
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios PluginsNagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
 
Hunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationHunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentation
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
Ltsp talk
Ltsp talkLtsp talk
Ltsp talk
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
 
Intro To Hacking
Intro To HackingIntro To Hacking
Intro To Hacking
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael SchwartzkopffOSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
OSMC 2009 | net-snmp: The forgotten classic by Dr. Michael Schwartzkopff
 
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
 
Snmp class
Snmp classSnmp class
Snmp class
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
Nagios Conference 2013 - Spenser Reinhardt - Intro to Network Monitoring Usin...
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & Heartbeat
 
The Art of Grey-Box Attack
The Art of Grey-Box AttackThe Art of Grey-Box Attack
The Art of Grey-Box Attack
 
Bt0076 tcp ip
Bt0076  tcp ipBt0076  tcp ip
Bt0076 tcp ip
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
 
Hacking Fundamentals - Jen Johnson , Miria Grunick
Hacking Fundamentals - Jen Johnson , Miria GrunickHacking Fundamentals - Jen Johnson , Miria Grunick
Hacking Fundamentals - Jen Johnson , Miria Grunick
 

Recently uploaded

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 

Recently uploaded (20)

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 

OSMC 2017 | SNMP explained by Rob Hassing

  • 3. SNMP Deltics / OSMC WHY? Simple network management protocol Availability Supported by most vendors No third party software needed
  • 5. How does it work? Deltics / OSMC UDP ports 161 & 162 SNMP header ● SNMP version ● Community (in version 1 and 2c) ● PDU type (what do we want to do?) SNMP versions ● SNMPv1 ● SNMPv2c ● SNMPv3 Most commonly used Supports encryption, overhead, not used very often
  • 6. How does it work? Deltics / OSMC NMS Router Check interface status! GET REPLY E1
  • 7. How does it work? Deltics / OSMC NMS Router E1 TRAP!
  • 9. SNMP: Protocol Deltics / OSMC Community PDU (Protocol Data Units) ● 0 – get ● 1 – get-next ● 2 – response ● 3 – set ● 4 – trap ● 5 – getbulkrequest (version > 2c) ● 6 – getinformrequest (version > 2c)
  • 13. SNMP: Variables Deltics / OSMC mib-2 (1) system (1) printer (43) enterprises (1) Cisco (9) Microsoft (311) Apple (63) directory (1) mgmt (2) experimental (3) private (4) iso (1) org (3) iso (1) dod (6) internet (1)
  • 14. SNMP: simple example Deltics / OSMC ● The path in the OID tree: ● iso.org.dod.internet.mgmt.mib-2.system.sysContact.0 ● (= .1.3.6.1.2.1.1.4.0) ● iso.org.dod.internet.mgmt.mib-2.system.sysName.0 ● (= .1.3.6.1.2.1.1.5.0) ● iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0 ● (= .1.3.6.1.2.1.1.6.0) ● Or we can use a shorter method ● sysContact ● sysName ● sysLocation
  • 15. SNMP: What are MIBs? Deltics / OSMC
  • 16. SNMP: What are MIBs? Deltics / OSMC ● Easier to read, like DNS for an IP address ● Different type of variables: ● Integer, Timestamp, Counter, IpAddress, Displaystring, ….. ● Standardized SMIv2 (RFC2579) ● Max access: ● Not-accessible / read-only / read-write ● Status ● Current / Obsolete / Deprecated ● Description
  • 17. SNMP: SNMPv2-MIB Deltics / OSMC sysUpTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "The time (in hundredths of a second) since the network management portion of the system was last re-initialized." ::= { system 3 } sysContact OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) MAX-ACCESS read-write STATUS current DESCRIPTION "The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string." ::= { system 4 }
  • 19. SNMP: Tables (Storage) Deltics / OSMC For a variable number of values (eg. networkinterface, Storagedevices) snmpwalk -v2c -c public 192.168.1.1 .1.3.6.1.2.1.25.2.3.1 Index Type Description AllocationUnits Size Used 1 Other Memory Buffers 1024 bytes 2065816 144968 2 RAM Real Memory 1024 bytes 2065816 1996312 3 VirtualMemory Swap Space 1024 bytes 4192760 84908 4 FixedDisk / 4096 bytes 117738760 8718286 5 FixedDisk /boot 1024 bytes 101018 22542
  • 20. SNMP: Tables (Storage) Deltics / OSMC SNMP creates an index number for each individual device For example: HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1 HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2 HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3 HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4 HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5 Table variables can be recognized by the index value that NOT equals 0 If a variable is not part of an table, the index value will always be 0.
  • 21. SNMP: Tables (Storage) Deltics / OSMC The index number corresponds with the device number: In this example the .4 corresponds with all information about the / (root) partition. The size is: 117738460 blocks of 4096 bytes: That makes the partition: 117738460 x 4096 / 1024 / 1024 / 1024 = 450GB HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4 HOST-RESOURCES-MIB::hrStorageIndex.5 = INTEGER: 5 HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: / HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /boot HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes HOST-RESOURCES-MIB::hrStorageAllocationUnits.5 = INTEGER: 1024 Bytes HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 117738760 HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 101018
  • 22. SNMP: Tables (Storage) Deltics / OSMC Tables are defined in the MIB files (short example): hrStorageEntry OBJECT-TYPE SYNTAX HrStorageEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A (conceptual) entry for one logical storage area on the host. As an example, an instance of the hrStorageType object might be named hrStorageType.3" INDEX { hrStorageIndex } ::= { hrStorageTable 1 } HrStorageEntry ::= SEQUENCE { hrStorageIndex Integer32, hrStorageType AutonomousType, hrStorageDescr DisplayString, hrStorageAllocationUnits Integer32, hrStorageSize Integer32, hrStorageUsed Integer32, hrStorageAllocationFailures Counter32 }
  • 24. SNMP: Tools (CLI) Deltics / OSMC SNMPGET snmpget -v2c -c public 192.168.1.1 sysContact.0 SNMPWALK snmpwalk -v2c -c public 192.168.1.1 system SNMPSET snmpset -v2c -c secret 192.168.1.1 syscontact.0 string noc@deltics.nl SNMPNETSTAT snmpnetstat -v2c -c public -Ca 192.168.1.1
  • 29. SNMP: SNMPTRAP Deltics / OSMC ● An SNMPTRAP is send by a device when a status change occurs ● A single UPD package on port 162 ● Mostly unreadable by human, just an OID ● Configuration in /etc/snmp/snmptrapd.conf
  • 30. SNMP: SNMPTRAP config Deltics / OSMC Configuration in /etc/snmp/snmptrapd.conf #### authCommunity log,execute public traphandle default /usr/sbin/snmptt #### ● This means the SNMPTRAP is authenticated by a communitystring ● log the details of the notification ● pass the details of the trap to a specified handler program ● All traps are send to the program snmptt
  • 32. SNMP: SNMPTT Deltics / OSMC SNMPTRAP Translator: ● Makes SNMPTRAPS more “Human Readable” ● Define the actions in a config file ● MIB files can be used to create config files (snmpttconvertmib)
  • 33. SNMP: SNMPTT Deltics / OSMC snmpttconvertmib --in=aruba-trap.my --out=snmptt.aruba --exec=”/usr/local/bin/snmptrap.sh $r snmptrap OK “$* $x - $X: $D” This command will convert all traps defined in aruba- trap.my to a snmptt config file called snmptt.aruba with a default action.
  • 34. Deltics / OSMC #!/bin/sh # $1 = host_name (Short name of host that the service is # associated with) # $2 = svc_description (Description of the service) # $3 = state_string (A string representing the status of # the given service - "OK", "WARNING", "CRITICAL" # or "UNKNOWN") # $4 = plugin_output (A text string that should be used # as the plugin output for the service checks) # # Convert the state string to the corresponding return code return_code=-1 case "$3" in OK) return_code=0 ;; WARNING) return_code=1 ;; CRITICAL) return_code=2 ;; UNKNOWN) return_code=-1 ;; esac /usr/bin/printf "%st%st%st%sn" "$1" "$2" "$return_code" "$4" | /usr/sbin/send_nsca 127.0.0.1 -c /etc/nagios/send_nsca.cfg /usr/local/bin/snmptrap.sh
  • 36. How does it work? Deltics / OSMC NMS Router E1 TRAP! /.../snmptrap.sh $r snmptrap-interface CRITICAL "link down" /usr/bin/printf "%st%st%st%sn" "$1" "$2" "$return_code" "$4" | /usr/sbin/send_nsca 127.0.0.1 -c /etc/nagios/send_nsca.cfg Snmptrapd: oid .1.3.6.1.6.3.1.1.5.3