Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
7b6c90c
升级Util::TcpServer,升级tools/shell 不在需要公网地址
lijinfeng2011 Dec 22, 2018
fc3325e
Merge branch 'release-0.0.1' into release-2.0.0
lijinfeng2011 Dec 26, 2018
dfa69e9
修改MYDan版本到2.0.0
lijinfeng2011 Dec 26, 2018
c22f618
把shell改成shellv2,保留旧版本的shell
lijinfeng2011 Dec 26, 2018
4d7efb4
merge release-0.0.1
lijinfeng2011 Jan 3, 2019
1f6376e
添加fastmd5工具,用于快速计算文件md5
lijinfeng2011 Jan 24, 2019
6125690
同步文件使用fastmd5
lijinfeng2011 Jan 24, 2019
8354584
Util::FastMD5添加read 和seek失败判断
lijinfeng2011 Jan 25, 2019
4bdd5aa
发布0.1.57到cpan.org
lijinfeng2011 Jan 25, 2019
3e196c7
agent/code/scripts pkill所有scripts插件启动的所有进程
lijinfeng2011 Jan 25, 2019
8236da7
发布0.1.58到cpan.org
lijinfeng2011 Jan 25, 2019
28097b0
fix 通过代理load文件时候没有filecache报错
lijinfeng2011 Jan 25, 2019
eac6762
修改etc/agent/proxy 避免和真实使用的ip相撞
lijinfeng2011 Jan 25, 2019
08336a1
fastmd5 默认大文件为5G
lijinfeng2011 Jan 25, 2019
7e4d8bd
修复通过代理load文件的问题
lijinfeng2011 Jan 25, 2019
2caf3a6
grsync 同步目录优化,先经过压缩。空目录、软链接,chmod、chown等的处理
lijinfeng2011 Feb 1, 2019
c4ffaaf
发布0.1.59到cpan.org
lijinfeng2011 Feb 1, 2019
b03ba26
merge release-0.0.1
lijinfeng2011 Feb 1, 2019
fb5811f
agent 限速,默认20M
lijinfeng2011 Feb 2, 2019
a5ede99
tcpserver 添加TCPSERVERINDEX环境变量
lijinfeng2011 Feb 3, 2019
18fe30a
tcpserver 把本地和远程端口传递给插件
lijinfeng2011 Feb 3, 2019
18f562b
add agent/argv/scriptsx,agent/code/scriptsx
lijinfeng2011 Feb 3, 2019
08485d7
tools/rcall 添加实时显示命令输出功能
lijinfeng2011 Feb 3, 2019
2ce5ef5
tools/rtail 输出日志前面添加机器名
lijinfeng2011 Feb 3, 2019
b49d20d
tools/grsync 添加immediately 参数,支持不隔离网络的Load进度显示
lijinfeng2011 Feb 6, 2019
4cf53e4
修复上一次提交的问题,MYDan::Agent::Load 需要传递pcb
lijinfeng2011 Feb 6, 2019
799431e
grsync 添加实时进度显示
lijinfeng2011 Feb 23, 2019
73aa321
MYDan::Util::Phasic 修复同步multi判断异常
lijinfeng2011 Feb 23, 2019
ec2ee52
修复grsync最后的untar,清理环境变量
lijinfeng2011 Feb 23, 2019
166afbc
修复同步文件显示进度的问题
lijinfeng2011 Feb 26, 2019
ae29e49
add svrInfo
lijinfeng2011 Feb 27, 2019
e394940
u dan/tools/grsync
lijinfeng2011 Feb 28, 2019
2701b0d
svrInfo 改名成os
lijinfeng2011 Feb 28, 2019
210708b
添加udpfileserver
lijinfeng2011 Mar 17, 2019
ff80cff
udpfileserver 添加MaxRTO最大重传时间参数
lijinfeng2011 Mar 17, 2019
da70de4
update udpfileserver
lijinfeng2011 Mar 17, 2019
d55882e
udpfileserver工具从2M/s的速度启动
lijinfeng2011 Mar 17, 2019
cd92aa4
添加管理git和svn的工具
lijinfeng2011 Mar 27, 2019
5ae3d1b
update dan/code/config.example
lijinfeng2011 Mar 28, 2019
36eb966
发布0.1.60到cpan.org
lijinfeng2011 May 24, 2019
7f922a0
修改README.md 添加安装说明
lijinfeng2011 Jul 18, 2019
4d7dc1c
add lcall 本地插件调用工具
lijinfeng2011 Jul 18, 2019
4ac9228
add gitrsync
lijinfeng2011 Jul 29, 2019
f2c3d36
mydan deploy工具支持通过rsync发布程序,支持目录源
lijinfeng2011 Jul 30, 2019
58b53d5
deploy工具添加comeback,stage功能
lijinfeng2011 Jul 31, 2019
d91c3a8
合并release-0.0.1分支
lijinfeng2011 Jul 31, 2019
a1475fa
deploy工具区分开taropt和rsyncopt
lijinfeng2011 Jul 31, 2019
3c87df6
修复collector ping 警告
lijinfeng2011 Aug 1, 2019
0dcc8fe
deploy 工具rsync时不同步属组信息
lijinfeng2011 Aug 7, 2019
aaef594
发布0.1.61到cpan.org
lijinfeng2011 Sep 25, 2019
5a1669d
更新monitorv2,用来监控监控系统
lijinfeng2011 Oct 19, 2019
6bfc7ca
monitorv2 配置文件内容变更时重启
lijinfeng2011 Oct 20, 2019
5ccbd5a
修改dan/monitorv2/bin/watch 的输出成标准yaml格式
lijinfeng2011 Oct 20, 2019
ed5064f
发布0.1.62到cpan.org
lijinfeng2011 Oct 20, 2019
0621376
monitorv2 运行错误打到订阅模块
lijinfeng2011 Oct 21, 2019
5149f1a
ntp添加ntp1.aliyun.com 地址
lijinfeng2011 Oct 21, 2019
9ba4ee5
修复Grsync/V4跨区域dump文件错误
lijinfeng2011 Nov 14, 2019
8c276ec
agent突然关机时调用端释放连接
lijinfeng2011 Nov 22, 2019
a378e87
fix on_error string
lijinfeng2011 Dec 6, 2019
a79c0a5
merge release-0.0.1
lijinfeng2011 Dec 27, 2019
fb455fe
agent home目录首选 $ENV{HOME}
lijinfeng2011 May 27, 2020
6bf2091
修复shell、shellv2在mac上退出异常的问题
lijinfeng2011 May 28, 2020
a3a3317
shell、shellv2添加提前输入命令的功能
lijinfeng2011 May 29, 2020
048fac3
load 工具可以选择agent中load的插件,方便使用免密插件
lijinfeng2011 May 30, 2020
7feafb7
修复MYDan::API
lijinfeng2011 May 30, 2020
5759292
添加antdencli工具
lijinfeng2011 May 30, 2020
54d1b6f
antdencli 添加image参数
lijinfeng2011 Jun 1, 2020
e104687
antdencli添加数据集的选择参数
lijinfeng2011 Jun 2, 2020
f338a63
antdencli添加volume参数
lijinfeng2011 Jun 2, 2020
c7f1fbe
shell,shellv2插件添加ictrl参数
lijinfeng2011 Jun 2, 2020
a98348a
antdencli 添加 nvidia-smi 参数
lijinfeng2011 Jun 2, 2020
5467a54
修复shell、shellv2运行top命令后光标被隐藏
lijinfeng2011 Jun 2, 2020
5423e48
antdencli nvidia-smi 添加watch,定时刷新
lijinfeng2011 Jun 2, 2020
cfbef81
antdencli 添加ri参数查看集群资源信息
lijinfeng2011 Jun 3, 2020
a8477d4
antdencli GPU资源处理,数据集挂载点修改,容器workdir的指定
lijinfeng2011 Jun 9, 2020
7b98f12
antdencli 区分用户账号
lijinfeng2011 Jun 12, 2020
47a3820
antdencli只允许操作自己的资源
lijinfeng2011 Jun 13, 2020
9a2fef8
antdencli 添加 --hostip指定ip地址
lijinfeng2011 Jun 17, 2020
cae1d06
antdencli 添加显示home、user、api、mydanrole辅助提醒
lijinfeng2011 Jun 17, 2020
f4552e1
antdencli 添加下载模型的功能
lijinfeng2011 Jun 17, 2020
92cbc23
antdencli允许下载目录
lijinfeng2011 Jun 19, 2020
93d8517
tools/git 工具避免环境变量导致死循环
lijinfeng2011 Jun 20, 2020
1bd82da
antdencli优化
lijinfeng2011 Jun 24, 2020
e1bce29
antdencli 单步60秒超时
lijinfeng2011 Jun 24, 2020
a2782f7
Supervisor 遇到要守护的服务频繁重启,等待一段时间
lijinfeng2011 Jul 12, 2020
106544d
更新antden命令集
lijinfeng2011 Jul 12, 2020
de5fe95
添加antden slave 控制数据集的工具
lijinfeng2011 Jul 12, 2020
463cae4
antdencli传递数据集名称到docker
lijinfeng2011 Jul 12, 2020
bd5ea56
agent在容器内和容器外运行使用不同的uuid
lijinfeng2011 Jul 15, 2020
81d8eb2
antdencli 版本控制
lijinfeng2011 Jul 19, 2020
bd4125a
bin/mydan 修改antdencli路径
lijinfeng2011 Jul 21, 2020
6e2d71a
antdencli api运行有“-”字符
lijinfeng2011 Jul 22, 2020
4b5f101
antdencli 处理调用返回空数组的情况
tonygitworld Sep 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL.PL
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if( $ENV{box} )

mysystem "rsync -a box/ box.i/";
mysystem "rsync -a dan/node/ box.i/node/";
map { mysystem "rsync -a dan/tools/$_ box.i/tools/" } qw(range mcmd mssh expect vssh go rsync alias unalias sync config whois gateway git diskSpaceControl supervisor secure reborn check );
map { mysystem "rsync -a dan/tools/$_ box.i/tools/" } qw(range mcmd mssh expect vssh go rsync alias unalias sync config whois gateway git gitrsync diskSpaceControl supervisor secure reborn check fastmd5 os );


my @sed = (
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ MYDan支持两种协议,ssh协议和MYDan自定义协议。推荐使用MYDan

(等同于: curl -L http://install.mydan.org|bash)

安装方式4:

(安装到/opt/mydan下)
需要安装的服务器不能上网,需要一个可以上网的机器先下载安装包,然后拷贝到服务器进行安装

安装步骤:
1. 新建一个目录,在目录中运行下载安装包命令:
curl -s https://raw.githubusercontent.com/MYDan/openapi/master/scripts/mydan/package.sh|bash
(也可以只下载某个版本 curl -s https://raw.githubusercontent.com/MYDan/openapi/master/scripts/mydan/package.sh|bash -s Linux:x86_64)

(等同于: curl -L http://package.mydan.org|bash)

2. 拷贝名如mydan.agent.20190524140060.Linux.x86_64 的文件到需要安装的服务器上
3. 在服务器上运行./mydan.agent.20190524140060.Linux.x86_64 进行安装

==============================推荐使用方式===================================

第一步:
Expand Down
11 changes: 11 additions & 0 deletions bin/mydan
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ my @cmd =
[ 'gateway', "代理.\n", 'dan/tools/gateway', 'box/tools/gateway' ],

[ 'rcall', "远程调用${name}的agent.", 'dan/tools/rcall' ],
[ 'lcall', "调用本地agent插件.", 'dan/tools/lcall' ],
[ 'rtail', 'tail多个远程机器日志.', 'dan/tools/rtail' ],
[ 'vssh', '虚拟登陆多个机器.', 'dan/tools/vssh', 'box/tools/vssh' ],
[ 'mssh', '批量ssh命令.', 'dan/tools/mssh', 'box/tools/mssh' ],
Expand All @@ -33,13 +34,16 @@ my @cmd =
[ 'config', "${name}配置.\n", 'dan/tools/config', 'box/tools/config' ],

[ 'shell', "获取远程机器反弹shell.\n", 'dan/tools/shell' ],
[ 'shellv2', "获取远程机器反弹shell的v2版本.\n", 'dan/tools/shellv2' ],

[ 'alias', "${name}内部使用的alias.", 'dan/tools/alias', 'box/tools/alias' ],
[ 'unalias', "${name}内部使用的unalias.\n", 'dan/tools/unalias', 'box/tools/unalias' ],

[ 'fastmd5', "快速计算文件md5.", 'dan/tools/fastmd5', 'box/tools/fastmd5' ],
[ 'sync', "同步${name}的配置", 'dan/tools/sync', 'box/tools/sync' ],
[ 'xtar', '脚本和数据压缩工具.', 'dan/tools/xtar' ],
[ 'git', 'git命令,添加了指定key功能.', 'dan/tools/git', 'box/tools/git' ],
[ 'gitrsync', '代码发布到远程机器.', 'dan/tools/gitrsync', 'box/tools/gitrsync' ],
[ 'alarm', '设置超时闹钟运行命令.', 'dan/tools/alarm' ],
[ 'bigest', '查找大文件.', 'dan/tools/bigest' ],
[ 'expect', '自动应答.', 'dan/tools/expect' ],
Expand All @@ -51,12 +55,19 @@ my @cmd =
[ 'deploy', "本地发布切连接小工具.\n", 'dan/tools/deploy' ],
[ 'check', "检查服务的小工具.\n", 'dan/tools/check', 'box/tools/check' ],
[ 'secure', "私密文件管理小工具.\n", 'dan/tools/secure', 'box/tools/secure' ],
[ 'udpfileserver', "udp文件服务.\n", 'dan/tools/udpfileserver' ],

[ 'diskSpaceControl', "控制磁盘使用空间在某个百分比.\n", 'dan/tools/diskSpaceControl', 'box/tools/diskSpaceControl' ],

[ 'node', '机器管理.', 'bin/mydan.node' ],
[ 'code', 'git和svn代码仓库管理.适用于管理员.', 'dan/code/bin/control' ],
[ 'checkuser', '检查用户状态.', 'dan/code/bin/checkuser' ],

[ 'reborn', "重装系统.\n", 'dan/tools/reborn', 'box/tools/reborn' ],

[ 'os', "获取当前服务器的cpu/mem等信息.\n", 'dan/tools/os', 'box/tools/os' ],

[ 'antdencli', "AntDen 命令行工具.\n", 'dan/antden/bin/antdencli' ],
);

MYDan::Util::Command->new( $name => \@cmd,
Expand Down
4 changes: 4 additions & 0 deletions dan/.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ collector:

util:
conf: $MYDanPATH/etc/util/conf
fastmd5: 5368709120

monitor:
conf: $ROOT/monitor/conf
Expand All @@ -62,6 +63,7 @@ monitorv2:
code: $ROOT/monitorv2/code
scripts: $ROOT/monitorv2/scripts
logs: $MYDanPATH/var/logs/monitorv2
run: $MYDanPATH/var/run/monitorv2

api:
addr: http://127.0.0.1:5555 #dashboard_addr
Expand All @@ -80,6 +82,8 @@ tcpserver:
rbuf: 104857600
ReservedSpaceCount: 10
ReservedSpaceSize: 2
rlimit: 20971520
wlimit: 20971520

notify:
level:
Expand Down
17 changes: 17 additions & 0 deletions dan/agent/argv/cleandir
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!# perl: agent/argv/cleandir
use strict;
use warnings;

use Getopt::Long;

return sub
{
local $/;
my %o;

Getopt::Long::GetOptionsFromArray( \@_, \%o, qw( uuid=s expire ) );

$o{path} = \@_;

return \%o;
};
6 changes: 2 additions & 4 deletions dan/agent/argv/dump
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use strict;
use warnings;

use Cwd;
use Digest::MD5;
use Getopt::Long;
use MYDan::Util::FastMD5;

return sub
{
Expand All @@ -23,9 +23,7 @@ return sub
$o{chown} ||= ( getpwuid($uid) )[0];
}

die "Can't open '$file': $!\n" unless open my $fh, '+<', $file;
$o{md5} = Digest::MD5->new()->addfile( $fh )->hexdigest();
close $fh;
$o{md5} = MYDan::Util::FastMD5->hexdigest( $file );

$ENV{MYDanExtractFile} = $file;
$ENV{MYDanExtractFileAim} = $o{path};
Expand Down
6 changes: 3 additions & 3 deletions dan/agent/argv/mrsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!# perl: agent/argv/dump
#!# perl: agent/argv/mrsync

use strict;
use warnings;
Expand All @@ -16,7 +16,7 @@ return sub
else
{
Getopt::Long::GetOptionsFromArray( \@_, \%o,
qw( src=s dst=s sp=s dp=s timeout=i max=i retry=i nice=i user=s sudo=s gave=i chown=s chmod=s cc )
qw( src=s dst=s sp=s dp=s timeout=i max=i retry=i nice=i user=s sudo=s gave=i chown=s chmod=s cc env )
);
}

Expand All @@ -37,7 +37,7 @@ return sub
my %p = map{ $o{$_} => 1 }grep{ defined $o{$_} }qw( sp dp );
my %n = map{ $_ => 1 }@{$o{src}}, @{$o{dst}};

$o{queryxdata} = MYDan::Agent::Mrsync::queryx( node => [ keys %n ], map{ $_ => $o{$_} }qw( user sudo ) );
$o{queryxdata} = MYDan::Agent::Mrsync::queryx( node => [ keys %n ], map{ $_ => $o{$_} }qw( user sudo env ) );

map{ die "agent/argv/mrsync: $_ null" unless $o{$_} && @{$o{$_}} }qw( src dst );
die "agent/argv/mrsync: sp undef" unless $o{sp};
Expand Down
23 changes: 23 additions & 0 deletions dan/agent/argv/scriptsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!# perl: agent/argv/scriptsx

use strict;
use warnings;

use Cwd;
use Digest::MD5;
use Getopt::Long;

return sub
{
local $/;
my ( $file, %o, $data ) = shift;
die "file undef\n" unless $file;
die "file nofind: $file\n" unless -f $file;

Getopt::Long::GetOptionsFromArray( \@_, \%o, qw( scriptstype=s ) );

$o{type} = delete $o{scriptstype};
$o{argv} = join ' ', map{ "'$_'" }@_;
$o{md5} = Digest::MD5->new()->add( $o{cont} = `cat $file` )->hexdigest();
return [ \%o ];
};
17 changes: 17 additions & 0 deletions dan/agent/argv/unzipdir
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!# perl: agent/argv/unzipdir
use strict;
use warnings;

use Getopt::Long;

return sub
{
local $/;
my %o;

Getopt::Long::GetOptionsFromArray( \@_, \%o, qw( uuid=s chmod=s chown=s delete ) );

$o{path} = \@_;

return \%o;
};
20 changes: 20 additions & 0 deletions dan/agent/argv/zipdir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!# perl: agent/argv/zipdir
use strict;
use warnings;

use Getopt::Long;

return sub
{
local $/;
my %o;

Getopt::Long::GetOptionsFromArray( \@_, \%o, qw( uuid=s makelist dirdetail) );

my $chars = [ "A" .. "Z", "a" .. "z", 0 .. 9 ];
$o{uuid} ||= join("", @$chars[ map { rand @$chars } ( 1 .. 8 ) ]);

$o{path} = \@_;

return \%o;
};
42 changes: 42 additions & 0 deletions dan/agent/code/antdencli
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env perl
use strict;
use warnings;
use YAML::XS;
use MYDan::API::AntDen;

local $/ = undef;

my ( %param, @r )= %{ YAML::XS::Load( <> ) };

my $argv = $param{argv};
my $api = MYDan::API::AntDen->new( addr => "http://127.0.0.1:3000" );
my $idie = sub{ print shift; exit 1; };

my %version = ( cli => '1.0.01' , image => '1.0.01' );
for my $k ( keys %version )
{
next unless $argv->{version} && $argv->{version}{$k};
my $v = $argv->{version}{$k};

$v =~ s/\D/./g;
next if $v ge $version{$k};

print "\n", '=' x 75, "\n";
print "Your current $k version is $v. Need an update to $version{$k}\n";
print "Get more help: https://antden.github.io\n";
print '=' x 75, "\n";
exit;
}

@r = eval{ $api->submitjob( %{$argv->{conf}}, owner => $param{user} ); } if $argv->{ctrl} eq 'submitjob';
@r = eval{ $api->listjob( $param{user} ); } if $argv->{ctrl} eq 'listjob';
@r = eval{ $api->info( $argv->{conf}{jobid}, $param{user} ); } if $argv->{ctrl} eq 'info';
@r = eval{ $api->stop( $argv->{conf}{jobid}, $param{user} ); } if $argv->{ctrl} eq 'stop';
@r = eval{ $api->taskinfo( $argv->{conf}{taskid} ); } if $argv->{ctrl} eq 'taskinfo';
@r = eval{ $api->resources( $param{user} ); } if $argv->{ctrl} eq 'resources';
@r = eval{ $api->datasets( $param{user} ); } if $argv->{ctrl} eq 'datasets';

&$idie( "err: $@" ) if $@;
print YAML::XS::Dump @r;

exit;
51 changes: 51 additions & 0 deletions dan/agent/code/cleandir
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env perl
use strict;
use warnings;
use YAML::XS;

local $/ = undef;

my %param = %{ YAML::XS::Load( <> ) };
my ( $path, $uuid, $expire ) = map{ $param{argv}{$_}}qw( path uuid expire );

$expire = 0 unless $expire && $expire =~ /^\d+$/;
my $idie = sub{ print shift;exit 1; };

&$idie( "uuid format error:$uuid" ) unless $uuid && $uuid =~ /^[a-zA-Z0-9]+$/;

my $prefix = '.TEMP_MYDan_Grsync_';
my ( $temp, $fail )= "${prefix}$uuid";

for my $p ( @$path )
{
next unless -e $p;
unless( chdir $p )
{
print "cd $p fail\n";
$fail = 1 ;
next;
}

if( system "rm -f $temp*" )
{
print "clean temp fail\n";
$fail = 1;
next;
}

next unless $expire;
my $timeout = time - $expire;

for my $f ( grep{ -f $_ } glob "${prefix}*" )
{
my $mtime = ( stat $f )[9];
next if $mtime > $timeout;
unless( unlink $f )
{
print "unlink $f fail: $!\n";
$fail = 1;
}
}
}

$fail ? exit( 1 ) : exit( 0 );
57 changes: 54 additions & 3 deletions dan/agent/code/download
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,60 @@
use strict;
use warnings;
use YAML::XS;

use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::Socket;
use Time::HiRes qw(time);
use Sys::Hostname;

use MYDan::Agent::Load;


my $idie = sub{ print shift;exit 1; };
my ( $cv, $pcb ) = ( AE::cv );
if( my $rlog = $ENV{MYDan_rlog} )
{
my ( $uuid, $server, $port ) = split /:/, $rlog;
my %argv = (
uuid => $uuid,
addr => $server || $ENV{TCPREMOTEIP},
port => $port || $ENV{TCPREMOTEPORT},
);

warn sprintf "download info: host:%s port:%s uuid:%s\n", map{ $argv{$_} ||'' }qw( addr port uuid );

my ( $index, %cv, $w, $hdl ) = ( 0 );

tcp_connect $argv{addr}, $argv{port}, sub {
my ( $fh ) = @_;
unless( $fh )
{
print "$argv{addr}:$argv{port} tcp_connect: $!";
$cv->send;
return;
}
$hdl = new AnyEvent::Handle(
fh => $fh,
rbuf_max => 10240000,
wbuf_max => 10240000,
autocork => 1,
on_error => sub{
warn 'tcp error';
undef $hdl;
$cv->send;
},
on_eof => sub{
warn 'tcp close';
undef $hdl;
$cv->send;
},
);
$hdl->push_write( $argv{uuid} . ':' . hostname . ':' );
}, sub{ return 5; };

$pcb = sub { $hdl->push_write( shift."\n" ) if $hdl; };
}

eval{

local $/ = undef;
Expand All @@ -19,10 +71,9 @@ eval{
MYDan::Agent::Load->new(
node => $param->{src},
map{ $_ => $param->{$_} }qw( sp dp )
)->run( %$param, role => 'agent', query => $param->{load}||1 );
)->run( %$param, role => 'agent', pcb => $pcb, verbose => $pcb ? 1 : 0, query => $param->{load}||1 );
};

if($@) { print "load fail $@";exit 1; }

exit 0;

Loading