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