Command return value in HMC


 
Thread Tools Search this Thread
Operating Systems AIX Command return value in HMC
# 1  
Old 01-19-2009
CPU & Memory Command return value in HMC

I have script runninn from cron pulling backup of hmc through nfs share

ssh user@hmc "bkconsdata -r nfs -h <hostname> -l <nfs share> "

This works perfect and I pull the backups regularly.. but problem

Now I need to enhance the script, like take action if a backup fails..

"How do I collect the return value of the command running on hmc?"

Note: The script runs from a remote AIX box with password less authentication.

Balaji
# 2  
Old 01-19-2009
This is more of a shell scripting question than an AIX problem. Do the following (only a sketch, you will have to fine-tune this):

Code:
RetVal=$(ssh user@hmc "bkconsdata -r nfs -h <hostname> -l <nfs share> ; echo $?")

Your return value would be in $RetVal. If the command run on the hmc has some more output you should suppress it ( "... >/dev/null 2>/dev/null") so that the only remaining output is the return code.

I hope this helps.

bakunin
# 3  
Old 01-24-2009
Thanks Bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Command to see the status of managed node from CLI of HMC?

Folks, Asking a silly question - is there a way to know the status(Power Off/Running) of a managed node from CLI of HMC, alike the way we see it for the LPARs running on the node from 'vtmenu'? Most of us use the UI to see the status of the LPARs/Managed node - but just inquisitive to know if... (4 Replies)
Discussion started by: thisissouvik
4 Replies

2. AIX

HMC login - Command line and terminal session

Hi Admins, Just a small question - Can we have multiple session for single user on HMC. e.g. Can I have a terminal session (via IE ) and command line (ssh) at same time ?? I am not sure whether it will impact HMC system or not. So want to make sure. let me know folks. Thanks (3 Replies)
Discussion started by: snchaudhari2
3 Replies

3. AIX

Command to show HMC of this lpar?

Does anyone know of a command that can be run on the lpar to show the name of the lpars managing HMC? We have a large environment and records a little old on which HMC manages which lpars....if i could login to an lpar and just issue a command to show me its managing hmc that would be great. (2 Replies)
Discussion started by: Foiled
2 Replies

4. UNIX for Dummies Questions & Answers

Select Command - return

Hello everyone, A simple question which may have a suggested solution: I am using, and loving, the select command in a ksh93 script on AIX 6.1 to present users with menus. I have been successful in controlling all of key input by the users, I still have an issue with the RETURN key. When the... (4 Replies)
Discussion started by: gio001
4 Replies

5. AIX

lauch command line from HMC

is possible to launch command line(shell) from HMC console? :( (2 Replies)
Discussion started by: prpkrk
2 Replies

6. UNIX for Dummies Questions & Answers

Command does not want to return on ssh

Hi, I am trying to use this command to backup my remote server: ssh ftp nice -19 bru -cXiAf mail-02:/dev/nst1 /etc When I run I get: connect to address 205.150.86.5 port 544: Connection refused connect to address 205.150.86.5 port 544: Connection refused trying normal rsh... (1 Reply)
Discussion started by: mojoman
1 Replies

7. Solaris

df command always return 0%

Hi, I don't know why but about 80% of time when I execute the command "df -v /directory" the output is always 0% used. Anyone have clue to why this is happening? Thanks. (2 Replies)
Discussion started by: polexx
2 Replies

8. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

9. Shell Programming and Scripting

Return value of piped command?

grep $SEARCH_STRING /etc/passwd | cut -d":" -f 1,5 I need to check the $? value of grep in the above. If I place a test for $? after the above piped command, it returns success status of grep piped to cut. How can I get the success status of grep alone? (5 Replies)
Discussion started by: krishmaths
5 Replies

10. Shell Programming and Scripting

Mailx Return Email Command

Hi, I'm trying to use the Mailx Return Email Command with a file attachment. If I use the file attachment by itself, it works ok. But If I add the return email command, it won't attach the file to email. Subject, return_email_address Send_email_address, Body, attachment,... (1 Reply)
Discussion started by: lisa0703
1 Replies
Login or Register to Ask a Question