RFC for Implement SNMP trap on openBMC.

Ratan Gupta ratagupt at linux.vnet.ibm.com
Sat Mar 17 22:47:15 AEDT 2018


Hi All,

I am working on the 
issue(https://github.com/openbmc/openbmc/issues/3002) to Implement SNMP 
trap notification support on openBMC.
I would be explaining a rough idea of how we plan to go about.
Please share your thoughts and feedback on this proposal.

Requirement:- Enable support for SNMP trap notification on openbmc.
               Currently the requirement is to send the SNMP trap in the 
following cases
               1) Whenever the error log gets created.
               2) Whenever the BMC state changes to runtime.

NOTE:- In future We would extend the support of sending trap in other 
use cases.
               1) Sending the sensor telemetry data.
               2) Application specific use cases.
                    eg:- Multiple Authentication failure.

Configurable Trap Parameters
===================

1) Manager IP
2) Interested Trap types
     Notice
         Warning
         Critical


How to configure the SNMP Manager IP on bmc?

- Through REST (and hence D-Bus) API

We can define the MIB structure depending on the eventType

eg

==>eventType = ErrorLog

Structure for errorLog MIB
================
AgentIP   :   BMC IP Address
TimeStamp :   Time when the trap generated
deviceName:-  DbusObjectPath
alertLevel:-  Would be given by the config yaml
     Following properties data would be fetched by making Dbus call on 
that object.
ErrorId:
ErrorSeverity:
ErrorMessage:
ErrorAdditionalData{array of key value}:
ErrorResolutionStatus:

===>eventType = Configuration
AgentIP   :   BMC IP Address
TimeStamp :   Time when the trap generated
deviceName:-  DbusObjectPath
alertLevel:-  Would be given by the config yaml
eventMessage:- "BMC state changed"
PropertyName:-
PropertyValue:-

Implement the snmp trap feature
=====================

Currently on openbmc the data is being modeled as D-bus Object so we 
would be
leveraging the capabilities given by the existing 
app(phosphor-Dbus-Monitor) to get the
triggers on following conditions to generate the snmp trap.

1) whenever the new object gets added
       eg error object under /xyz/openbmc_project/Logging

2) There is some property change on the configured D-bus object
       eg Network configuration change.

3) Some property reached a specific value/threshold value.
       eg BMC state change to "poweron" or CPU temperature is > X

NOTE:- There could be cases which is independent on the D-bus object
        eg:- Generate a trap whenever there is multiple authentication 
failure
        We would expose a D-bus api to generate a trap to handle application
        specific use cases.

Config YAML of Phosphor-Dbus-Monitor
========================
- name: create property event
   class: callback
   callback: snmpEvent
   paths: D-bus path group
   properties: Group of interested Properties
   eventSeverity: Notice/Warning/Critical
   eventType: Error log / Sensor / State.
   eventMessage: "User can give the message as per the eventType"
          PropertyChange:- Normal property Change could be eventType as 
Notice eg:- StateChange/Network Configuration change
          PropertyChange would become Warning:- if we have met a 
specific condition on a property
                            eg Proc Temprature > some configured 
temperature value.

Opensource:- NetSnmp
              Comes up with full suite of tools like snmp 
agent,snmptrapd, mib2c, bunch of other tools
              Currently the support is for trap so we need minimal of 
above(libsnmp,mib2c).

Regards

Ratan Gupta



More information about the openbmc mailing list