Monday, June 25, 2012

What is ODM?

This is a database that house many information in AIX. The information is categorised in object classes.

ODM Device Configuration Object Classes


A sample list of the ODM Device Configuration Object Classes follows:

PdDv
Predefined Devices

PdCn
Predefined Connection

PdAt
Predefined Attribute

Config_Rules
Configuration Rules

CuDv
Customized Devices

CuDep
Customized Dependency

CuAt
Customized Attribute

CuDvDr
Customized Device Driver

CuVPD
Customized Vital Product Data


A more complete list of the objects are at /etc/objrepos

root@myserver:/> ls /etc/objrepos/
ATM_PVC                 FRUB                    HACMPlogs               HACMPrules              HACMPudresource         SRCnotify
CDiagAtt                FRUB_SRC                HACMPmonitor            HACMPsa                 HACMPx25                SRCodmlock
CDiagAtt.vc             FRUs                    HACMPnetwork            HACMPsa_metadata        HACMPxd_mirror_group    SRCsubsvr
CDiagDev                FRUs_src                HACMPnim                HACMPsdisksubsys        MenuGoal                SRCsubsys
Config_Rules            HACMPadapter            HACMPnode               HACMPserver             PDiagAtt                SWservAt
CuAt                    HACMPcluster            HACMPnpp                HACMPsircol             PDiagAtt.vc             SWservAt.vc
CuAt.vc                 HACMPcommadapter        HACMPoemfilesystem      HACMPsite               PDiagDev                TMInput
CuData                  HACMPcommlink           HACMPoemfsmethods       HACMPsiteinfo           PDiagDev.vc             config_lock
CuData.vc               HACMPcsserver           HACMPoemvgmethods       HACMPsna                PDiagRes                crypto_module
CuDep                   HACMPcustom             HACMPoemvolumegroup     HACMPsp2                PDiagRes.vc             crypto_module.vc
CuDv                    HACMPdaemons            HACMPpager              HACMPspprc              PDiagTask               diag_lock
CuDvDr                  HACMPdisksubsys         HACMPpairtasks          HACMPsr                 PDiagTask.vc            errnotify
CuPath                  HACMPdisktype           HACMPpathtasks          HACMPsvc                PdAt                    history
CuPath.vc               HACMPercmf              HACMPport               HACMPsvcpprc            PdAt.vc                 history.vc
CuPathAt                HACMPercmfglobals       HACMPpprc               HACMPsvcrelationship    PdAtXtd                 inventory
CuPathAt.vc             HACMPevent              HACMPpprcconsistgrp     HACMPtape               PdAtXtd.vc              inventory.vc
CuVPD                   HACMPeventmgr           HACMPras                HACMPtc                 PdCn                    lpp
CuWxt                   HACMPfcfile             HACMPresource           HACMPtimer              PdDv                    lpp.vc
DAVars                  HACMPfcmodtime          HACMPresourcetype       HACMPtimersvc           PdDv.vc                 product
DSMOptions              HACMPfilecollection     HACMPrg_loc_dependency  HACMPtopsvcs            PdPathAt                product.vc
DSMOptions.vc           HACMPgpfs               HACMPrgdependency       HACMPude                PdPathAt.vc
DSMenu                  HACMPgroup              HACMPrresmethods        HACMPudres_def          SRCextmeth


Usage example (Gateway)


Checking number of gateway setup.


If you have more than one gateway listed, may need to remove the extra ones. Here myserver uses only the 10.10.10.254 gateway which is the correct one.

root@myserver:/> odmget -q "attribute=route" CuAt

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,10.10.10.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0


Here's a tip, in case you have more than one gateway, here's how to remove

# chdev -l inet0 -a delroute="net,-hopcount,0,,0,"
Method error (/usr/lib/methods/chginet):
        0514-068 Cause not known.
0821-279 writing to routing socket: The process does not exist.
route: not in table or multiple matches
0821-207 chginet: Cannot add route record to CuAt.


Automatically e-mail error report entries using ODM

We can automatically forward all error report entries to email.

Create a file like this:


    # cat /tmp/you
    errnotify:
      en_name="you"
      en_persistenceflg=1
      en_method="errpt -a -l $1|mail -s \"errpt: $9\" you@my.email.com"


Add this to the ODM:

# odmadd /tmp/you

Now log an entry in the error report:

# errlogger "Where are you?"

You will see in the error report:

# errpt -a
    ----------------------------------------------------
    LABEL:          OPMSG
    IDENTIFIER:     AA8AB241

    Date/Time:       Tue Oct  6 15:57:58 CDT 2011
    Sequence Number: 585
    Machine Id:      0004D6EC4C00
    Node Id:         hostname
    Class:           O
    Type:            TEMP
    Resource Name:   OPERATOR

    Description
    OPERATOR NOTIFICATION

    User Causes
    ERRLOGGER COMMAND

            Recommended Actions
            REVIEW DETAILED DATA

    Detail Data
    MESSAGE FROM ERRLOGGER COMMAND
    Where are you?


Clear the error log again (because we logged a fake test-entry in the error report):

# errclear 0

Watch for the email. You should receive the same error report entry in your email.

By the way, you can delete this from the ODM like this:

# odmdelete -q 'en_name=you' -o errnotify

No comments: