[Progress Communities] [Progress OpenEdge ABL] Forum Post: Generating protrace files for BUSY web agents

Status
Not open for further replies.
D

Dmitri Levin

Guest
This Perl script will generate protrace files for all BUSY agents of a given broker and save it in a certain directory. We find it useful, so I decided to share. #!/usr/bin/perl # 6/21/2019 Dmitri Levin # This Perl script will collect Progress protrace files for web brokers use strict; # variables must be declared my $main_dir="Enter here a Directory to store protrace files"; if (! -d $main_dir ) { print "Directory $main_dir does not exist\n"; exit 0 } &main_proc; # Main Procedure sub main_proc { my $broker_name="your broker name"; my $broker_temp_dir="workDir for that broker"; &create_wtbman_out( $broker_name ); &check_broker( $broker_name, $broker_temp_dir ); } =item create_wtbman_out() procedure to create wtbman output =cut sub create_wtbman_out { print "process $_[0]\n"; # if directory does not exist then create it if (! -d "$main_dir/$_[0]" ) { system("mkdir $main_dir/$_[0]"); } # you need to have the correct proenv to set $DLC and $PATH here system(". proenv; wtbman -i $_[0] -q >/tmp/wtbman_$_[0]"); } =item check_broker() procedure check_broker will work with a given webspeed broker =cut sub check_broker { my $i; my $pos=0; my $PID; my $filename="/tmp/wtbman_$_[0]\n"; open(FILE,$filename) || die "Can't open $filename : $!\n"; my @lines= ; # all lines my $count=@lines; # We skip first 22 lines and loop the rest looking for BUSY for ($i=22;$i "1000" ) { print "$PID\n"; system("kill -30 $PID"); system("cp $_[1]/protrace.$PID $main_dir/$_[0]"); } } } close(FILE); };

Continue reading...
 
Status
Not open for further replies.
Top