home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBII / DEMOS / NOVELL / STATIONS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-12-10  |  2.0 KB  |  70 lines

  1. uses
  2.   eco_novl
  3.   
  4.   ;
  5.  
  6.  
  7. var
  8.   count,
  9.   conntype,
  10.   mystation,
  11.   retcode,
  12.   total,
  13.   logged     : integer;
  14.   filler,
  15.   net_number,
  16.   node_addr,
  17.   hexid,
  18.   datetime,
  19.   socket,
  20.   realname,
  21.   name       :  string;
  22.  
  23.  
  24. begin
  25.   filler := '                                          ';
  26.   total := 0; logged := 0;
  27.   getserverinfo; getstation(mystation,retcode);
  28.  
  29.   { Lets print a header for the top of our report }
  30.   writeln('Connection Information for Server ',serverinfo.name);
  31.   writeln;
  32.   writeln('Station  Net      Node       User Name          Logged in     Real Name');
  33.   writeln('   #   Address   Address                       Date & Time');
  34.   for count := 1 to 79 do write('-'); writeln;
  35.  
  36.   { Lets scan through all posible connection numbers and see who is active }
  37.   for count := 1 to serverinfo.connections_max do begin
  38.     get_internet_address(count,net_number,node_addr,socket,retcode);
  39.     if retcode=0 then begin {if retcode=0 then connection is active}
  40.       getconnectioninfo(count,name,hexid,conntype,datetime,retcode);
  41.       write(' ',count:3,' ');
  42.       write(
  43.         ' ',net_number,':',node_addr,'  ',copy(name+filler,1,15),' ',datetime
  44.       );
  45.        {if name is not blank, then lets see who is logged in}
  46.       if name <> '' then begin
  47.         get_realname(name,realname,retcode);
  48.         writeln('  ',copy(realname+filler,1,16));
  49.       end else writeln;
  50.       inc(total);   {add 1 to total number of connections}
  51.       if name<>'' then inc(logged); {add 1 to total number of logged-in stations}
  52.     end;
  53.   end;
  54.   
  55.   { Now that we have scanned all connection, lets print a summary report }
  56.   writeln;
  57.   write('Maximum Connections Allowed: ',serverinfo.connections_max:4);
  58.   writeln('     Peak Connections Used: ',serverinfo.peak_connections_used);
  59.   write('   Total connections in use: ',total:4);
  60.   writeln('     Total USERS Logged in: ',logged);
  61. end.
  62.  
  63.  
  64.   This is a sample of how the unit can be used to print reports on the status
  65.   of the network.
  66.  
  67.   Last updated:  10 Dec 90
  68.  
  69.   Mark Bramwell.
  70.