Coyote Point Systems Equalizer Especificaciones Pagina 21

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 22
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 20
Deploying Equalizer with MS Terminal Services
Deployment Guide
© 2010 Coyote Point Systems, Inc. All Rights Reserved. | www.coyotepoint.com 21
27. print "Server agent started on port $port\n";
28.
29. # start a loop to accept Equalizer connections
30. my $client_addr;
31. while ($client_addr = accept(CLIENT, SERVER)) {
32.
33. # find out who connected
34. my ($client_port, $client_ip) = sockaddr_in($client_addr);
35. my $client_ipnum = inet_ntoa($client_ip);
36. # print who has connected as diagnostic
37. print "Connection from: [$client_ipnum]\n" ;
38.
39. # get the server agent response value; default -2
40. # Equalizer interprets the response value as below:
41. # -2 = no status
42. # -1 = service unavailable
43. # 0 = heavy load
44. # 100 = light load
45. my $response = -2;
46. # need to count the number of active connections in the qwinsta
output
47. my $currconn = 0;
48. # need to determine the multiplier or divisor to use when
calculating
49. # the response
50. my $mp = 1;
51. my $dv = 1;
52.
53. # see if there is an MSTS Listen process running
54. my $lstatus = system('qwinsta | find "Listen" > NUL');
55. # if $lstatus = 0 then a Listen process was found
56. # if a Listen process was found, count the Active entries and
57. # calculate an agent response value between -1 and 100;
58. # if a Listen process is not found, return -1 (service down)
59. if ( $lstatus == 0 ) {
60. $currconn = `qwinsta | find /C "Active"`;
61. if ( $maxconn == 100 ) { $response = $currconn;
62. } elsif ( $maxconn < 100 ) {
63. $mp = ( 100 / $maxconn );
64. $response = ( $currconn * $mp );
65. } elsif ( $maxconn > 100 ) {
66. $dv = ( $maxconn / 100 );
67. $response = ( $currconn / $dv );
68. }
69. if ( $response < 0 ) { $response = 0; }
70. else { if ( $response > 100 ) { $response = 100; }
}
71. $response = ( 100 - $response );
72. } else { $response = -1; }
73.
74. # print lstatus and response as diagnostic
75. print "lstatus = ",$lstatus/256,"\n","currconn =
",$currconn,"response = ",$response,"\n" ;
76.
77. # send the response value to Equalizer
Vista de pagina 20
1 2 ... 16 17 18 19 20 21 22

Comentarios a estos manuales

Sin comentarios