.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::OpenSSH::OSTracer 3" .TH Net::OpenSSH::OSTracer 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Net::OpenSSH::OSTracer \- trace ssh master process at the OS level .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Net::OpenSSH; \& $Net::OpenSSH::debug |= 512; \& \& Net::OpenSSH\->new($host)\->system("echo hello world"); \& \& system "less /tmp/net_openssh_master.*.strace"; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This is a Net::OpenSSH helper module that allows you to trace the master \f(CW\*(C`ssh\*(C'\fR process at the operating system level using the proper utility available in your system (e.g., \f(CW\*(C`strace\*(C'\fR, \f(CW\*(C`truss\*(C'\fR, \&\f(CW\*(C`ktruss\*(C'\fR, \f(CW\*(C`tusc\*(C'\fR, etc.). .PP This feature can be used when debugging your programs or to report bugs on the module. .PP It is enabled setting the flag 512 on the \f(CW$Net::OpenSSH::debug\fR variable: .PP .Vb 1 \& $Net::OpenSSH::debug |= 512; .Ve .PP By default the output files of the tracer are saved as \&\f(CW\*(C`/tmp/net_openssh_master.$pid.$tracer_type\*(C'\fR. .PP Also, the output send by the tracer to stdout/stderr is saved as \&\f(CW\*(C`/tmp/net_openssh_master.$pid.txt\*(C'\fR. .PP The module can be configured through the following global variables: .ie n .IP $Net::OpenSSH::OSTracer::type 4 .el .IP \f(CW$Net::OpenSSH::OSTracer::type\fR 4 .IX Item "$Net::OpenSSH::OSTracer::type" 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. .Sp Currently accepted types are: \f(CW\*(C`strace\*(C'\fR (Linux), \f(CW\*(C`ktrace\*(C'\fR (*BSD), \&\f(CW\*(C`tusc\*(C'\fR (HP-UX) and \f(CW\*(C`truss\*(C'\fR (Solaris and AIX). .ie n .IP $Net::OpenSSH::OSTracer::cmd 4 .el .IP \f(CW$Net::OpenSSH::OSTracer::cmd\fR 4 .IX Item "$Net::OpenSSH::OSTracer::cmd" Command to execute for tracing the \f(CW\*(C`ssh\*(C'\fR process. .Sp By default, it infers it from the tracer type selected. .ie n .IP $Net::OpenSSH::OSTracer::output 4 .el .IP \f(CW$Net::OpenSSH::OSTracer::output\fR 4 .IX Item "$Net::OpenSSH::OSTracer::output" Basename for the destination file. The PID of the \f(CW\*(C`ssh\*(C'\fR process and the tracer type will be appended. .ie n .IP $Net::OpenSSH::OSTracer::sudo 4 .el .IP \f(CW$Net::OpenSSH::OSTracer::sudo\fR 4 .IX Item "$Net::OpenSSH::OSTracer::sudo" This variable can be used to request the tracer to be run with \f(CW\*(C`sudo\*(C'\fR (some operating systems as for example Ubuntu, do not allow one to attach tracers, even to your own processes, unless you do it as root). .Sp The variable has to be set with the path of the \f(CW\*(C`sudo\*(C'\fR binary. For instance: .Sp .Vb 1 \& $Net::OpenSSH::OSTracer::sudo = \*(Aq/usr/bin/sudo\*(Aq; .Ve .Sp If you need to pass a password to \f(CW\*(C`sudo\*(C'\fR, set the environment variable \f(CW\*(C`SUDO_ASKPASS\*(C'\fR. For instance: .Sp .Vb 1 \& SUDO_ASKPASS=/usr/bin/ssh\-askpass .Ve .ie n .IP $Net::OpenSSH::OSTracer::delay 4 .el .IP \f(CW$Net::OpenSSH::OSTracer::delay\fR 4 .IX Item "$Net::OpenSSH::OSTracer::delay" This variable can be used to delay the \f(CW\*(C`ssh\*(C'\fR execution so that the tracer can attach the process first. This is specially handy when using \f(CW\*(C`sudo\*(C'\fR with a password. .SH BUGS .IX Header "BUGS" This module has not been tested under all the operating systems is says to support. .PP If you find any problem, just report it, please! .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2012 by Salvador FandiƱo (sfandino@yahoo.com) .PP 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.