Tuesday, March 25, 2008

超好用的服务器日志收集分析器ManageEngine EventLog--一把老骨头

超好用的服务器日志收集分析器ManageEngine EventLog--一把老骨头

装过好几款日志收集分析器,但总是不成功,系统管理员负责蛮大,有上百台的服务器需要管理,所以急需一个这样的工具,终于找到了艾德威特的一款产品,ManageEngine EventLog Analyzer,虽然全是E文,但配置起来比较简单,很快进入了试用阶段.
主页地址:http://www.adventnet.com.cn/index.html介绍地址:http://www.adventnet.com.cn/products/eventlog/index.html
最新版本:4.0
下载地址:http://js.down.chinaz.com/Z2006O999/down/ManageEngineEventLogAnalyzer.rar

Saturday, March 15, 2008

[转]Solaris/Linux 命令行 简单手册 | Lfc’s Daily Log

[转]Solaris/Linux 命令行 简单手册 | Lfc’s Daily Log

关于>&2、2>&1等重定向的详细解释,基础教程网

关于>&2、2>&1等重定向的详细解释,基础教程网: "在POSIX shell中,命令的结果可以通过%>的形式来定义(其中%表示文件描述符:1为标准输出stdout、2为标准错误stderr)!系统默认%值是1,也就是1>,而1>可以简写为>,也就是默认为>。而stdout的默认目标是终端(这点不用验证吧)。另外,stderr的默认目标我个人认为也是终端,比如:
#abcddcba
sh: abcddcba: not found.
错误信息显示在终端上(对于telnet、dtterm等,那就说虚拟终端了)。"

Saturday, March 08, 2008

shell 编程之2>&1_一树寒梅白玉条,迥临村路傍溪桥

shell 编程之2>&1_一树寒梅白玉条,迥临村路傍溪桥: "下面通过一个例子来展示2>&1有什么作用:
$ cat test.sh
t
date

test.sh中包含两个命令,其中t是一个不存在的命令,执行会报错,默认情况下,错误会输出到stderr。date则能正确执行,并且输出时间信息,默认输出到stdout
./test.sh > test1.log
./test.sh: line 1: t: command not found

$ cat test1.log
Tue Oct 9 20:51:50 CST 2007

可以看到,date的执行结果被重定向到log文件中了,而t无法执行的错误则只打印在屏幕上。
$ ./test.sh > test2.log 2>&1

$ cat test2.log
./test.sh: line 1: t: command not found
Tue Oct 9 20:53:44 CST 2007

这次,stderr和stdout的内容都被重定向到log文件中了。"

关于>&2、2>&1等重定向的详细解释_Road to OU (Oracle&Unix)

关于>&2、2>&1等重定向的详细解释_Road to OU (Oracle&Unix)

* 2>&1 就是将 stderr 并进 stdout 作输出
* 1>&2 或 >&2 就是将 stdout 并进 stderr 作输出

Wednesday, March 05, 2008

2.4 Special Keys

2.4 Special Keys: "Chapter 2: Getting Started on a UNIX System
2.4 Special Keys

Like all systems, UNIX has a number"

Name

Control Char

Function

erase

DEL or backspace

Erase character. Backspace and erase one character (the key used depends on terminal setting). Sometimes, especially within tcl/tk applications, you must use .

werase

Delete the rightmost word typed in.

kill

Kill (erase) the line typed in so far.[8]

intr

Interrupt the program currently running.

rprnt

Reprint the line typed in so far.

flush

Stops terminal output until you press a key.

susp

Suspend the program currently running and put it in the background. This does not stop the process as it does in VMS!

stop

Stop the display. To resume, press the start key

start

Start the display after stop.

eof

Send the program an end-of-file character.

Tuesday, March 04, 2008

Linux 一句话精彩问答基础知识 - Linux Unix As400

Linux 一句话精彩问答基础知识 - Linux Unix As400: "在有scsi硬盘的计算机上,如果用上面的命令挂载usb闪存,则会mount到/boot分区。这种情
况,应该先用fdisk -l /dev/sd? 来看看到底usb闪存盘是在哪个设备下(通常会是sdb或者sdc)。
比如某台机器上,就是在sdc1 上面。
所有/etc/fstab 内容 mount -a 指定文件格式'-t 格式', 格式可以为vfat, ext2, ext3 等.
访问DVD mount -t iso9660 /dev/dvd /mnt/cdrom 或mount -t udf /dev/dvd /mnt/cdrom
注意:dvd 的格式一般为iso9660 或udf 之一
1006 在vmware 的LINUX 中使用本地硬盘的FAT 分区
将本地的FAT 分区共享,然后在VMWARE 中使用SMBFS 挂上。可以将如下的行放到
/etc/fstab 中:"

homework #1 set environment

-bash-3.00$ vi homework-1
CS385 Homework Assignment 1a
Subject: customize shell environment start up configuration file(s)
Due Date: Mar. 4, 2008

A. Study and understand each entry in the ".cshrc" and ".tcshrc" (if applicable) under your UNIX home directory on NPU's Sun workstation systems
B. COPY /cs385/.cshrc.base as your template and refer sample files ".cshrc.sample" and ".tcshrc.sample" under /cs385 on NPU48 (ONLY on NPU48!)
C. Polish your VI editing skill, make sure you are comfortable with cursor movement and vi commands
D. Create a duplicate of your current ".cshrc" file; Open 2nd connection to NPU48; edit ".cshrc" with VI:
i. Clean up unwanted and obsoleted entries such as lpath, extra aliases and comment-out lines
ii. Correct environment variables as appropriate, in particular, PATH, MANPATH, most importatnt function keys such as ERASE, INTERRUPT, STOP, SUSPEND, EOF and KILL; creat your favoriate aliases; add variable such as tabs, umask, filec, tty, noclobber, and history et al. set your prompt so it will display (minimum the following) your login-name, hostname (system name) and current working directory.
iii. Save your changes; execute command "source ~/.cshrc" or equivalent(.) in other shell to configure the file
iv. if no error after execution, you are ok; otherwise, repeate steps i through iii until no error
v. customize your .bash_profile in a way similar to above for .cshrc
E. Turn in a hard copy of your customzied ".cshrc" and ".bash_profile" file plus a soft copy to NPU48:/cs385/hmwk/hmwk-1 with a unique name such as "your-unix-login-name.cshrc" and "your-unix-login-name.bash_profile"

F. These who copy AND allow-others-to-copy their homework will get NULL for sure.

======Optional Bonus Questions ======
locate the ssh program embeded finger-print file for security keies on your Windows desktop


when finish:
1.soft.copy-> npu48: /cs385/hmwk/hmwk-1 with unique name.
2.hand.copy-> TA.


1..cshrc npu3 .33 for try csh






[npu3:/home/hanyunfan] cat .cshrc |more
# @(#)Cshrc 1.6 03/03/08 Frank
#################################################################
#
# .cshrc file
#
# For homework of cs385
# C-Shells
#
#################################################################

# Set Core Dump Size
limit coredumpsize 0k

set path = (~ $lpath ~/bin /usr/local/bin /usr/local/netscape /usr/ucb /usr/bin /usr/etc)
setenv MANPATH (/usr/man /usr/local/man)
setenv TERM=vt100
stty erase '^H' kill '^U' intr '^C' eof '^D' stop '^S' suspend '^z'

alias cd 'cd \!*;echo $cwd'
alias cp 'cp -i'
alias mv 'mv -i'
alias rm 'rm -i'
alias pwd 'echo $cwd'
alias h 'history \!* | head -39 | more'
alias dir 'ls'
alias pdw 'echo $cwd'
alias la 'ls -a'
alias ls 'ls -GF'

set ignoreeof # in case of ctrl+d
set noclobber # do not rewite exist file
set history=100
set savehist=40
set filec
set autolist
#set prompt="$USER@'hostname',<$cwd>:"
set prompt="%n%u@%m %~:"
umask 022









#.bash_profile
# Set Core Dump Size
limit coredumpsize 0k

export PATH =~:$lpath:~/bin:/usr/local/bin:/usr/local/netscape:/usr/ucb:/usr/bin:/usr/etc
export MANPATH /usr/man:/usr/local/man
set TERM=vt100;exprot TERM
export EDITOR=vi
stty erase '^H' kill '^U' intr '^C' eof '^D' stop '^S' suspend '^z'

alias cd 'cd \!*;echo $cwd'
alias cp 'cp -i'
alias mv 'mv -i'
alias rm 'rm -i'
alias pwd 'echo $cwd'
alias h 'history \!* | head -39 | more'
alias dir 'ls'
alias pdw 'echo $cwd'
alias la 'ls -a'
alias ls 'ls -GF'

set ignoreeof # in case of ctrl+d
set noclobber # do not rewite exist file
set history=100
set savehist=40
set filec
set autolist
export PS1="[\u@\h \W]\$"
umask 022

我的.cshrc文件

我的.cshrc文件: "# $FreeBSD: src/etc/root/dot.cshrc,v 1.29 2004/04/01 19:28:00 krion Exp $

#

# .cshrc - csh resource script, read at beginning of execution by each shell

#

# see also csh(1), environ(7).

lias h history 25

alias j jobs -l

alias la ls -a

alias lf ls -FA

alias ll ls -lA

alias lls ls -G

# A righteous umask

umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.4.2/bin /usr/local/jdk1.4.2/jre/bin $HOME/bin)

setenv EDITOR ee

setenv PAGER more

setenv BLOCKSIZE K

setenv LANG zh_CN.eucCN

setenv LC_ALL zh_CN.eucCN

setenv LC_CTYPE zh_CN.eucCN

setenv JAVA_HOME /usr/local/jdk1.4.2

setenv CLASSPATH .:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/jre

setenv XMODIFIERS @im=fcitx

if ($?prompt) then

# An interactive shell -- set some stuff up

set prompt = '%B%m@%n[%/]# '

set filec

set history = 100

set savehist = 100

set mail = (/var/mail/$USER)

if ( $?tcsh ) then

bindkey '^W' backward-delete-word

bindkey -k up history-search-backward

bindkey -k down history-search-forward

endif

endif"

CSH Multiline prompt Linux on your way - Powered by Sablog-X

CSH Multiline prompt Linux on your way - Powered by Sablog-X: "# %B begin bold
# %b end bold
# %{ begin control escape
# %} end control escape, cannot be the last in prompt
# %m hostname, without domain
# %/ current directory
# %D day in dd format
# %W month in mm format
# %Y year in yyyy format
# %l tty
# %P time in 24 hour format
# %h history number"