xref: /original-bsd/usr.sbin/rwhod/rwhod.8 (revision c3e32dec)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)rwhod.8	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt RWHOD 8
10.Os BSD 4.2
11.Sh NAME
12.Nm rwhod
13.Nd system status server
14.Sh SYNOPSIS
15.Nm rwhod
16.Sh DESCRIPTION
17.Nm Rwhod
18is the server which maintains the database used by the
19.Xr rwho 1
20and
21.Xr ruptime 1
22programs.  Its operation is predicated on the ability to
23.Em broadcast
24messages on a network.
25.Pp
26.Nm Rwhod
27operates as both a producer and consumer of status information.
28As a producer of information it periodically
29queries the state of the system and constructs
30status messages which are broadcast on a network.
31As a consumer of information, it listens for other
32.Nm rwhod
33servers' status messages, validating them, then recording
34them in a collection of files located in the directory
35.Pa /var/rwho .
36.Pp
37The server transmits and receives messages at the port indicated
38in the ``rwho'' service specification; see
39.Xr services 5 .
40The messages sent and received, are of the form:
41.Bd -literal -offset indent
42struct	outmp {
43	char	out_line[8];		/* tty name */
44	char	out_name[8];		/* user id */
45	long	out_time;		/* time on */
46};
47
48struct	whod {
49	char	wd_vers;
50	char	wd_type;
51	char	wd_fill[2];
52	int	wd_sendtime;
53	int	wd_recvtime;
54	char	wd_hostname[32];
55	int	wd_loadav[3];
56	int	wd_boottime;
57	struct	whoent {
58		struct	outmp we_utmp;
59		int	we_idle;
60	} wd_we[1024 / sizeof (struct whoent)];
61};
62.Ed
63.Pp
64All fields are converted to network byte order prior to
65transmission.  The load averages are as calculated by the
66.Xr w 1
67program, and represent load averages over the 5, 10, and 15 minute
68intervals prior to a server's transmission; they are multiplied by 100
69for representation in an integer.  The host name
70included is that returned by the
71.Xr gethostname 2
72system call, with any trailing domain name omitted.
73The array at the end of the message contains information about
74the users logged in to the sending machine.  This information
75includes the contents of the
76.Xr utmp 5
77entry for each non-idle terminal line and a value indicating the
78time in seconds since a character was last received on the terminal line.
79.Pp
80Messages received by the
81.Xr rwho
82server are discarded unless they originated at an
83.Xr rwho
84server's port.  In addition, if the host's name, as specified
85in the message, contains any unprintable
86.Tn ASCII
87characters, the
88message is discarded.  Valid messages received by
89.Nm rwhod
90are placed in files named
91.Pa whod.hostname
92in the directory
93.Pa /var/rwho .
94These files contain only the most recent message, in the
95format described above.
96.Pp
97Status messages are generated approximately once every
983 minutes.
99.Nm Rwhod
100performs an
101.Xr nlist 3
102on
103.Pa /vmunix
104every 30 minutes to guard against
105the possibility that this file is not the system
106image currently operating.
107.Sh SEE ALSO
108.Xr rwho 1 ,
109.Xr ruptime 1
110.Sh BUGS
111There should be a way to relay status information between networks.
112Status information should be sent only upon request rather than continuously.
113People often interpret the server dying
114or network communtication failures
115as a machine going down.
116.Sh HISTORY
117The
118.Nm
119command appeared in
120.Bx 4.2 .
121