in reply to tailing the file and look for string

The absence of the " DEBUG("Line: $line");" output, and the returning 0 makes it seem like you are getting the condition:
$self->get_error()
You are doing mo error checking or logging/reporting .. makes it very hard to diagnose, especially in this case, where it appears you are connecting via a flaky (apparently telent like) method to a remote machine.

        Profanity is the one language all programmers know best.