in reply to Re^3: session expiry
in thread session expiry

The error message in the nohup log is:

Can't use an undefined value as a symbol reference at ./snmpreset01.pl line 50, <INPUT> line #####.>/p>

The input at line ##### is the MAC address gained from searching the logfile for the string, i've grepped out the various lines it says it cannot use and all are valid MACs.

We have this script running in 5 other affiliates and it is not failing there, even though it is doing exactly the same thing.

Replies are listed 'Best First'.
Re^5: session expiry
by Corion (Patriarch) on May 25, 2010 at 12:07 UTC

    Have you looked at what line 50 is?

    You are not checking whether creating your REPORT file succeeds. Change

    open REPORT, ">> ...";
    to
    open REPORT, '>>', $report_file or die "Couldn't append to REPORT file '$report_file';

    You are not checking whether creating $sock1 succeeds. But you still blindly try to write to it, which might or might not cause your error.

    As an aside, you have commented out use strict;. Why?

      Sorry, my mistake when I was uploading the script I removed some commented out lines, so line 50 is:
      print $sock1 "$mac1";
      So it is trying to, if i read this right, send the MAC to the IP2 on port 5555, but fails because it cannot write to it.

        Right. $sock1 did not connect, and you never know about that because you only check whether $sock connects.