LR监控linux之详解rstatd的安装-Zee

简介:
LR监控linux之详解rstatd的安装-Zee
 
 
1.    前期准备:
 
 
1, rstatd 文件解压到要监控的机器上。
2, 打开终端,定位到 rstatd 文件夹下:查看文件夹中的内容如下:

[root@localhost rpc.rstatd]# ls
aclocal.m4    COPYING     Makefile.am    README        rstat_proc.c rup.1
config.h.in   CVS         Makefile.in    rpc.rstatd.8 rstat.x       rup.c
configure     INSTALL     missing        rstatd.8      rsysinfo.1    stamp-h.in
configure.in install-sh mkinstalldirs rstat_main.c rsysinfo.c
 
 
 
2.    执行如下步骤:
 
 
2.1.                   执行:./configure 命令
 
 

[root@localhost rpc.rstatd]# ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gawk... gawk
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets ${MAKE}... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for sys/ioctl.h... yes
checking for syslog.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for ANSI C header files... yes
checking return type of signal handlers... void
updating cache ./config.cache
creating ./config.status
kcreating Makefile
creating config.h
 
 
 
2.2.                   执行:make 命令。
 
 

[root@localhost rpc.rstatd]# make
rm -f rstat.h
rpcgen -h -o rstat.h rstat.x
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rup.c
rup.c: In function  ' ointopoint_v5 ' :
rup.c:256: warning: passing argument 6 of  'c lient->cl_ops->cl_call ' ?from incompatible pointer type
rup.c: In function  ' ointopoint_v3 ' ?
rup.c:292: warning: passing argument 6 of  'c lient->cl_ops->cl_call ' ?from incompatible pointer type
rup.c: In function  'm ain ' ?
rup.c:317: warning: return type of  'm ain ' ?is not  'i nt ' ?rm -f rstat_xdr.c
rpcgen -c -o rstat_xdr.c rstat.x
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rstat_xdr.c
rm -f rstat_clnt.c
rpcgen -l -o rstat_clnt.c rstat.x
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rstat_clnt.c
gcc -g -O2 -o rup rup.o rstat_xdr.o rstat_clnt.o 
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rsysinfo.c
rsysinfo.c: In function  ' ointopoint_v3 ' ?
rsysinfo.c:136: warning: passing argument 6 of  'c lient->cl_ops->cl_call ' ?from incompatible pointer type
rsysinfo.c: In function  'm ain ' ?
rsysinfo.c:160: warning: return type of  'm ain ' ?is not  'i nt ' ?gcc -g -O2 -o rsysinfo rsysinfo.o rstat_xdr.o rstat_clnt.o 
rm -f rstat_svc.c
rpcgen -m -o rstat_svc.c rstat.x
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rstat_svc.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rstat_proc.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c rstat_main.c
rstat_main.c: In function  'm ain ' ?
rstat_main.c:82: warning: return type of  'm ain ' ?is not  'i nt ' ?gcc -g -O2 -o rpc.rstatd rstat_svc.o rstat_xdr.o rstat_proc.o rstat_main.o 
这之后可以执行 :make check检查一下。
 
 
2.3.                   执行:make install 命令。
 
 

[root@localhost rpc.rstatd]# make install
make[1]: Entering directory `/opt/rpc.rstatd'
/bin/sh ./mkinstalldirs /usr/local/bin
 /usr/bin/install -c rup /usr/local/bin/rup
 /usr/bin/install -c rsysinfo /usr/local/bin/rsysinfo
/bin/sh ./mkinstalldirs /usr/local/sbin
 /usr/bin/install -c rpc.rstatd /usr/local/sbin/rpc.rstatd
make[1]: Nothing to be done for `install-data-am'.
make[1]: Leaving directory `/opt/rpc.rstatd'
 
 
2.4.                   执行:./rpc.rstatd 命令。启动rpc服务。
 
 
注:无回显为成功。
 

[root@localhost rpc.rstatd]# ./rpc.rstatd
 
 
 
2.5.                   执行:rpcinfo –p 命令。检查rpc服务的状态.
 
 

[root@localhost rpc.rstatd]# rpcinfo -p
   program vers proto   port
    100000    2   tcp    111 portmapper
    100000    2   udp    111 portmapper
    100024    1   udp    797 status
    100024    1   tcp    800 status
    100001    5   udp    900 rstatd
    100001    3   udp    900 rstatd
    100001    2   udp    900 rstatd
    100001    1   udp    900 rstatd
[root@localhost rpc.rstatd]#
 
 
3.    可能会出现的错误:
 
1,若RPC服务没有成功启动。
2,若目标主机上开启了防火墙,阻挡了RPC服务。
在LR中添加时可能会出现如下错误:

Monitor name :UNIX Resources. Cannot initialize the monitoring on 10.1.200.65. Error while creating the RPC client. Ensure that the machine can be connected and that it runs the rstat daemon (use rpcinfo utility for this verification). Detailed error: RPC: Failed to create RPC client.
RPC-TCP: Failed to establish RPC server address.
RPC-TCP: RPC Server <100001, 3, 17> is not registered on host '10.1.200.65'. (entry point: CFactory::Initialize).   [MsgId: MMSG-47190]
 

Monitor name :UNIX Resources. Internal rpc error (error code:2). Machine: 10.1.200.65. Hint: Check that RPC on this machine is up and running. Check that rstat daemon on this machine is up and running (use rpcinfo utility for this verification). Details: RPC: RPC call failed.
RPC-TCP: recv()/recvfrom() failed.
RPC-TCP: Timeout reached. (entry point: Factory::CollectData). [MsgId: MMSG-47197]
 
至此完毕。

本文出自seven的测试人生公众号最新内容请见作者的GitHub页:http://qaseven.github.io/
目录
相关文章
|
1月前
|
Ubuntu Linux
任何Ubuntu用户都应安装的四大Linux应用程序
当然,这款程序不需要太多介绍。我们面对的是网上最庞大最完整的多媒体中心,由于丰富的插件,我们能够高度细化地定制其每一项功能。这是我们的Linux发行版不可或缺的必备软件。 我们可以通过运行以下命令来轻松安装Kodi:sudo apt install kodi。
|
1月前
|
Ubuntu 物联网 Linux
从零安装一个Linux操作系统几种方法,以Ubuntu18.04为例
一切就绪后,我们就可以安装操作系统了。当系统通过优盘引导起来之后,我们就可以看到跟虚拟机中一样的安装向导了。之后,大家按照虚拟机中的顺序安装即可。 好了,今天主要介绍了Ubuntu Server版操作系统的安装过程,关于如何使用该操作系统,及操作系统更深层的原理,还请关注本号及相关圈子。
|
21天前
|
弹性计算 安全 Linux
阿里云服务器ECS安装宝塔Linux面板、安装网站(新手图文教程)
本教程详解如何在阿里云服务器上安装宝塔Linux面板,涵盖ECS服务器手动安装步骤,包括系统准备、远程连接、安装命令执行、端口开放及LNMP环境部署,手把手引导用户快速搭建网站环境。
|
1月前
|
安全 Ubuntu Linux
如何安装Linux操作系统?
此时,您可以选择重新启动计算机,然后从硬盘上的Linux系统启动。以上是一个大致的安装过程。请注意,不同的Linux发行版可能会在细节上有所差异,因此在进行安装之前,请确保您阅读并理解了相应发行版的安装指南或文档。
|
1月前
|
Ubuntu Linux 数据安全/隐私保护
Win10安装Linux子系统教程!如何在Win10系统中安装Ubuntu!
登录系统后,输入cd /返回上一级,然后再输入“ls”查看一下系统文件目录,看看对不对!
|
1月前
|
Ubuntu Linux Shell
手把手教你安装适用于Linux的Windows子系统——Ubuntu
重启完成,你看看重新打开Ubuntu是不是发生了变化,等待几分钟,系统配置完成,根据提示设置用户名和密码即可
|
1月前
|
存储 Ubuntu Linux
安卓手机免root安装各种Linux系统:Ubuntu, Centos,Kali等
此外还可以安装Slackware、Archstrike等系统,还可以通过github查找方法安装更多有趣的东西。 昨日小编就是通过Termux安装的Kali Linux工具包。
|
1月前
|
Ubuntu 网络协议 Unix
在虚拟机中安装Linux Ubuntu系统指南
通过点击【浏览】按钮,您可以更改Ubuntu的安装位置。为确保系统稳定,建议避免将Ubuntu安装在C盘。您可以在D盘或其他磁盘中创建一个名为“ubuntu”的文件夹,并选择该文件夹作为安装位置,然后点击【下一步】继续。
|
1月前
|
Ubuntu Linux 数据安全/隐私保护
Windows上快速安装Linux子系统Ubuntu
Installing, this may take a few minutes...WslRegisterDistribution failed with error: 0x800701bcError: 0x800701bc WSL 2 ?????????????????? https://aka.ms/wsl2kernelPress any key to continue... 原因是 wsl1 升级到 wsl2 之后,内核却没有升级。 解决:下载最新的wsl安装包(wsl安装包)
|
1月前
|
Ubuntu Unix Linux
玩机强化技能,动手安装Ubuntu Linux操作系统
(13)Ubuntu重启过程中,你将在关机画面中看到提示文字“Please remove the installation medium, then press ENTER:”,按下“Enter”键即可重启电脑。