Sponsored Content
Top Forums Shell Programming and Scripting Logging Remote SSH command (cannot log a java output) Post 302442503 by Keepcase on Wednesday 4th of August 2010 01:14:37 PM
Old 08-04-2010
Logging Remote SSH command (cannot log a java output)

Hi all

I'm creating a script that runs a few commands on some boxes and everything can be logged EXCEPT the java -version command, there doesn't seem to be any output...

Can anyone help explain why this does not work? Do I need to do something extra to append the output from the java -version command to a file on the machine that I am running the script?

Thanks!

Code:
SSH_CMD=/usr/bin/ssh
USER=root
for _host in ${LIST_HOSTS}
do
        ${SSH_CMD} ${USER}@${_host} hostname | tee -a results.txt
        ${SSH_CMD} ${USER}@${_host} 'java -version'
        ${SSH_CMD} ${USER}@${_host} 'uname -a' |tee -a results.txt
        ${SSH_CMD} ${USER}@${_host} 'prtdiag -v | grep -i OBP' |tee -a results.txt
        echo "\n" | tee -a results.txt
done


Last edited by Scott; 08-04-2010 at 02:20 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH and command logging

Hi all... I've completed the task of deploying SSH over my 400 servers. I don't know if i'm right or wrong, but ssh doesn't do any command-logging, does it? Is there a app i can use to log all commands passed ( besides the usual .sh_history), whith no modification possible by the user, and how... (2 Replies)
Discussion started by: penguin-friend
2 Replies

2. UNIX for Dummies Questions & Answers

Logging Command Line and Output in Unix

Hi, This might be a bit stupid question, but what command to use to create like a session which logs the command line, and output on to the screen? Basically, a log to a file, where I can review what I had install, uninstall, etc. Thank you (4 Replies)
Discussion started by: kittoinc
4 Replies

3. Solaris

How to invoke remote java program from ssh

How can i invoke java program from MC1, when I connect remotely to execute can I set classpath etc. ____________ <-------------->____________________ |..................|<-------------->|...............................| |..................|<-------------->|...............................|... (2 Replies)
Discussion started by: vishnu559
2 Replies

4. UNIX for Dummies Questions & Answers

Automatic logging (capture screen output) of telnet/ssh sessions on a Solaris node

Hi I am working in Solaris 10 and I want to monitor logs for every telnet/ssh session that tries to connect to the server. I need these logs to be generated in a file that I can fetch using ftp. I am a new user and a stepwise detail will be great BR saGGee (3 Replies)
Discussion started by: saggee
3 Replies

5. AIX

Remote Script command logging question

I've noticed that when running a script that connects to a number of our servers (to essentially run batch commands) that the commands aren't logged in the user's .sh_history or .bash_history files. Is there a place where this is logged (assuming the script itself isn't doing the logging and I'm... (3 Replies)
Discussion started by: kneemoe
3 Replies

6. UNIX for Advanced & Expert Users

Not logging ftp connections in /var/adm/wtmpx file (in last command output)

Hi all, I have F5 load balancer on my system and checking service status by opening an ftp session in every 30 seconds. These ftp sessions are being logged in /var/adm/wtmpx and filling up the file. when i run the last command most of the output is this ftp session. I was wondering if there is a... (1 Reply)
Discussion started by: cepxat
1 Replies

7. Shell Programming and Scripting

Remote command in variable using ssh

Hi, I've an issue in a shell script: I'm opening an ssh connection to a remote server, then I want to store the result of a ls command in a variable, but it doesn't work: the ls is done on the local machine. ssh user@server << EOF ls # works as expected (ls is done remotely) test=`ls` # the... (1 Reply)
Discussion started by: seloum57
1 Replies

8. Shell Programming and Scripting

SSH - remote output locally

The code below works ok, however; I need to output the results to a local variable the_path="/mnt/back/hang" ssh -T -i /home/buddy/.ssh/id_rsa buddy@ginger << EOF find ${the_path} -name "*.jpg" | wc -l > ## output to local variable exit EOF (3 Replies)
Discussion started by: squrcles
3 Replies

9. Shell Programming and Scripting

Getting SSH Output From Remote to Local Session?

Hi everyone, after about 2 days of scratching my head on this one, I'm finally ready to punt this and ask for some actual help. Here's the situation. We have 1 server, that runs multiple VM's. To gain access to those VM's we ssh from host01 to the other vm hosts. For example when we first log... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
af_archive(5)							File Formats Manual						     af_archive(5)

NAME
af_archive -- format of archive files in the Attribute Filesystem SYNOPSIS
#include <atfs.h> #include <afsys.h> DESCRIPTION
AtFS archive files are used to store the data and attributes of non-busy ASOs. Beside these, some attributes (including all user defined attributes) of busy ASOs are stored in AtFS archive files. AtFS maintains two archive files for each line of development, one to hold the standard- and the user defined attributes and the other to hold the data and change notes. These files are stored either in a subdirectory named AtFS or in a explicitly named directory somewhere in your file system. The two archive files are named Attr/<filename> (attributes) and Data/<filename> (data). This manual contains a short, exemplary description of the archive structure. All data in AtFS-archives are stored as ASCII-strings. The archives contain keywords and keyletters. These are set in boldface in the following description. Strings of the form <field> describe the purpose of the appropriate field in the archive. Here's the structure (the attributes file first): The Header, ... ^BARHD <archive_format_version> <no_of_revisions> <size_of_data> ... the name .. ^BI <hostname> <path> <name> <type> <variant(unused)> ... and the owner .. ^BO <owner's_name> <owner's_host> <owner's_domain> ... followed by some attributes for the busy version ... ^BP <gen_> <rev_of_physical_predecessor> ^BL <locker's_name> <locker's_host> <locker's_domain> <date_of_last_lock_change> ... and the revision list, that contains all standard attributes for non-busy versions. ... ^BR <generation> <revision> <state> <mode> <variant(unused)> ^BA <author's_name> <_host> <_domain> <locker's_name> <_host> <_domain> ^BT <date_of_last_modification> <_last_access> <_last_status_change> ... ... <_saving> <_locking> ^BM <kind_of_representation> <size_of_file> <size_of_delta> ... ... <gen_> <rev_of_phys._successor> <gen_> <rev_of_phys._predecessor> ^BR ... ^BR ... ... Now follows the list of lists of user defined attributes ("-2 -2" indicates the busy version; "@" stands for a null byte). ... ^BUSEG ^BU -2 -2 machine=vax@data=fs@@ ^BU <gen> <rev> name=value@@ ^BU ... The structure of the datafile: Data are represented either by deltas or by complete data-chunks... ^BDATA <archive_format_version> ^BN <gen> <rev> <size_of_note> --- empty log message --- ^BD <gen> <rev> <kind_of_representation> <size_of_data> A typical delta looks like: @67723@@@@44@67756@^A14@some text@6635@ and so on. Deltas are indicated by a "1" at the "kind_of_representation" field. ^BN <gen> <rev> <size_of_note> This is a log message ^BD <gen> <rev> <kind_of_representation> <size_of_data> A "0" at the "kind_of_representation" field indicates that this version is stored completely. ^BN ... ^BD ... AUTHOR
Andreas Lampen, Tech. Univ. Berlin (andy@cs.tu-berlin.de) 1.6.119 af_archive(5)
All times are GMT -4. The time now is 01:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy