Net::OpenSSH::OSTracer - trace ssh master process at the OS level
use Net::OpenSSH; $Net::OpenSSH::debug |= 512; Net::OpenSSH->new($host)->system("echo hello world"); system "less /tmp/net_openssh_master.*.strace";
This is a Net::OpenSSH helper module that allows you to trace the master ssh process at the operating system level using the proper utility available in your system (i.e, strace, truss, ktruss, tusc, etc.).
This feature can be used when debugging your programs or to report bugs on the module.
It is enabled setting the flag 512 on the
$Net::OpenSSH::debug |= 512;
By default the output files of the tracer are saved as
Also, the output send by the tracer to stdout/stderr is saved as
The module can be configured through the following global variables:
By default, the module decides which tracer to use in base to the operating system name. This variable allows one to select a different tracer.
Currently accepted types are: strace (linux), ktrace (*bsd), tusc (hp-ux) and truss (solaris and aix).
Command to execute for tracing the ssh process.
By default, it inferres it from the tracer type selected.
Basename for the destination file. The PID of the ssh process and the tracer type will be appended.
This variable can be used to request the tracer to be run with
sudo (some operating systems as for example Ubuntu, do not allow to attach tracers, even to your own processes, unless you do it as root).
The variable has to be set with the path of the
sudo binary. For instance:
$Net::OpenSSH::OSTracer::sudo = '/usr/bin/sudo';
If you need to pass a password to
sudo, set the environment variable
SUDO_ASKPASS. For instance:
This variable can be used to delay the ssh execution so that the tracer can attach the process first. This is specially handy when using
sudo with a password.
This module has not been tested under all the operating systems is says to support.
If you find any problem, just report it, please!
Copyright (C) 2012 by Salvador Fandiño (firstname.lastname@example.org)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.