在看到介绍omnitty,其称“
linux系统管理员利器,重复劳动必备”,可以批量通过ssh登录多台linux机器,并且多台机器同时执行一样的命令。对于这个功能描述就很吸引人的,所以下来看看。
omnitty:
依赖:rote-0.2.8.tar.gz
我下载的是当前最新版本omnitty-0.3.0.tar.gz,编译安装很正常:
[root@lvs191 tmp]# tar xvfz rote-0.2.8.tar.gz
rote-0.2.8/
rote-0.2.8/makefile.in
rote-0.2.8/copying
rote-0.2.8/configure.ac
rote-0.2.8/readme
rote-0.2.8/demo/
rote-0.2.8/demo/boxshell.c
rote-0.2.8/inject.c
rote-0.2.8/inject_csi.c
rote-0.2.8/inject_csi.h
rote-0.2.8/make-package.sh
rote-0.2.8/rote-config.in
rote-0.2.8/rote.c
rote-0.2.8/rote.h
rote-0.2.8/rote_keymap.c
rote-0.2.8/roteprivate.h
rote-0.2.8/configure
[root@lvs191 tmp]# tar xvfz omnitty-0.3.0.tar.gz
omnitty-0.3.0/
omnitty-0.3.0/makefile.in
omnitty-0.3.0/copying
omnitty-0.3.0/configure.ac
omnitty-0.3.0/readme
omnitty-0.3.0/curutil.c
omnitty-0.3.0/curutil.h
omnitty-0.3.0/help.c
omnitty-0.3.0/help.h
omnitty-0.3.0/machine.c
omnitty-0.3.0/machine.h
omnitty-0.3.0/machmgr.c
omnitty-0.3.0/machmgr.h
omnitty-0.3.0/main.c
omnitty-0.3.0/make-package.sh
omnitty-0.3.0/menu.c
omnitty-0.3.0/menu.h
omnitty-0.3.0/minibuf.c
omnitty-0.3.0/minibuf.h
omnitty-0.3.0/omnitty.1
omnitty-0.3.0/todo
omnitty-0.3.0/changelog
omnitty-0.3.0/configure
[root@lvs191 tmp]# cd rote-0.2.8
[root@lvs191 rote-0.2.8]# ./configure
checking for gcc... gcc
checking for c compiler default output file name... a.out
checking whether the c compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the gnu c compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ansi c... none needed
checking how to run the c preprocessor... gcc -e
checking for egrep... grep -e
checking for ansi c header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to c99... yes
checking for _bool... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for initscr in -lncurses... yes
checking for forkpty in -lutil... yes
checking for memset... yes
checking for select... yes
checking for setenv... yes
checking for stdlib.h... (cached) yes
checking for gnu libc compatible malloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for an ansi c-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking for inline... inline
checking for pid_t... yes
checking return type of signal handlers... void
configure: creating ./config.status
config.status: creating makefile
config.status: creating rote-config
[root@lvs191 rote-0.2.8]# make gcc -g -o2 -wall -fpic -mm inject.c inject_csi.c rote.c rote_keymap.c >.depends gcc -g -o2 -wall -fpic -c -o inject.o inject.c gcc -g -o2 -wall -fpic -c -o inject_csi.o inject_csi.c gcc -g -o2 -wall -fpic -c -o rote.o rote.c gcc -g -o2 -wall -fpic -c -o rote_keymap.o rote_keymap.c gcc -g -o2 -wall -fpic -shared -o librote.so.0.2.8 -wl,-soname=librote.so.0 inject.o inject_csi.o rote.o rote_keymap.o -lutil -lncurses [root@lvs191 rote-0.2.8]# make install mkdir -p /usr/local/include/rote rm -f /usr/local/include/rote/*.h cp rote.h /usr/local/include/rote mkdir -p /usr/local/lib cp librote.so.0.2.8 /usr/local/lib cd /usr/local/lib && ln -sf librote.so.0.2.8 librote.so cd /usr/local/lib && ln -sf librote.so.0.2.8 librote.so.0 chmod 755 rote-config mkdir -p /usr/local/bin cp -p rote-config /usr/local/bin ----------------------------------------------------------- rote - our own terminal emulation library v0.2.8
include files installed at: /usr/local/include library files installed at: /usr/local/lib rote-config executable : /usr/local/bin/rote-config
to find out what compiler arguments you should use to compile programs that use rote, use the rote-config program (make sure /usr/local/bin is in your path). ----------------------------------------------------------- [root@lvs191 rote-0.2.8]# cd ../omnitty-0.3.0 [root@lvs191 omnitty-0.3.0]# ./configure checking whether librote is installed... yes checking for gcc... gcc checking for c compiler default output file name... a.out checking whether the c compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the gnu c compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ansi c... none needed checking how to run the c preprocessor... gcc -e checking for egrep... grep -e checking for ansi c header files... yes checking for sys/wait.h that is posix.1 compatible... yes checking for an ansi c-conforming const... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for pid_t... yes checking return type of signal handlers... void checking for strdup... yes configure: creating ./config.status config.status: creating makefile [root@lvs191 omnitty-0.3.0]# make gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -mm curutil.c help.c machine.c machmgr.c main.c menu.c minibuf.c >.depends gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o curutil.o curutil.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o help.o help.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o machine.o machine.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o machmgr.o machmgr.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o main.o main.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o menu.o menu.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -c -o minibuf.o minibuf.c gcc -g -o2 -i/usr/local/include -wall -domnitty_version=\"0.3.0\" -o omnitty curutil.o help.o machine.o machmgr.o main.o menu.o minibuf.o -l/usr/local/lib -lrote [root@lvs191 omnitty-0.3.0]# make install mkdir -p /usr/local/bin cp omnitty /usr/local/bin mkdir -p /usr/local/man/man1 cp omnitty.1 /usr/local/man/man1 [root@lvs191 ~]# omnitty omnitty: error while loading shared libraries: librote.so.0: cannot open shared object file: no such file or directory [root@lvs191 ~]# cat /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/lib/rfmin/lib /usr/lib/icc /usr/local/lib [root@lvs191 ~]# exec ldconfig <碰到很多次了,命令库文件在搜索目录里面,但是不生效,只能强制让他生效>
|
现在可以启动omnitty了。
omnitty的用法还是比较郁闷的,首先f5添加一个主机,添加类似如下“root@172.16.81.191”,然后让你输入密码,登录之后再添加第二个主机,继续添加第n个主机。添加完毕之后,假设有17个主机,可以按f2、f3上下选择不同的主机,在每个主机上面做不同的操作。
如果想批量,在所有主机上都做一个操作,必须按f1,打开菜单,按t选中所有的活动主机,然后按f7启动批量操作功能(右瞎角红色闪烁!!! multicast mode !!!),这时候,你的操作在所有机器上都起作用。可以f2/f3上下切换看看效果。
这个工具还是有很多缺点的:不能保存主机列表(左侧是主机列表),下次启动必须再挨个f5添加;如果链接断了,不能再登录了,只能删除重添加才能登录。有待完善的太多了。
阅读(2396) | 评论(0) | 转发(0) |