Showing posts with label ODM. Show all posts
Showing posts with label ODM. Show all posts

Sunday, 24 March 2013

Removing ODM information of a logical volume


Sometimes situations occur where a logical volume is deleted, but the ODM is not up to date. E.g. when "lsvg -l" doesn't show you the logical volume, but the lslv command can still show information about the logical volume. Not good.

To resolve this issue, first try:
# synclvodm -v [volume group name]
If that doesn't work, try this: (in the example below logical volume hd7 is used). Save the ODM information of the logical volume:
# odmget -q name=hd7 CuDv | tee -a /tmp/CuDv.hd7.out
# odmget -q name=hd7 CuAt | tee -a /tmp/CuAt.hd7.out
If you mess things up, you can allways use the following command to restore the ODM information:
# odmadd /tmp/[filename]
Delete the ODM information of the logical volume:
# odmdelete -o CuDv -q name=hd7
# odmdelete -o CuAt -q name=hd7
Then, remove the device entry of the logical volume in the /dev directory (if present at all). 

Automatically e-mail error report entries

You can automatically forward all error report entries to your email. This next part describes how to do that. 

Create a file like this:

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

Add this to the ODM:

# odmadd /tmp/mailgeorge


Now log an entry in the error report:

# errlogger "My coffee is cold"

You will see in the error report:

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

Date/Time:       Tue Oct  6 15:57:58 CDT 2009
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
My coffee is cold

Clear the error log again (because we logged a fake test-entry in the error report):
# errclear 0
Watch your 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=mailgeorge' -o errnotify
More info here: http://www.blacksheepnetworks.com/security/resources/aix-error-notification.html.