A Dude probing SNMP!Building custom probes andconfiguring equipment usingSNMP with The Dude.Andrea CoppiniAIR Wireless - [email protected]

Agenda Background Overview of SNMP Creating custom probes– Demo Using SNMP to configure devices– DemoDude probing SNMP2

Why? 3rd Party Hardware– The Dude is built with MikroTik RouterOS inmind– . But all networks are heterogenous. Values which are not monitored by default– Temperature & Humidity in an environmentmonitor device– RouterBOARD Voltage on solar setupDude probing SNMP3

Where? Large Conference quick responseLarge Hotspot channel assignmentHospitality enable/disable switchportsRemote PDUs toggle device powerDude probing SNMP4

Overview of Dude . Thank youPatrik!!Dude probing SNMP5

Dude Features Notifications– Run on server check platform and permissions!– Run on client Manual „Tools‟– Run on client only SNMP WalkDude probing SNMP6

Dude Features Custom Probes Built In: dns, cpu, disk,memory, virtualmemory, ping,ftp, gopher,imap4, nntp, ssh, pop3, telnet, sntp.Dude probing SNMP7

SNMP Overview What are.– OID ( think about IP addresses)– MIB ( think about HOSTS file or DNS)– SNMP GET vs SET ( think Read vs Write)– Community Strings Read Only (RO) Read Write (RW) SNMP support in The Dude GET only SNMP SET support via Net-SNMPDude probing SNMP8

Net-SNMP Suite Open source, free to download– Command line SNMP utilities Available for MS Windows, Linux, MacOS SNMP Get and SNMP Walk are built intoThe Dude, we can ignore those. We are interested in SNMP Set toolDude probing SNMP9

SNMP Set Parameters Important bits.USAGE: snmpset [OPTIONS] AGENT OID TYPE VALUE[OID TYPE VALUE].[OPTIONS]: -v 1 2c 3specifies SNMP version to use -c [COMMUNITY]set the community stringDude probing SNMP10

SNMP Set Parameters Important bits.USAGE: snmpset [OPTIONS] AGENT OID TYPE VALUE[OID TYPE VALUE].AGENT: IP address of target deviceOID: OID stringDude probing SNMP11

SNMP Set Parameters Important bits.USAGE: snmpset [OPTIONS] AGENT OID TYPE VALUE[OID TYPE VALUE].TYPE:i INTEGERu unsigned INTEGERt TIMETICKSa IPADDRESSo OBJIDs Stringx HEX StringdbUIFDDECIMAL STRINGBITSunsigned INT64signed INT64FLOATing Point DecimalDOUBLE DecimalDude probing SNMP12

SNMP Set Parameters Important bits.USAGE: snmpset [OPTIONS] AGENT OID TYPE VALUE[OID TYPE VALUE].VALUE Value to set the OID[OID TYPE VALUE] Several different OIDs of the same Agent can be setsimultaneouslyDude probing SNMP13

DEMO 1 Pop up a notification if HDD is almost full– Using built-in hdd usage() function Finding OIDs in MikroTik Reboot router if CPU usage 70%– Must set /snmp community set number write-access yes in RouterOS Send an E-mail if voltage 20 VoltsDude probing SNMP14

Using SNMP Set Get the OID– Use The Dude SNMP Walk, RouterOS „OID‟command or documentation Get the Type– Same Get the allowed values– Use documentation, trial-and-error orcommon sense!Dude probing SNMP15

SNMP in RouterOS Supports RO configuration via GUI or CLI– Most GUI/CLI values are available via SNMP Supports RW configuration via CLI only– Reboot– System Identity– Run ScriptsDude probing SNMP16

Configuring a Tool Tools any executable Many parameters available– But not SNMP Community. Specify this inCustomField1 Runs on Client machine Can be configured for particular devicetypesDude probing SNMP17

DEMO 2 Run a RouterOS script using SNMPDude probing SNMP18

Configuring a Tool - More Tools can be extended further by usingVBScript (or similar) Examples:– Prompt for Frequency– Use a confirmation dialog box “Are You Sure?” OK/Cancel– Avoid storing RW passwords in The Dude Store RO passwd and enter RW passwd manuallyDude probing SNMP19

Summary The Dude will not just report anymore, butit can take action on its own The Dude can be used to do repetitivetasks on on MikroTik and 3rd party devicesquickly and very easily MikroTik RouterOS scripts can be runanytime without touching WinBox or TelnetDude probing SNMP20

Dude probing SNMPThank You!http://mum.mikrotik.comAndrea CoppiniAIR Wireless - [email protected]

A Dude probing SNMP! Building custom probes and configuring equipment using SNMP with The Dude. Andrea Coppini AIR Wireless - Malta [email protected]. Agenda Background Overview of SNMP Creating custom probes –Demo Using SNMP to configure devices –Demo Dude probing SNMP 2. Why?