NetBSD/usr.bin/rpcinfo/rpcinfo.8
2001-12-08 19:12:46 +00:00

356 lines
7.3 KiB
Groff

.\" @(#)rpcinfo.1m 1.23 93/03/29 SMI; from SVr4
.\" Copyright 1989 AT&T
.\" Copyright 1991 Sun Microsystems, Inc.
.\" $NetBSD: rpcinfo.8,v 1.11 2001/12/08 19:12:46 wiz Exp $
.Dd August 18, 1992
.Dt RPCINFO 8
.Sh NAME
.Nm rpcinfo
.Nd report RPC information
.Sh SYNOPSIS
.Nm ""
.Op Fl m Li \&| Fl s
.Op Ar host
.Nm ""
.Fl p Op Ar host
.Nm ""
.Fl T Ar transport
.Ar host Ar prognum
.Op Ar versnum
.Nm ""
.Fl l
.Op Fl T Ar transport
.Ar host Ar prognum
.Op Ar versnum
.Nm ""
.Op Fl n Ar portnum
.Fl u
.Ar host Ar prognum
.Op Ar versnum
.Nm ""
.Op Fl n Ar portnum
.Op Fl t
.Ar host Ar prognum
.Op Ar versnum
.Nm ""
.Fl a Ar serv_address
.Fl T Ar transport
.Ar prognum
.Op Ar versnum
.Nm ""
.Fl b
.Op Fl T Ar transport
.Ar prognum Ar versnum
.Nm ""
.Fl d
.Op Fl T Ar transport
.Ar prognum Ar versnum
.Sh DESCRIPTION
.Nm
makes an RPC call to an RPC
server and reports what it finds.
.Pp
In the first synopsis,
.Nm
lists all the registered RPC services with
.Nm rpcbind
on
.Ar host .
If
.Ar host
is not specified, the local host is the default.
If
.Fl s
is used, the information is displayed in a concise format.
.Pp
In the second synopsis,
.Nm
lists all the RPC services registered with
.Nm rpcbind ,
version 2.
Also note that the format of the information
is different in the first and the second synopsis.
This is because the second synopsis is an older protocol used to
collect the information displayed (version 2 of the
.Nm rpcbind
protocol).
.Pp
The third synopsis makes an RPC call to procedure 0
of
.Ar prognum
and
.Ar versnum
on the specified
.Ar host
and reports whether a response was received.
.Ar transport
is the transport which has to be used for contacting the
given service.
The remote address of the service is obtained by
making a call to the remote
.Nm rpcbind .
.Pp
The
.Ar prognum
argument is a number that represents an RPC program number
If a
.Ar versnum
is specified,
.Nm
attempts to call that version of the specified
.Ar prognum .
Otherwise,
.Nm
attempts to find all the registered version
numbers for the specified
.Ar prognum
by calling version 0,
which is presumed not to exist;
if it does exist,
.Nm
attempts to obtain this information by calling
an extremely high version number instead,
and attempts to call each registered version.
Note:
the version number is required for
.Fl b
and
.Fl d
options.
.Sh OPTIONS
.Bl -tag -width indent
.It Fl T Ar transport
Specify the transport on which the service is required.
If this option is not specified,
.Nm
uses the transport specified in the
.Ev NETPATH
environment variable, or if that is unset or null, the transport
in the
.Xr netconfig 5
database is used.
This is a generic option,
and can be used in conjunction with other options as
shown in the SYNOPSIS.
.Pp
.It Fl a Ar serv_address
Use
.Ar serv_address
as the (universal) address for the service on
.Ar transport
to ping procedure 0
of the specified
.Ar prognum
and report whether a response was received.
The
.Fl T
option is required with the
.Fl a
option.
.Pp
If
.Ar versnum
is not specified,
.Nm
tries to ping all
available version numbers for that program number.
This option avoids calls to remote
.Nm rpcbind
to find the address of the service.
The
.Ar serv_address
is specified in universal address format of the given transport.
.Pp
.It Fl b
Make an RPC broadcast to procedure 0
of the specified
.Ar prognum
and
.Ar versnum
and report all hosts that respond.
If
.Ar transport
is specified, it broadcasts its request only on the
specified transport.
If broadcasting is not supported by any
transport,
an error message is printed.
Use of broadcasting should be limited because of the potential for adverse
effect on other systems.
.Pp
.It Fl d
Delete registration for the RPC service of the specified
.Ar prognum
and
.Ar versnum .
If
.Ar transport
is specified,
unregister the service on only that transport,
otherwise unregister the service on all
the transports on which it was registered.
Only the owner of a service can delete a registration, except the
super-user who can delete any service.
.Pp
.It Fl l
Display a list of entries with a given
.Ar prognum
and
.Ar versnum
on the specified
.Ar host .
Entries are returned for all transports
in the same protocol family as that used to contact the remote
.Nm rpcbind .
.Pp
.It Fl m
Display a table of statistics of
.Nm rpcbind
operations on the given
.Ar host .
The table shows statistics for each version of
.Nm rpcbind
(versions 2, 3 and 4), giving the number of times each procedure was
requested and successfully serviced, the number and type of remote call
requests that were made, and information about RPC address lookups that were
handled. This is useful for monitoring RPC activities on
.Ar host .
.Pp
.It Fl n Ar portnum
Use
.Ar portnum
as the port number for the
.Fl t
and
.Fl u
options instead of the port number given by
.Nm rpcbind .
Use of this option avoids a call to the remote
.Nm rpcbind
to find out the address of the service. This option is made
obsolete by the
.Fl a
option.
.Pp
.It Fl p
Probe
.Nm rpcbind
on
.Ar host
using version 2 of the
.Nm rpcbind
protocol,
and display a list of all registered RPC programs.
If
.Ar host
is not specified, it defaults to the local host.
Note: Version 2 of the
.Nm rpcbind
protocol was previously known as the portmapper protocol.
.Pp
.It Fl s
Display a concise list of all registered RPC programs on
.Ar host .
If
.Ar host
is not specified, it defaults to the local host.
.Pp
.It Fl t
Make an RPC call to procedure 0 of
.Ar prognum
on the specified
.Ar host
using TCP,
and report whether a response was received. This option is made
obsolete by the
.Fl T
option as shown in the third synopsis.
.Pp
.It Fl u
Make an RPC call to procedure 0 of
.Ar prognum
on the specified
.Ar host
using UDP,
and report whether a response was received. This option is made
obsolete by the
.Fl T
option as shown in the third synopsis.
.El
.Sh EXAMPLES
To show all of the RPC services registered on the local machine use:
.Pp
.Bd -literal
example% rpcinfo
.Ed
.Pp
To show all of the RPC
services registered with
.Nm rpcbind
on the machine named
.Nm klaxon
use:
.Pp
.Bd -literal
example% rpcinfo klaxon
.Ed
.Pp
The information displayed by the above commands can be quite lengthy.
Use the
.Fl s
option to display a more concise list:
.Pp
.Bd -literal
example$ rpcinfo -s klaxon
.Ed
.Bl -column "program" "w,x,y,z" "local,tcp,udp,tcp6,udp6" "nlockmgr" "super-user"
.It program Ta version(s) Ta netid(s) Ta service Ta owner
.It 100000 Ta 2,3,4 Ta local,tcp,udp,tcp6,udp6 Ta rpcbind Ta super-user
.It 100008 Ta 1 Ta udp,tcp,udp6,tcp6 Ta walld Ta super-user
.It 100002 Ta 2,1 Ta udp,udp6 Ta rusersd Ta super-user
.It 100001 Ta 2,3,4 Ta udp,udp6 Ta rstatd Ta super-user
.It 100012 Ta 1 Ta udp,tcp Ta sprayd Ta super-user
.It 100007 Ta 3 Ta udp,tcp Ta ypbind Ta super-user
.El
.Pp
To show whether the RPC
service with program number
.Ar prognum
and version
.Ar versnum
is registered on the machine named
.Nm klaxon
for the transport TCP
use:
.Pp
.Bd -literal
example% rpcinfo -T tcp klaxon prognum versnum
.Ed
.Pp
To show all RPC
services registered with version 2 of the
.Nm rpcbind
protocol on the local machine use:
.Bd -literal
example% rpcinfo -p
.Ed
.Pp
To delete the registration for version
1 of the
.Nm walld
(program number 100008 )
service for all transports use:
.Bd -literal
example# rpcinfo -d 100008 1
.Ed
.Pp
or
.Bd -literal
example# rpcinfo -d walld 1
.Ed
.Sh SEE ALSO
.Xr rpc 3 ,
.Xr netconfig 5 ,
.Xr rpc 5 ,
.Xr rpcbind 8