161871Sbostic.\" Copyright (c) 1983, 1991, 1993 261871Sbostic.\" The Regents of the University of California. All rights reserved. 319012Smckusick.\" 443841Strent.\" %sccs.include.redist.man% 519012Smckusick.\" 6*65104Smckusick.\" @(#)rwhod.8 8.2 (Berkeley) 12/11/93 735577Sbostic.\" 847470Scael.Dd 947470Scael.Dt RWHOD 8 1047470Scael.Os BSD 4.2 1147470Scael.Sh NAME 1247470Scael.Nm rwhod 1347470Scael.Nd system status server 1447470Scael.Sh SYNOPSIS 1547470Scael.Nm rwhod 1647470Scael.Sh DESCRIPTION 1747470Scael.Nm Rwhod 1819012Smckusickis the server which maintains the database used by the 1947470Scael.Xr rwho 1 2019012Smckusickand 2147470Scael.Xr ruptime 1 2219012Smckusickprograms. Its operation is predicated on the ability to 2347470Scael.Em broadcast 2419012Smckusickmessages on a network. 2547470Scael.Pp 2647470Scael.Nm Rwhod 2719012Smckusickoperates as both a producer and consumer of status information. 2819012SmckusickAs a producer of information it periodically 2919012Smckusickqueries the state of the system and constructs 3019012Smckusickstatus messages which are broadcast on a network. 3119012SmckusickAs a consumer of information, it listens for other 3247470Scael.Nm rwhod 3319012Smckusickservers' status messages, validating them, then recording 3419012Smckusickthem in a collection of files located in the directory 3547470Scael.Pa /var/rwho . 3647470Scael.Pp 3728717SkarelsThe server transmits and receives messages at the port indicated 3828717Skarelsin the ``rwho'' service specification; see 3947470Scael.Xr services 5 . 4019012SmckusickThe messages sent and received, are of the form: 4147470Scael.Bd -literal -offset indent 4219012Smckusickstruct outmp { 4319012Smckusick char out_line[8]; /* tty name */ 4419012Smckusick char out_name[8]; /* user id */ 4519012Smckusick long out_time; /* time on */ 4619012Smckusick}; 4747470Scael 4819012Smckusickstruct whod { 4919012Smckusick char wd_vers; 5019012Smckusick char wd_type; 5119012Smckusick char wd_fill[2]; 5219012Smckusick int wd_sendtime; 5319012Smckusick int wd_recvtime; 5419012Smckusick char wd_hostname[32]; 5519012Smckusick int wd_loadav[3]; 5619012Smckusick int wd_boottime; 5719012Smckusick struct whoent { 5819012Smckusick struct outmp we_utmp; 5919012Smckusick int we_idle; 6019012Smckusick } wd_we[1024 / sizeof (struct whoent)]; 6119012Smckusick}; 6247470Scael.Ed 6347470Scael.Pp 6419012SmckusickAll fields are converted to network byte order prior to 6519012Smckusicktransmission. The load averages are as calculated by the 6647470Scael.Xr w 1 6719012Smckusickprogram, and represent load averages over the 5, 10, and 15 minute 6828717Skarelsintervals prior to a server's transmission; they are multiplied by 100 6928717Skarelsfor representation in an integer. The host name 7019012Smckusickincluded is that returned by the 7147470Scael.Xr gethostname 2 7228717Skarelssystem call, with any trailing domain name omitted. 7319012SmckusickThe array at the end of the message contains information about 7419012Smckusickthe users logged in to the sending machine. This information 7519012Smckusickincludes the contents of the 7647470Scael.Xr utmp 5 7719012Smckusickentry for each non-idle terminal line and a value indicating the 7828717Skarelstime in seconds since a character was last received on the terminal line. 7947470Scael.Pp 8019012SmckusickMessages received by the 8147470Scael.Xr rwho 8228717Skarelsserver are discarded unless they originated at an 8347470Scael.Xr rwho 8419012Smckusickserver's port. In addition, if the host's name, as specified 8547470Scaelin the message, contains any unprintable 8647470Scael.Tn ASCII 8747470Scaelcharacters, the 8819012Smckusickmessage is discarded. Valid messages received by 8947470Scael.Nm rwhod 9019012Smckusickare placed in files named 9147470Scael.Pa whod.hostname 9219012Smckusickin the directory 9347470Scael.Pa /var/rwho . 9419012SmckusickThese files contain only the most recent message, in the 9519012Smckusickformat described above. 9647470Scael.Pp 9719012SmckusickStatus messages are generated approximately once every 9828717Skarels3 minutes. 9947470Scael.Nm Rwhod 10019012Smckusickperforms an 10147470Scael.Xr nlist 3 10247470Scaelon 10347470Scael.Pa /vmunix 10447470Scaelevery 30 minutes to guard against 10519012Smckusickthe possibility that this file is not the system 10619012Smckusickimage currently operating. 10747470Scael.Sh SEE ALSO 10847470Scael.Xr rwho 1 , 10947470Scael.Xr ruptime 1 11047470Scael.Sh BUGS 11128717SkarelsThere should be a way to relay status information between networks. 11228717SkarelsStatus information should be sent only upon request rather than continuously. 11328717SkarelsPeople often interpret the server dying 114*65104Smckusickor network communication failures 11519012Smckusickas a machine going down. 11647470Scael.Sh HISTORY 11747470ScaelThe 11847470Scael.Nm 11947470Scaelcommand appeared in 12047470Scael.Bx 4.2 . 121