Chinaunix首页 | 论坛 | 博客
  • 博客访问: 510696
  • 博文数量: 65
  • 博客积分: 2925
  • 博客等级: 上尉
  • 技术积分: 1306
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-01 10:56
个人简介

2013

文章分类

全部博文(65)

分类: 系统运维

2011-04-11 15:29:51

用alog命令可以查看一下日志:
/var/adm/ras/bootlog
/var/adm/ras/BosMenus.log
/var/adm/ras/bosinst.log
/var/adm/ras/nimlog
/var/adm/ras/conslog
/var/adm/ras/errlog

查看boot log:
root@wjlcnaix:/>alog -o -t boot |more
********** no stdout ***********
****************** no stderr ***********
----------------
Time: 13        LEDS: 0x538
invoking top level program -- "/usr/sbin/lsdev -C -c management -s infiniband -t icm -F name"
Time: 13        LEDS: 0x539
return code = 0
****************** no stdout ***********

通过smit查看
root@wjlcnaix:/var/adm/ras>smit alog

                                                         Show an Alog File

Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
  Alog TYPE                                           nim
  Alog File NAME                                     [/var/adm/ras/nimlog]


                            +--------------------------------------------------------------------------+
                            |                                Alog TYPE                                 |
                            |                                                                          |
                            | Move cursor to desired item and press Enter.                             |
                            |                                                                          |
                            |   boot                                                                   |
                            |   bosinst                                                                |
                            |   nim                                                                    |
                            |   console                                                                |
                            |   cfg                                                                    |
                            |   lvmcfg                                                                 |
                            |   lvmt                                                                   |
                            |   dumpsymp                                                               |
                            |   lvmgs                                                                  |    



root@wjlcnaix:/tmp>date
Fri Apr  1 10:15:46 BEIST 2011
root@wjlcnaix:/tmp>date |alog -f /tmp/wjltest.log

root@wjlcnaix:/tmp>alog -o -f /tmp/wjltest.log
Fri Apr  1 10:20:16 BEIST 2011
root@wjlcnaix:/tmp>ls -l /tmp/wjltest.log
-rw-r--r--    1 root     system         4096 Apr 01 10:20 /tmp/wjltest.log
root@wjlcnaix:/tmp>
root@wjlcnaix:/tmp>echo "resizing log file" |alog -f /tmp/wjltest.log -s 81920
resizing log file
root@wjlcnaix:/tmp>
root@wjlcnaix:/tmp>ls -l /tmp/wjltest.log
-rw-r--r--    1 root     system        81920 Apr 01 10:23 /tmp/wjltest.log
root@wjlcnaix:/tmp>alog -o -f /tmp/wjltest.log
Fri Apr  1 10:20:16 BEIST 2011
resizing log file

要将新的日志类型 kakatest 添加至 alog 配置数据库,请以下列格式创建 kakaalog.add 文件:

SWservAt:
    attribute="alog_type"
    deflt="kakalog"
    value="kakalog"
 

SWservAt:
    attribute="kakalog_logname"
    deflt="/tmp/kakatest.log"
    value="/tmp/kakatest.log"
 

SWservAt:
    attribute="kakalog_logsize"
    deflt="81920"
    value="81920"
 

SWservAt:
    attribute="kakalog_logverb"
    deflt="1"
    value="1"



在创建了 kakaalog.add 文件后,请输入:


odmadd kakaalog.add
这将 alog.add 文件添加至 SWservAt 数据库。
root@wjlcnaix:/tmp>odmadd kakaalog.add
root@wjlcnaix:/tmp>odmget -q "attribute like '*kaka*'" SWservAt

SWservAt:
        attribute = "kakalog_logname"
        deflt = "/tmp/kakatest.log"
        value = "/tmp/kakatest.log"

SWservAt:
        attribute = "kakalog_logsize"
        deflt = "81920"
        value = "81920"

SWservAt:
        attribute = "kakalog_logverb"
        deflt = "1"
        value = "1"

root@wjlcnaix:/tmp>ls -l kaka*
-rw-r--r--    1 root     system          335 Apr 01 10:59 kakaalog.add
-rw-r--r--    1 root     system        81920 Apr 01 10:23 kakatest.log
root@wjlcnaix:/tmp>alog -C -t kakalog -s 4096
root@wjlcnaix:/tmp>echo "changed log size" |alog -t kakalog -s 4096
changed log size
root@wjlcnaix:/tmp>ls -l kaka*
-rw-r--r--    1 root     system          335 Apr 01 10:59 kakaalog.add
-rw-r--r--    1 root     system         4096 Apr 01 11:30 kakatest.log

要在 alog 配置数据库中将日志类型 sample 的日志文件的名称更改为 /var/sample.log,请输入:

alog -C -t sample -f /var/sample.log
要将引导日志的大小改为 8192 字节并在 ODM 中反映新大小,请输入:

alog -C -t boot -s 8192
echo "Changed log size" | alog -t boot -s 8192

阅读(2193) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~