基于ITM 6.1的Compaq/DEC Tru64 系统监控的Universal Agent实现

该solution使用ITM 6.1 Universal Agent进行Compaq/DEC Tru64 操作系统的健康状况监控。
它能够提供以下内容的监控:
1、Compaq/DEC Tru64系统buffer caches的正确、错误采样。
2、CPU当前负载
3、虚拟内存与swap交换分区
4、文件系统使用情况
5、当前活动进程
6、当前活动用户
7、系统内存使用情况
8、各个硬件传感器的探测:风扇、电源、电压、温度

ITM 6.1 Universal Agent能够在支持UA的系统平台上远程监控目标系统Tru64 OS,使用SNMP v1方式。

该solution工作在在ITM 6.1和OMEGAMON 技术框架下,它能够运行在不同的系统平台的Universal Agent下,包括Windows, AIX, Solaris, HP/UX, and Linux. 

安装过程:
1、确保你的Universal Agent环境的系统SNMP协议以安装并激活。
2、如果未安装了SNMP,请在安装完成后重新启动Universal Agent。
3、导入元数据compaq_tru64.mdl,该mdl文件位于<install dir>/tmaitm6/metafiles directory
4、导入方法:
 windows:使用命令行:kumpcon import compaq_tru64.mdl
 unix:使用命令行:bin/kumpcon import compat_tru64.mdl或者直接在um控制台运行import命令。
5、一旦你成功导入元数据文件,接下来你必须启动monitoring并且配置SNMP设置。
 (1)在已经启动的UA上,登录到UA tree,鼠标右键选择“Monitor Start”
 (2)填写2个字段(主机名,循环时间)
 以上操作是默认的假设SNMP community为public方式,如果你使用自定义的其他community,请修改:
  [1]在登录入口重新填写“hostname community”
  或者:
  [2]在当前工作目录中编辑KUMSMIBI ,改变默认public为你自定义的community名称。
 (3)然后选择适当的目的文件,比如:TRU6400。
6、、一旦Universal Agent已经启动并运行,你就能够自定义监控问题及场景。
  
  
该解决方案的核心是:compaq_tru64.mdl 文件

该文件的实现源代码由三个mib文件组成。
标准MIB都是以RFC文档的形式发布的,RFC文档虽然是纯文本格式,但是它有页眉和页脚的信息,在包含MIB定义的文档里面通常还有一些说明性的文字,这个脚本就是把这些MIB文件不需要的信息去除,生成MIB文件。
MIB文件有自己的语法格式,称作ASN.1格式,部分编辑器支持这种格式。对于不同的功能/模块,MIB也不相同,于是IETF就制定了一个又一个的MIB文件,这些MIB定义也以RFC文档的格式发布,但是以这种格式发布的MIB文件不能直接通过编译器的编译,需要把中间的MIB定义抽取出来。

svrSystem.mib
svrMgt.mib
pm.mib

以下是这三个文件中的核心代码部分:
svrSystem.mib

 SVRSYS-MIB DEFINITIONS ::= BEGIN


 IMPORTS
     mgmt, enterprises, NetworkAddress, IpAddress, Counter, Gauge, TimeTicks
  FROM RFC1155-SMI
     OBJECT-TYPE
  FROM RFC-1212
     DisplayString
  FROM RFC1213-MIB;

  -- DEC-MIB { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) 36 }
  -- EMA-MIB { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) 36 2 }

     dec OBJECT IDENTIFIER ::= { enterprises 36 }
     ema OBJECT IDENTIFIER ::= { dec 2 }

  -- textual conventions for types

 KBytes ::= INTEGER

 BusTypes ::= INTEGER {
   unknown(1) ,
   other(2) ,
   systemBus(3) ,
   isa(4) ,
   eisa(5) ,
   mca(6) ,
   turbochannel(7) ,
   pci(8) ,
   vme(9) ,
   nuBus(10) ,
   pcmcia(11) ,
   cBus(12) ,
   mpi(13) ,
   mpsa(14) ,
   usb(15)
      }

 SystemStatus ::= INTEGER {
   unknown(1),
   ok(2) ,
   warning(3) ,
   failed(4)
      }


 --  This Octet String is presented least-significant byte first.
 MemoryAddress ::= OCTET STRING (SIZE (8))

 ThermUnits ::= INTEGER {
   unknown(1) ,
   other(2) ,
   degreesF(3) ,
   degreesC(4) ,
   tempRelative(5)
      }

 PowerUnits ::= INTEGER {
   unknown(1) ,
   other(2) ,
   milliVoltsDC(3) ,
   milliVoltsAC(4) ,
   voltsDC(5) ,
   voltsAC(6) ,
   milliAmpsDC(7) ,
   milliAmpsAC(8) ,
   ampsDC(9) ,
   ampsAC(10) ,
   relative(11) 
      }

 Boolean ::= INTEGER {
   true(1) ,
   false(2)
      }

 --  Digital MIB extensions for base system configuration & state information
 --  environmental state information
 --

 mib-extensions-1                 OBJECT IDENTIFIER ::= { ema 18 }
 svrSystem                        OBJECT IDENTIFIER ::= { mib-extensions-1 22 }
 svrBaseSystem                    OBJECT IDENTIFIER ::= { svrSystem 1 }

  -- groups in svrsys

 svrSysMibInfo                   OBJECT IDENTIFIER ::= { svrBaseSystem 1 }
 svrBaseSysDescr                 OBJECT IDENTIFIER ::= { svrBaseSystem 2 }
 svrProcessors                   OBJECT IDENTIFIER ::= { svrBaseSystem 3 }
 svrMemory                       OBJECT IDENTIFIER ::= { svrBaseSystem 4 }
 svrBuses                        OBJECT IDENTIFIER ::= { svrBaseSystem 5 }
 svrDevices                      OBJECT IDENTIFIER ::= { svrBaseSystem 6 }
 svrConsoleKeyboard              OBJECT IDENTIFIER ::= { svrDevices 4 }
 svrConsoleDisplay               OBJECT IDENTIFIER ::= { svrDevices 5 }
 svrConsolePointDevice           OBJECT IDENTIFIER ::= { svrDevices 6 }
 svrPhysicalConfiguration        OBJECT IDENTIFIER ::= { svrBaseSystem 7 }
 svrEnvironment                  OBJECT IDENTIFIER ::= { svrBaseSystem 8 }
 svrThermalSystem                OBJECT IDENTIFIER ::= { svrEnvironment 1 }
 svrCoolingSystem                OBJECT IDENTIFIER ::= { svrEnvironment 2 }
 svrPowerSystem                  OBJECT IDENTIFIER ::= { svrEnvironment 3 }

 -- 
 --  svrSysMibInfo
 -- 

 svrSysMibMajorRev OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "The Major Revision of this implementation of the svrSystem MIB. Will
  be 1."
     ::= { svrSysMibInfo 1 }

 svrSysMibMinorRev OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "The minor rev of this implementation of the svrSystem MIB. Will be 0."
     ::= { svrSysMibInfo 2 }

 --  svrBuses
 -- 
 --  Bus & slot information, primarily for EISA and PCI today.
 --  Mandatory.
 --

 svrBusCount OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "Number of buses seen by the system."
     ::= { svrBuses 1 }

 svrBusTable OBJECT-TYPE
     SYNTAX SEQUENCE OF SvrBusEntry
     ACCESS not-accessible
     STATUS mandatory
     DESCRIPTION
  "Each entry represents a bus as seen by the OS."
     ::= { svrBuses 2 }

 svrBusEntry OBJECT-TYPE
     SYNTAX SvrBusEntry
     ACCESS not-accessible
     STATUS mandatory
     DESCRIPTION
  "Entry describing a single bus."
     INDEX    {
       svrBusIndex
       }
     ::= { svrBusTable 1 }


 --  svrConsoleDisplay
 -- 

 svrVideoHrIndex OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "Index in Host Devices table. 0 if unknown."
     ::= { svrConsoleDisplay 1 }

 svrVideoDescr OBJECT-TYPE
     SYNTAX  DisplayString
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "Text description supplied by OS"
     ::= { svrConsoleDisplay 2 }

 svrVideoXRes OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "X-axis resolution."
     ::= { svrConsoleDisplay 3 }

 svrVideoYRes OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "Y-axis resolution."
     ::= { svrConsoleDisplay 4 }

 svrVideoMemory OBJECT-TYPE
     SYNTAX  KBytes
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
  "Amount of video memory available or in use, in KBytes."
     ::= { svrConsoleDisplay 8 }
       ......
      
svrMgt.mib

 IMPORTS
     mgmt, enterprises, NetworkAddress, IpAddress, Counter, Gauge, TimeTicks
         FROM RFC1155-SMI
     OBJECT-TYPE
         FROM RFC-1212
     DisplayString
         FROM RFC1213-MIB;
 
 
 -- DEC-MIB { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) 36 }
 
 dec OBJECT IDENTIFIER ::= { enterprises 36 }
 ema OBJECT IDENTIFIER ::= { dec 2 }
 
 
 -- textual conventions for types
 
 Boolean ::= INTEGER {
                 true(1) ,
                 false(2)
             }
 
 --  Describes the possible SNMP error codes. Used when svrThrStatus == rowError.
 SnmpErrors ::= INTEGER {
                 noError(1) , --  Status = success
                 tooBig(2) , --  Trying to reference an invalid oid, out of range problem ...
                 readonly(3) , --  Trying to do an operation on a read-only attribute
                 genericError(4) ,
                 noSuchName(5) , --  Possibly an invalid oid.
                 badValue(6)
             }
 Severity ::= INTEGER {
                 high(1) ,
                 medium(2) ,
                 low(3) ,
                 informational(4)
             }
 --  Instrumentation of the server management agent, hardware & firmware.
 mib-extensions-1                 OBJECT IDENTIFIER ::= { ema 18 }
 svrSystem                        OBJECT IDENTIFIER ::= { mib-extensions-1 22 }
 svrMgt                           OBJECT IDENTIFIER ::= { svrSystem 2 }
 
 
  -- groups in svrmgt
 
 svrMgtMibInfo                   OBJECT IDENTIFIER ::= { svrMgt 1 }
 svrAlarms                       OBJECT IDENTIFIER ::= { svrMgt 2 }
 svrControl                      OBJECT IDENTIFIER ::= { svrMgt 3 }
 
 -- 
 --  svrMgtMibInfo
 -- 
 --  Current state of this MIB module.
 --  Mandatory.
 
 svrMgtMibMajorRev OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
         "Major revision of this MIB.  Should equal 1."
     ::= { svrMgtMibInfo 1 }
 
 svrMgtMibMinorRev OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
         "Minor revision of this mib. Should be 0."
     ::= { svrMgtMibInfo 2 }
 
 -- 
 --  svrAlarms
 -- 
 --  Group describing locally-generated alarms and their disposition.
 
 svrAlarmNextThrIndex OBJECT-TYPE
     SYNTAX  INTEGER
     ACCESS  read-only
     STATUS  mandatory
     DESCRIPTION
         "Next available index for creating a svrThrEntry. If the value is -1
          then the maximum number of thresholds has been reached. This means
          that a threshold record can not be created until a current threshold
          record is deleted. "
     ::= { svrAlarms 1 }
 
 svrAlarmEnableTraps OBJECT-TYPE
     SYNTAX  Boolean
     ACCESS  read-write
     STATUS  mandatory
     DESCRIPTION
         "If true, trap will be sent for each triggered alarm."
    ::= { svrAlarms 2 }
    .......
   
pm.mib
 
 IMPORTS
 
  Counter32, Gauge32, TimeTicks,
  OBJECT-TYPE, DisplayString, Counter64   FROM SNMPv2-SMI
  ;
 
  dec           OBJECT IDENTIFIER ::= { iso org(3) 24 }
  pm            OBJECT IDENTIFIER ::= { dec 11 } -- DEC Performance Metrics Registry
 
  pmgrd-2-0-module MODULE-IDENTITY
    LAST-UPDATED ": 1998/02/05 19:11:35 $"
    ORGANIZATION "Compaq Computer Corporation"
    CONTACT-INFO "Postal:    Peformance Manager for Digital UNIX Feedback"
    DESCRIPTION "Module describing general Digital UNIX MIB objects.
                MIB source file info: : pm-mib,v 1.1.3.1 1999/02/05 19:11:35 brownee Exp $"
       ::= { dec 10 }
 
 
 -- ===================================================================
 -- BEGIN IN-FILE TEXTUAL CONVENTIONS
 -- ===================================================================
 
 -- Will never exceed a maximum value of (2^64 - 1)
 EncodedUInt64     ::= TEXTUAL-CONVENTION
         STATUS current
         DESCRIPTION "Unsigned 64-bit INTEGER as 8 bytes in (network byte order)"
         SYNTAX OCTET STRING (SIZE (8))
 
 -- Will never exceed a maximum value of [-2^63 ... 2^63 - 1]
 EncodedInt64     ::= TEXTUAL-CONVENTION
         STATUS current
         DESCRIPTION "Signed 64-bit INTEGER as 8 bytes in (network byte order)"
         SYNTAX OCTET STRING (SIZE (8))
 
 -- a truth value (snarfed from RFC 1514)
 Boolean ::= TEXTUAL-CONVENTION
         STATUS current
         DESCRIPTION "Represents a boolean value."
         SYNTAX INTEGER { true(1), false(2) }
 
 
 -- Represent floating point numbers as integers
 EncodedUFloat ::= TEXTUAL-CONVENTION
         STATUS current
         DESCRIPTION "A non-negative floating point value, measured in units of 0.01."
         SYNTAX INTEGER (0..2147483647)
 
 
 -- In-lieu of Counter64 which is not yet supported
 UInt64          ::= TEXTUAL-CONVENTION
         STATUS current
         DESCRIPTION "[sic] currently drops high-order 32 bits"
         SYNTAX Counter32
 
 -- ===================================================================
 -- END IN-FILE TEXTUAL CONVENTIONS
 -- ===================================================================
 --
 
  pmPrivate      OBJECT IDENTIFIER ::= { pm 1 }          -- PM private root
  advfsPrivate   OBJECT IDENTIFIER ::= { pm 2 }          -- AdvFS private root
 
 -- ==========================================================================
 -- MIBs defined in this file
 -- ==========================================================================
 
  pmCommon       OBJECT IDENTIFIER ::= { pmPrivate 1 }  -- Common MIB
  pmAlphaDigitalUNIX     OBJECT IDENTIFIER ::= { pmPrivate 2 }  -- Alpha Digital UNIX specific MIB
 
 --
 -- ==========================================================================
 -- pmCommon MIB
 -- ==========================================================================
 
 -- groups in pmCommon
 
  pmCmSystem             OBJECT IDENTIFIER ::= { pmCommon 1 }  -- pmCmSystem group
 -- pmCmCpu              OBJECT IDENTIFIER ::= { pmCommon 2 }  ==  pmCmCpu group
  pmCmIo                 OBJECT IDENTIFIER ::= { pmCommon 3 }  -- pmCmIo group
  pmCmProcesses          OBJECT IDENTIFIER ::= { pmCommon 4 }  -- pmCmProcesses group
  pmCmVirtualMemory      OBJECT IDENTIFIER ::= { pmCommon 5 }  -- pmCmVirtualMemory group
  pmCmFileSystem         OBJECT IDENTIFIER ::= { pmCommon 6 }  -- pmCmFileSystem group
  pmCmOncRpc             OBJECT IDENTIFIER ::= { pmCommon 7 }  -- pmCmOncRpc group
  pmCmNfs                OBJECT IDENTIFIER ::= { pmCommon 8 }  -- pmCmNfs group
  pmCmIo64               OBJECT IDENTIFIER ::= { pmCommon 9 }  -- pmCmIo64 group
  -- pmCmInterfaces      provided by mib-2.interfaces
  -- pmCmIp              provided by mib-2.ip
  -- pmCmIcmp            provided by mib-2.icmp
  -- pmCmUdp             provided by mib-2.udp
  -- pmCmTcp             provided by mib-2.tcp
 
 -- the pmCmSystem Group
 
  pmCmSysProcessorType OBJECT-TYPE
                 SYNTAX INTEGER {
                   other (1),
                   alpha (2),
                   sparc (3),
                   hp9000-700 (4),
                   rs6000 (5)
                   }
                 MAX-ACCESS read-only
                 STATUS current
                 DESCRIPTION
                 "This node's CPU type.
                 "
         ::= { pmCmSystem 1 }
 
  pmCmSysOperatingSystem OBJECT-TYPE
                 SYNTAX INTEGER {
                   other (1),
                   digital-unix (2),
                   solaris (3),
                   hpux (4),
                   aix (5)
                   }
                 MAX-ACCESS read-only
                 STATUS current
                 DESCRIPTION
                 "This node's operating system.
                 "
         ::= { pmCmSystem 2 }
                .........
               
 


原文链接: http://blog.csdn.net/jaminwm/article/details/1507947

你可能感兴趣的:(基于ITM 6.1的Compaq/DEC Tru64 系统监控的Universal Agent实现)