-2

我是 perl 新手,所以需要你帮助我尝试使用这个链接创建 perl 插件,

http://itwarriors.com/?p=1

我在(/usr/local/nagios/libexec)中创建了文件名 check_test.pl,

#! /usr/bin/perl
use strict;
use Getopt::Long qw(:config no_ignore_case);
my ($host, $server, $instances);
my $result = GetOptions(
“H|host=s” => \$host,
“s|server=s” => \$server,
“i|instances=s” => \$instances,
);
print “My host IP is $host\n”;
print “My Server IP is $server\n”;
print “Times Server found are $instances\n”;

在收到此错误后,

[root@localhost libexec]# ./check_test.pl -h 192.168.1.101 -s 192.168.1.110 -i 2 bash: ./check_test.pl: 权限被拒绝

我尝试添加,

# 'check_test' command definition
define command{
command_name    check_test
command_line    $USER1$/check_test.pl -H $HOSTADDRESS$ -s 12489 
}

command.cfg 中的命令

而不是我得到错误权限被拒绝请hekp这个错误实际上是什么错误???

4

1 回答 1

1

我认为您的脚本需要执行权限:

chmod +x check_test.pl 
于 2011-10-24T09:07:22.723 回答