in reply to Re: session expiry
in thread session expiry

This is the output from snoop, as far as i can tell we are trying to send the MAC to the remote server and it fails to connect to the remote port within the required time, which causes the script to fail. This is the example from a failure:
IP1 -> sat03-ce2 TCP D=5000 S=56412 Ack=2181156585 Seq=3603286738 +Len=0 Win=49640 sat03-ce2 -> IP1 TCP D=56394 S=5000 Fin Ack=1768367342 Seq=1949488034 +Len=0 Win=24820 IP1 -> sat03-ce2 TCP D=5000 S=56394 Ack=1949488035 Seq=1768367342 +Len=0 Win=49640 sat03-ce2 -> IP1 TCP D=56398 S=5000 Fin Ack=2343943522 Seq=3248338299 +Len=0 Win=24820 IP1 -> sat03-ce2 TCP D=5000 S=56398 Ack=3248338300 Seq=2343943522 +Len=0 Win=49640 sat03-ce2 -> IP1 TCP D=56400 S=5000 Fin Ack=2222230736 Seq=3317204210 +Len=0 Win=24820
This is the example from a successful message:
IP1 -> sat00-ce2 TCP D=5555 S=56377 Ack=2308315944 Seq=2692239599 +Len=0 Win=49640 IP1 -> sat00-ce2 TCP D=5555 S=56395 Ack=3480489146 Seq=2257027015 +Len=0 Win=49640 IP1 -> sat00-ce2 TCP D=5555 S=56413 Syn Seq=1640347427 Len=0 Win=49640 + Options=<mss 1460,nop,wscale 0,nop,nop,sackOK>

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

    You show a network dump. What relation does that network dump bear to the program? Where does your program fail? Does your program output some error message? What have you done to determine the cause of the error message?

    There are no exit or die statements in the code you posted. How does your progam "fail" then?

      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.

        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?