HP-UX 安装 tcpdump
作者:高玉涵
时间:2021.12.16 15:45
博客:blog.youkuaiyun.com/cg_i
环境:HP-UX B.11.31 U ia64
近期工作接触到 HP-UX,因它是面向企业的高级系统,之前对它知之甚少(我想大部分人都不可能自己买个小型机来研究它吧)。日常为排查一例系统故障,需要用到 tcpdump 工具来抓包。不幸运的是,我的机器上没有附带这个工具。无奈下,全网搜索适配的软件和安装方法,过程之艰辛几度让我绝望,好在经过努力问题终得解决,过程遂记之,只为让有需要的朋友不再遭我所受得罪。
首要困难就是 HP-UX 软件国内几乎下载不到,最终,找到这家英国网站提供下载服务 http://hpux.connect.org.uk 。网站上输入要查找的软件包名称,点击搜索即可,大部分软件包都能搜索得到。
图中标 1 数字是软件安装后系统中存储的位置。标 2 数字是软件包文件类型。这里有一个坑!我下载的时候,并没留意这个提示,下载下来的文件是以 .txt 名结尾,如,tcpdump-4.99.1-ia64_64-11.31.depot.txt(.depot HP-UX 软件打包名称),就想当然的把 .txt 去掉后直接进行安装,这时系统报错如下错。
======= 12/16/21 11:23:53 EAT BEGIN swinstall SESSION
(non-interactive) (jobid=xxxxx-0025)
* Session started for user "root@xxxx2".
* Beginning Selection
* Target connection succeeded for "xxxx2:/".
ERROR: Could not contact host
"tcpdump-4.99.1-ia64_64-11.31.depot". Make sure the
hostname is correct and an absolute pathname is specified
(beginning with "/").
* Source connection failed for
"tcpdump-4.99.1-ia64_64-11.31.depot:/var/spool/sw".
WARNING: More information may be found in the daemon logfile on this
target (default location is
tcpdump-4.99.1-ia64_64-11.31.depot:/var/adm/sw/swagentd.log).
* Selection had errors.
======= 12/16/21 11:23:54 EAT END swinstall SESSION (non-interactive)
(jobid=xxxx-0025)
根据提示查看 /var/adm/sw/swagentd.log 日志。
ERROR: tar: /root/tcpdump-4.99.1-ia64_64-11.31.depot : Skipping to
next file...
将 .txt 改为 .gz 最终将文件名为 tcpdump-4.99.1-ia64_64-11.31.depot.gz 并用 gunzip 解包后安装成功。详细命令如下:
mv tcpdump-4.99.1-ia64_64-11.31.depot.txt tcpdump-4.99.1-ia64_64-11.31.depot.gz
gunzip tcpdump-4.99.1-ia64_64-11.31.depot.gz
swinstall 是 HP-UX 安装软件包的命令,一定要带在软件包所在位置的绝对路径。
root> swinstall -s /root/tcpdump-4.99.1-ia64_64-11.31.depot tcpdump
======= 12/16/21 07:13:24 EAT BEGIN swinstall SESSION
(non-interactive) (jobid=xxxx2-0024)
* Session started for user "root@xxxx2".
* Beginning Selection
* Target connection succeeded for "xxxx2:/".
* Source:
/root/tcpdump-4.99.1-ia64_64-11.31.depot
* Targets: xxxx2:/
* Software selections:
tcpdump.tcpdump-RUN,r=4.99.1,a=HP-UX_B.11.31_64
* Selection succeeded.
* Beginning Analysis and Execution
* Session selections have been saved in the file
"/.sw/sessions/swinstall.last".
* The analysis phase succeeded for "xxxx2:/".
* The execution phase succeeded for "xxxx2:/".
* Analysis and Execution succeeded.
NOTE: More information may be found in the agent logfile using the
command "swjob -a log xxxx2-0024 @ xxxx2:/".
======= 12/16/21 07:13:29 EAT END swinstall SESSION (non-interactive)
(jobid=xxxx2-0024)