Auto input to fetch cluster manager details


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Auto input to fetch cluster manager details
# 1  
Old 06-02-2015
Auto input to fetch cluster manager details

Team,

Presently i am trying to do basic checks on my my-sql cluster boxes.
The command ndb_mgm checks for the cluster environment details by typing the show command, and exit to come out of the ndb_mgm command.
Rather, than typing i have made a script abc.sh with the below contents in the below details

Code:
more abc.sh
/opt/app/abc/mysql/bin/ndb_mgm < <(yes show)

Here, once i run the script, the above command goes into iteration, and the details of show are shown on the screen in a continuous process,
(i.e:the same data is shown repetedly).Hence i just want to show it once on the screen and do the exit in-order for me to come out of the ndb_mgm command
Can anyone advise me ?

Regards
Whizkid

Last edited by whizkidash; 06-02-2015 at 07:44 AM..
# 2  
Old 06-02-2015
quick check of manual shows that ndb_mgm understands commands from command line without I/O redirection:

Code:
ndb_mgm -e "SHOW"




This User Gave Thanks to agent.kgb For This Post:
# 3  
Old 06-02-2015
Did you consider a "here string" (bashism) or a "here document"? Both are available on several recent shells, but not on sh
This User Gave Thanks to RudiC For This Post:
# 4  
Old 06-03-2015
Thanks agent.kgb it worked out for me.
Between Rudi. could you please elaborate as to what needs to be done..(any example)
# 5  
Old 06-03-2015
If ndb_mgm - which I don't have at hand to prove the concept - reads from stdin, as read does, you could adapt this one:
Code:
LF=$'\n'
while read A B REST; do echo $A $B $REST; done <<< "Hello $LF ABC CDE$LF A B C" 
Hello
ABC CDE
A B C
while read A B REST; do echo $A $B $REST; done <<< "show${LF}exit" 
show
exit

Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Unable to fetch BIOS configuration details

Hi All, unable to fetch the bios configuration information and service provider information in centos 5 using dmidecode command. ServiceProvider=`dmidecode -s system-product-name |awk '{print $1}'` BIOS_Configuration=`dmidecode | grep "BIOS Information" -A10 | grep -e... (4 Replies)
Discussion started by: sravani25
4 Replies

2. UNIX for Beginners Questions & Answers

How to extend a disk in veritas volume manager in veritas cluster?

Hi Experts, I wanted to extend a veritas file system which is running on veritas cluster and mounted on node2 system. #hastatus -sum -- System State Frozen A node1 running 0 A node2 running 0 -- Group State -- Group System Probed ... (1 Reply)
Discussion started by: Skmanojkum
1 Replies

3. UNIX for Dummies Questions & Answers

Auto input with echo

in cygwin, cron-config will ask two inputs: yes or no. 1st question, answer is no 2nd question, answer is yes my script: echo no | cron-config how do i pass yes to 2nd question ? (4 Replies)
Discussion started by: lawsongeek
4 Replies

4. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

5. High Performance Computing

Building a Solaris Cluster Express cluster in a VirtualBox on OpenSolaris

Provides a description of how to set up a Solaris Cluster Express cluster in a VirtualBox on OpenSolaris. More... (0 Replies)
Discussion started by: Linux Bot
0 Replies

6. Red Hat

The Red Hat Cluster Manager Installation and

Linux RedHat Cluster Manager InstallationAdministrationGuide (0 Replies)
Discussion started by: merlin
0 Replies
Login or Register to Ask a Question