Post on 25-Jan-2015
description
LookingUnder The Covers
Using SNMP to peek inside Erlang
About us
Developing a platform for a new breed of social networking gamesScalability is a must Back-end developed with Erlang/OTP
And lots of other good stuffFront-end developed with Flex 4
We
Monitoring
The Expected
Monitoring the Erlang VM
The Fun Stuff
Monitoring your applications' guts
Agenda
SNMP 101SNMP & Erlang
Agent configurationFixed and dynamic custom objectsStandard VM / OTP objects
SNMP 101
Simple Network Management ProtocolIntroduced in 1988Control & MonitoringAnything with an IP addressUsually over UDP port 161v2 is current, v3 is draft
SNMP 101, cont.
SNMP 101, end
SNMP world is a treeWith OIDsAll our Internetare belong to DODYou are 1.3.6.1.4.1.*
SNMP 101, end
Management Information Base (MIB)Define what objects are handled by the agent"Interesting" syntax
nodeName OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "Erlang node name" ::= { staticOid 1 }
SNMP & Erlang
Full SNMP support:
Manager, agent, traps, queries, security...Quickstart:
http://www.trapexit.org/SNMP_Quick_Start
Quicksand:[3,6,1,4,1,193,19]}. % {ericsson otp}
Erlang SNMP Agent
Getting started: Configuration
Add all the agent boiler plate configurationCreate a custom MIB
Consider getting a Private Enterprise NumberCompile .mib to .binCompile .bin to .hrl (optional)
OIDs, default values, ranges
Getting started: Code
application:start(snmp)
snmpa:load_mibs(snmp_master_agent, ["snmp/MY-MIB"])
...
snmp_generic:variable_set(objectName, objectValue)
Getting started: Tools
Command linesnmpwalksnmpget
UItkmib
MonitoringZabbix, Zenoss, Nagios...
GraphingCacti...
Lab Time!
Monitor:nodeNameDisplayString
gaugeValueGauge32
Creating Dynamic Objects
Use tables when OID is not fixedIndexed rows
Dynamic OID composed of ASCII codes
1.3.6.1.4.1.35458.3.70.111.111.1
==
MyOID.Foo.1
SNMP Table: Code
SnmpRow = {Data1, Data2, ..., DataN}
snmpa_local_db:table_create_row( tableName, Index, SnmpRow)
Index being one of Data...Don't forget the .funcs configuration
Lab Time!
Monitor FS usage:/ 74%/dev 1%/var/run 1%
Standard Erlang SNMP
OTPSingle agentTable of all nodes in a clusterGeneral info & stats
OSMONLocal nodeDetailed stats
Good luck to find these MIBs :)
Lab Time!
Monitor Erlang VM:erlNode*OTP-MIB
load*OTP-OS-MON-MIB
Moar Infoz!
Thank you!
Raffle courtesy of
Source codehttp://www.dossot.net/misc/files/erlang-snmp.tar.gz