xref: /netbsd/usr.sbin/rwhod/rwhod.8 (revision bf9ec67e)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     from: @(#)rwhod.8	8.2 (Berkeley) 12/11/93
33.\"	$NetBSD: rwhod.8,v 1.12 2002/02/02 01:47:36 wiz Exp $
34.\"
35.Dd December 11, 1993
36.Dt RWHOD 8
37.Os
38.Sh NAME
39.Nm rwhod
40.Nd system status server
41.Sh SYNOPSIS
42.Nm
43.Sh DESCRIPTION
44.Nm
45is the server which maintains the database used by the
46.Xr rwho 1
47and
48.Xr ruptime 1
49programs.  Its operation is predicated on the ability to
50.Em broadcast
51messages on a network.
52.Pp
53.Nm
54operates as both a producer and consumer of status information.
55As a producer of information it periodically
56queries the state of the system and constructs
57status messages which are broadcast on a network.
58As a consumer of information, it listens for other
59.Nm
60servers' status messages, validating them, then recording
61them in a collection of files located in the directory
62.Pa /var/rwho .
63.Pp
64The server transmits and receives messages at the port indicated
65in the ``who'' service specification; see
66.Xr services 5 .
67The messages sent and received, are of the form:
68.Bd -literal -offset indent
69struct	outmp {
70	char	out_line[8];		/* tty name */
71	char	out_name[8];		/* user id */
72	int32_t	out_time;		/* time on */
73};
74
75struct	whod {
76	char	wd_vers;
77	char	wd_type;
78	char	wd_fill[2];
79	int32_t	wd_sendtime;
80	int32_t	wd_recvtime;
81	char	wd_hostname[32];
82	int32_t	wd_loadav[3];
83	int32_t	wd_boottime;
84	struct	whoent {
85		struct	outmp we_utmp;
86		int32_t	we_idle;
87	} wd_we[1024 / sizeof (struct whoent)];
88};
89.Ed
90.Pp
91All fields are converted to network byte order prior to
92transmission.  The load averages are as calculated by the
93.Xr w 1
94program, and represent load averages over the 5, 10, and 15 minute
95intervals prior to a server's transmission; they are multiplied by 100
96for representation in an integer.  The host name
97included is that returned by the
98.Xr gethostname 3
99function call, with any trailing domain name omitted.
100The array at the end of the message contains information about
101the users logged in to the sending machine.  This information
102includes the contents of the
103.Xr utmp 5
104entry for each non-idle terminal line and a value indicating the
105time in seconds since a character was last received on the terminal line.
106.Pp
107Messages received by the
108.Xr rwho 1
109server are discarded unless they originated at an
110rwho
111server's port.  In addition, if the host's name, as specified
112in the message, contains any unprintable
113.Tn ASCII
114characters, the
115message is discarded.  Valid messages received by
116.Nm
117are placed in files named
118.Pa whod.hostname
119in the directory
120.Pa /var/rwho .
121These files contain only the most recent message, in the
122format described above.
123.Pp
124Status messages are generated approximately once every
1253 minutes.
126.Sh SEE ALSO
127.Xr ruptime 1 ,
128.Xr rwho 1
129.Sh HISTORY
130The
131.Nm
132command appeared in
133.Bx 4.2 .
134.Sh BUGS
135There should be a way to relay status information between networks.
136Status information should be sent only upon request rather than continuously.
137People often interpret the server dying
138or network communication failures
139as a machine going down.
140