一些以前积累的Tips

1. HP-UX 11i下使用net-snmp,如snmptrap程序,提示找不到动态库libnetsnmp.sl.6。SHLIB_PATH环境变量已经设置了也不行。

解决办法:用chatr命令检查snmptrap程序,发现首选使用的是静态链接库。用chatr命令更改优先查找SHLIB_PATH就好了,命令如下:

# chatr +s enable +b disable -l /path/to/lib/libnetsnmp.sl.6 snmptrap

2. 启动snmptrap时报错:
IP-MIB: Module not found

IF-MIB: Module not found

TCP-MIB: Module not found

UDP-MIB: Module not found

HOST-RESOURCES-MIB: Module not found

SNMPv2-MIB: Module not found

RFC1213-MIB: Module not found

SNMPv2-SMI: Module not found

NOTIFICATION-LOG-MIB: Module not found

UCD-SNMP-MIB: Module not found

UCD-DEMO-MIB: Module not found

SNMP-TARGET-MIB: Module not found

NET-SNMP-AGENT-MIB: Module not found

SNMP-VIEW-BASED-ACM-MIB: Module not found

SNMP-COMMUNITY-MIB: Module not found

UCD-DLMOD-MIB: Module not found

SNMP-FRAMEWORK-MIB: Module not found

SNMP-MPD-MIB: Module not found

SNMP-USER-BASED-SM-MIB: Module not found

SNMP-NOTIFICATION-MIB: Module not found

SNMPv2-TM: Module not found
原因:需要设置MIBDIRS环境变量

3. 安装Oracle时会出现一些类似下面的字符集警告信息,无关大局但令人不太舒服。
Warning: Missing charsets in String to FontSet conversion

Warning: Cannot convert string "-dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*" to type FontSet

Warning: Missing charsets in String to FontSet conversion

Warning: Cannot convert string "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*" to type FontSet
解决办法:$ export LC_CTYPE=C.iso88591

4. 使用ps命令时如何查看进程的其他信息?

使用如下命令可以返回指定的信息
# UNIX95= ps -eo 'vsz pid args' |sort -nr |head -20
# UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk4

5. 如何得到HostID?

# echo `/bin/uname -i` 16op | dc

http://www.synopsys.com/support/keys/hostid.html#hpux

6. 启动CDE时报错:

The desktop messaging system could not be started

原因:/etc/resolv.conf设置了DNS服务器,但没有/etc/nsswitch.conf文件。

解决方法:
# cp /etc/nsswitch.files /etc/nsswitch.conf
并修改/etc/nsswitch.conf,把

hosts: dns [NOTFOUND=return] nis [NOTFOUND=return] files

改成

hosts: files dns [NOTFOUND=return] nis [NOTFOUND=return]