Hi jplee3,

On Thu, Dec 16, 2010 at 4:11 PM, jplee3 <[email protected]> wrote:
> Hey all,
>
> I started noticing this message when running the OSSEC batch manager
> Perl script:
>
> [r...@mybox jplee3]# ./ossec-batch-manager.pl -a -n testing1 -i 211 -p
> 10.1.1.1
> Use of uninitialized value in string eq at ./ossec-batch-manager.pl
> line 287, <FH> line 158.
> Use of uninitialized value in string eq at ./ossec-batch-manager.pl
> line 287, <FH> line 161.
> Use of uninitialized value in string eq at ./ossec-batch-manager.pl
> line 287, <FH> line 170.
>
> The agent gets added fine, as far as I can tell. It's just that error
> pops up. I have over 200 agents now. I don't recall this being an
> issue until lately. Is this a 'false positive' where Perl is
> complaining that there's too many agents?
>
> Line 287 is in the code below:
>  # If the file isn't readable, the id probably isn't already in it
>  if (-r AUTH_KEY_FILE) {
>    open (FH, "<", AUTH_KEY_FILE);
>    while (<FH>) {
>      chomp;
>      my ($id, $name, $ip, $key) = split;
>      $rval = 1 if ($id == $newid && $rval == 0);
>      $rval = 2 if ($name eq $newname && $rval == 0);
>      $rval = 3 if ($ip eq $newip && $rval == 0);    #line 287
>    }
>    close(FH);
>
>
>
> Any ideas what might be going on here?
>
>
>


So one of those variables ($id, $newid, or $rval) is not set to
anything. You could add some "print" statements in there to find out
which one.
They could be as simple as:
print "XXX id is $id\n"

Reply via email to