【发布时间】:2012-11-08 18:11:08
【问题描述】:
我尝试使用您的 CPAN 模块 POE::Compoenten::Server::NRPE。 我尝试了来自 CPAN 站点的示例,并针对 nagios-tool check_nrpe 进行了测试。
文本很好,但我无法获得正确的返回值。 您在模块描述中描述了这个 return_result,但我不知道如何使用它。
会很好,如果你能给我一个非常简短的例子,如何返回一个值 0。
非常感谢!
干杯, 克里斯托夫
use POE;
use POE::Component::Server::NRPE;
# test with: check_nrpe -H localhost -c test; echo $?
my $nrped = POE::Component::Server::NRPE->spawn (port => 5666);
$nrped->add_command (command => "test", program =>
sub { print STDOUT "test CRITICAL\n";
return 2; # always 0???
});
$poe_kernel->run ();
return 0;
【问题讨论】: