EPICS dev SNMP Extensions Euan Troup Euan Troupcsiro

  • Slides: 10
Download presentation
EPICS dev. SNMP Extensions Euan Troup, Euan. Troup@csiro. au CSIRO Australia Telescope National Facility

EPICS dev. SNMP Extensions Euan Troup, Euan. Troup@csiro. au CSIRO Australia Telescope National Facility ASKAP Project Paul Wild Observatory

What Is dev. SNMP ? • dev. SNMP connects a set of objects on

What Is dev. SNMP ? • dev. SNMP connects a set of objects on a network to an EPICS IOC • SNMP is the Simple Network Management Protocol • Found in routers, switches, embedded devices etc • Provides for set, get and notification messages • Existing version at http: //wwwmks 2. desy. de/content/e 40/e 41/e 12212/index_ger. html • SNMP support based on Net-SNMP API http: //www. netsnmp. org • Earlier versions of dev. SNMP only supported get, now supports SNMP set and notification messages (traps)

A Bit More SNMP • SNMP objects consist of an OID and a value

A Bit More SNMP • SNMP objects consist of an OID and a value • An OID is a numerical string in dotted decimal format such as. 1. 3. 6. 1. 2. 1. 1. 1 • Numeric OIDs are given a more descriptive name using MIB files • MIBS use ASN. 1 to give structure to names • . 1. 3. 6. 1. 2. 1. 1. 1 becomes. iso. org. dod. internet. mgmt. mib 2. system. sys. Descr • OID + value corresponds to EPICS PV name + value • SNMP includes basic data types similar to EPICS data types e. g. integer, octet string… • MIB file parsing is provided by the Net-SNMP library so you can abbreviate above to MIB-2: : sys. Descr

dev. SNMP Features And Extensions • dev. SNMP 1. 03 supports ai, longin, stringin,

dev. SNMP Features And Extensions • dev. SNMP 1. 03 supports ai, longin, stringin, waveform, longin with support for truncated 64 -bit values (Counter 64 SNMP type) • Added support for ao, longout, stringout • Support for I/O Intr processing of trap messages • Supported directly so no need for snmptrapd config • Overhead removed in asynch processing • Original used polling once per second per object • Now transaction only when requested • Can have updates faster than once per second • Explicit SNMP v 1 support • Compile-time option for sending float or double data types directly over SNMP • Tested on Linux & OS X with Net-SNMP 5. 4

dev. SNMP In Practice • Rabbit microcontroller • Analogue and digital I/O for monitor

dev. SNMP In Practice • Rabbit microcontroller • Analogue and digital I/O for monitor & control • Low power mode for data acquisition – low RFI • Wakes up periodically and sends stored data via SNMP trap • (Proposed) DC PSU monitor ATCA crate 4. 5 k. W DC supply with SNMP monitoring

How Do You Use It? • Patched source can be provided by Euan Troup,

How Do You Use It? • Patched source can be provided by Euan Troup, Euan. Troup@csiro. au • Compiles to a support library & soft IOC • Makefile for application needs the following added: USR_CFLAGS += `net-snmp-config --cflags` USR_CFLAGS += -DNETSNMP_NO_INLINE USR_LDFLAGS += `net-snmp-config –libs`

How Do You Use It (2)? • Use field (DTYP, "Snmp") • Instrument I/O

How Do You Use It (2)? • Use field (DTYP, "Snmp") • Instrument I/O setup e. g. field (INP, "@localhost public IFMIB: : if. In. Ucast. Pkts. 1 Counter 32: 11") for ai, longin, stringin and • • • Hostname of remote object SNMP community name MIB name to be converted to OID Data type of object Size of buffer for processing returned value • Same for output records • Add v 1 to end of string for SNMP v 1 support • If omitted defaults to SNMP v 2 c

How Does It Work? • Record processing pass 1 through device support sets record->pact

How Does It Work? • Record processing pass 1 through device support sets record->pact = true, puts device private info on list of active requests, starts an asynch SNMP transaction and sends an epics. Event to asynch read thread • Read thread waits on event which can be sent by any record then processes all outstanding requests using snmp_sess_select_info() call • After calling select() an SNMP callback function or timeout function is triggered • SNMP callback starts an EPICS callback. Request() which starts record processing again and completes pass 2 through device support

How Does It Work (2)? • Trap support creates a separate thread listening on

How Does It Work (2)? • Trap support creates a separate thread listening on udp port 162 or specified using an environment variable • Port 162 is privileged under unix so root or suid executable is required • Records structures for records using I/O Intr scanning are put on a list which is traversed each time a trap is received • Thread receives traps and matches hostnames and OID for active records then uses callback mechanism to process the record • Records can be added or removed from trap processing by changing the SCAN field which uses get_ioint_info() device support function

Possible Future Developments • rbv (readback value) support for ao record • Make traps

Possible Future Developments • rbv (readback value) support for ao record • Make traps with multiple updates of database records atomic • Full support for Counter 64 – probably requires 64 bit record in EPICS