Please check the script

Posted on 2014-01-23
Last Modified: 2014-01-24
[root@central kdump_test]# cat
while read server
  echo -n $server
  ssh -n root@$server "cat /boot/config-`uname -r`|grep -e KEXEC -e CRASH"
 ssh -n root@$server "cat /boot/config-`uname -r`"
  if [ $? -ne 0 ]; then
    echo "[ FAIL ]"
    echo "[ done ]"
done < lnazvm_qacore

where lnazvm_qacore consist of server1.qua and server2.qua

Output is:

[root@central# kdump_test]# ./
cat: /boot/config-2.6.18-128.el5: No such file or directory
cat: /boot/config-2.6.18-128.el5: No such file or directory
[ FAIL ]
cat: /boot/config-2.6.18-128.el5: No such file or directory
cat: /boot/config-2.6.18-128.el5: No such file or directory
[ FAIL ]
Question by:oo_tatang
LVL 84

Expert Comment

ID: 39805649
Is that the result you expected?

Did you mean to use ' instead of "?
LVL 34

Accepted Solution

Seth Simmons earned 500 total points
ID: 39805663
the problem is your uname command
with backtick, it's executed first and placed in that command

this means uname -r is executed locally and 2.6.18-128.el5 (your local kernel) is placed there and that kernel is not on the remote system

replace the " with ' only and the command in () and that should run uname on the remote system

ssh -n root@$server '(cat /boot/config-`uname -r`|grep -e KEXEC -e CRASH)'

Open in new window


Expert Comment

ID: 39805913
You don't even need the parentheses.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS EC2 Linux 1 53
Ubuntu 16.04 AMD video card driver issues 20 317
We cannot find the source of the spam emails on our Debian 7 server 10 119
Problem to start Neon 20 83
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now