summary:

Does anybody know how to limit the amount of time that linux
RPC's clnt_create() takes to detect that a host is not
running?


explanation:


I need to monitor a remote unix computer that we cannot control
( ie we can't put our software on this box).  Unix rup/rstat was
suggested, which uses Unix RPC ( and I know the dreaded portmapper).

I have code that is works, but I'm getting a long delay when calling
clnt_create().  You can see this by doing the following:


time rup -h RUP_COMPUTER time rup -h NORUP_COMPUTER time rup -h NO_COMPUTER

where RUP_COMPUTER is a computer running rstatd ( rup server)
      NORUP_COMPUTER is a computer not running rstatd
      NO_COMPUTER is a computer on that is off.

'-h' is due to a redhat rup bug ( in rh9 bugzilla)

here are my results

host with rstatd running, 2 ms.

[EMAIL PROTECTED] stresslinux]$ time rup -h orca
collecting responses...
orca                     up   1 day,   2:53,    load average: 1.46 0.69 0.62

real    0m0.002s
user    0m0.000s
sys     0m0.000s

host with portmapper, but not rstatd, 3 ms.
[EMAIL PROTECTED] stresslinux]$ time rup -h hare
collecting responses...rup: hare: RPC: Program not registered

real    0m0.003s
user    0m0.000s
sys     0m0.010s

host that is turned off - 3001ms.
[EMAIL PROTECTED] stresslinux]$ time rup -h pingo
collecting responses...rup: pingo: RPC: Port mapper failure - RPC: Unable to receive

real    0m3.001s
user    0m0.000s
sys     0m0.000s
[EMAIL PROTECTED] stresslinux]$

The delay is in clnt_create(). I have found no way to control how to set this timeout. There are some manpages for a client_create_timed(), but this is not linux supported. also there is a timeout in clntudp_create(), but this is a timeout for the clnt_call(), not for the create.

The delay is always near 3.0 seconds.  I would like to reduce this
wait, so I can monitor more computers with less time.

Does anybody know how to limit the amount of time that clnt_create() takes
to detect that a host is not running?  This is not restricted to rstat,
any RPC program would have this issue.

interestingly:

[EMAIL PROTECTED] stresslinux]$ telnet pingo 111
Trying 192.168.9.107...
telnet: Unable to connect to remote host: No route to host
[EMAIL PROTECTED] stresslinux]$ time telnet pingo 111
Trying 192.168.9.107...
telnet: Unable to connect to remote host: No route to host

real    0m3.003s
user    0m0.000s
sys     0m0.000s
[EMAIL PROTECTED] stresslinux]$

This is the same 3.0 second wait.



The code, in case anybody is interested, can be found on the redhat cd or rpmfind.net:

rusers-0.17-25.i386.src.rpm

but you will need the server portion to test it.

rusers-server




thanks. b�





--
b�

-----------------------
-- H Brett Bolen
-- TCNi
-- Phone: 919 550-0828
-- eFax : 443 535-8531



--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

Reply via email to