没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
1
The domain model language for
SNMP is SMI.
Code Generation is often used in the context of Model Driven Engineer-
ing (MDE). The prerequisite for effective code generation is a modeling
language that expresses domain concepts effectively. For the SNMP do-
main such a modeling language is the Structure of Management Informa-
tion (SMI). The SMI language is often mixed up with the Abstract Syntax
Notation #1 (ASN.1) though being a domain specific modeling language
which ASN.1 is not.
From the code generation perspective, SMIv1 and also SMIv2 could
have provided more machine readable information about object depen-
dencies and semantics. Nevertheless, the static structure of managed ob-
jects can be fully specified using SMI.
AgenPro is a code generator for
the SNMP domain. It can be ex-
tended and customized through
code generation templates.
SNMP4J-Agent is an application programming interface (API) for the
SNMP command-responder domain. AgenPro generates code for that API
when the SNMP4J-Agent code generation template is used. The code gen-
eration template carries the knowledge about the SNMP4J-Agent API do-
main. Thus, AgenPro can be used with other templates to generate code
for other agent APIs, but it can only generate code for the SNMP domain
because it can process SMI specifications only.
The process from writing the MIB module specification to code gener-
ation and implementing the instrumentation code towards a runnable
agent is illustrated by Figure 1.
SNMP4J-Agent & AgenPro
Instrumentation Guide
Copyright © 2006-2010, Frank Fock. All rights reserved.
SNMP4J-AGENT INSTRUMENTATION GUIDE
2
Figure 1: Schematic representation of the agent implementation
process based on AgenPro code generation.
SNMP4J-AGENT INSTRUMENTATION GUIDE
Instrumentation Basics
3
1 Instrumentation Basics
The instrumentation is the glue code connecting the managed objects gen-
erated by AgenPro with the management information data provided by a
SNMP enabled (sub-)system.
For most use cases, instrumentation code cannot be generated automat-
ically, because MIB specifications do not provide enough machine read-
able information about how to access management information from a
specific sub-system. This is a desired characteristic of MIB specifications,
because it should describe management information structure indepen-
dently from a concrete system implementation.
Use customized code generation
templates to generate instrumen-
tation code for generic manage-
ment information interfaces.
If a sub-system has a generic interface for accessing its management in-
formation then it might be feasible to use a customized code generation
template to let it generate the instrumentation code that maps between
SNMP4J-Agent API and the generic interface. A common approach to ge-
neric instrumentation is discussed in “Generic Instrumentation” on
page 51.
The Java Management Extensions (JMX) framework is one example of
a generic interface to management information. Other examples are pro-
prietary CORBA interfaces and sub-agent protocols like SMUX.
In most cases a generic interface to management information is not
available and the instrumentation code has to be implemented manually.
How this task can be accomplished best using AgenPro in conjunction
with the SNMP4J-Agent API is subject to this guide.
1.1 Management Information Classes
SNMP management information can be assigned to the following class-
es with their static structure illustrated by Figure 2:
Scalar
A scalar object has exactly one instance within a given context. An
object identifying a sub-system, for example, is such a read-only scalar
object. A mutable scalar object is a scalar object supporting read and
write access, like date and time of a system.
Columnar
A columnar object type is a managed object for which none or more
instances may exists in a given context. The network interface name is
one example of the columnar object class. There may be none, one or
more network interfaces in a sub-system. SNMP requires columnar
SNMP4J-AGENT INSTRUMENTATION GUIDE
Management Information Classes
4
objects to be organized in conceptual tables where the instances of a
conceptual row are identified by the same instance identifier also called
index.
As with scalars, there are two types of columnar objects: immutable
and mutable. If at least one columnar object is mutable, then also all
conceptual row instance have to be mutable too. The simplest concep-
tual table implementation uses immutable columnar objects and rows.
Figure 2: SNMP managed object classes as a simplified UML class
diagram.
With the SNMP4J-Agent API scalar managed objects can be implemented
by extending the MOScalar class. Alternatively and preferably, the
MOScalar class is configured instead of extended. But configuration has
its limits, especially for mutable scalars.
Conceptual SNMP Tables can be implemented by implementing the
MOTable interface. In contrast to MOScalar, In contrast to the MOS-
calar class, the MOTable interface is not a concrete class to emphasize
the conceptual background of tables in the SNMP world which gives agent
developers all degrees of freedom for implementing virtual SNMP tables.
The SNMP protocol itself does
not know any table concept. The
table concept is part of the Struc-
ture of Management Information
(SMI).
AgenPro generates instances of the DefaultMOTable class for SMI
tables by default. For almost all use cases, the default table implementation
is sufficient. It supports mutable and read-only tables as well as virtual ta-
bles, where table data is created on demand only.
For virtual table instrumentation one of the table model interfaces
MOTableModel or MOMutableTableModel can be implemented.
AgenPro generates instances of the DefaultMOMutableTableMod-
el class by default, which is a concrete implementation of the MOMu-
tableTableModel interface.
Managed
Object
Scalar
Table
Columnar
Mutable Scalar
Mutable
Columnar
ConceptualRow
*
CellInstance
1
*
Mutable
ConceptualRow
**
SNMP4J-AGENT INSTRUMENTATION GUIDE
Instrumentation Basics
5
All object instances, that the code generated by the AgenPro SNMP4J-
Agent templates creates, are created using a MOFactory instance. The
default implementation of the factory (DefaultMOFactory) creates
the default SNMP4J-Agent implementation classes. Whenever you need
to create instances of your own classes (subclasses), you should not change
the generated instantiation code. Instead, use your own MOFactory in-
stance, which may be derived from the DefaultMOFactory of course.
For more information on using your own
MOFactory see also “Generic
Instrumentation” on page 51.
剩余59页未读,继续阅读
资源评论
- xishizhang2011-10-10谢谢分享,要是有中文版的就更方便了。
- jjjackyjiang2013-07-04英文的,内容不错,多谢分享
- feettrace2013-04-17英文的,要好好看才行
- bethianan2012-09-11英文的,pdf文档,还要慢慢啃啊,要是中文的多好!
xulipeng
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功