Visit The New, Modern Unix Linux Community


Help needed with bash script providing battery status


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help needed with bash script providing battery status
# 1  
Tools Help needed with bash script providing battery status

I'm really new to even doing a bash "hello world" script, so maybe someone would know how to do the following task, using bash scripting

Need to login using ssh from one dell server into another dell server, and obtain the raid battery status, using dell's open manage software commands; then provide those results back to the first server

Thanks so much in advance!
-AJ

Smilie
# 2  
The answer for how to do that with ssh is very similar to the answer for how to do that without ssh. What exactly do you need to put into openmanage?
This User Gave Thanks to Corona688 For This Post:
# 3  
so I tried on my own from some bash tutorials, but all my script does is log me into the remote server and kicks me back to the orig server

here's what i have, still not sure if bash scripting is as simple as DOS batch files or if it involves a bit more

su9 ssh [IP]
omreport storage battery >> [path to the text file on orig server]
logout

seems as though the ssh session kicks me out without even issuing the logout command, so i'm losing the ssh connection somehow also, possibly even before the omreport command runs

any additional help is welcomed!
# 4  
I don't know what that "su9" is supposed to do.

ssh doesn't work like that. It tries to run the 'ssh' command locally, waits for it to finish, then tries to run the 'omreport' command locally because you didn't feed the following things into ssh. To feed commands into ssh, you must feed them into ssh. There's several ways to do that.

To run one command on the remote server:

Code:
ssh username@host command

It will run that command then immediately return.

Code:
ssh username@host <<EOF
command1
command2
command3
EOF

It will run the shell script given between <<EOF and EOF.
This User Gave Thanks to Corona688 For This Post:
# 5  
those ideas should help me get on the right track, thank you so much!

oh and su9 is the command we use to login to a server as the root user without needing a password each time
# 6  
You do not need root to run ssh.

If you need it to run the battery command, run it on the remote side, not the local one.
This User Gave Thanks to Corona688 For This Post:

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #606
Difficulty: Easy
MySQL 7.0 added the JSON utility function JSON_PRETTY(), which outputs an existing JSON value in an easy-to-read format.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ignore exit status for #!/bin/bash -e

I have a file /u/setuplink.txt more setuplink.txt ln -s /u/force.sh stopf.sh ln -s /u/tnohup.sh tnohup.sh ln -s /u/quick.sh startquick.sh more runstat.sh #!/bin/bash -e echo "START" /u/setuplink.txt echo "END" i wish to exit the runstat.sh for any errors except if the link... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Bash Script Help Needed

I have a small script I wrote to look for empty files on a Linux box. It finds the empty files and emails the list to me. That works great. What I need to do now is set a cron job to run the thing every 10 minutes or so (no problems there) but I don't want to get any more emails if the last email... (14 Replies)
Discussion started by: wviands
14 Replies

3. Shell Programming and Scripting

Input password to bash script, save, and enter when needed

I am looking for a way to start a script and have it prompt for a password that will be used later on in the script to SSH to another host and to SFTP. I don't want the password to be hard coded. Below is my script with the actual IP's and usernames removed. #!/usr/bin/expect -f... (2 Replies)
Discussion started by: jbrass
2 Replies

4. Homework & Coursework Questions

Linux/UNIX Bash Shell Script trouble help needed!!

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 2. Shell Bash Script 3. !/bin/bash if echo no directory then mkdir -p /home/AC_Drywall elif ; then echo "$dir already exist" fi (4 Replies)
Discussion started by: TomFord1
4 Replies

5. Shell Programming and Scripting

Bash Script to Find the status of URL

#!/bin/bash timevar=`date +%d-%m-%Y_%H.%M.%S` #-- > Storing Date and Time in a Variable get_contents=`cat urls.txt` #-- > Getting content of website from file. Note the file should not contain any http:// as its already been taken care of echo "Datae-time URL Status code Report" >... (2 Replies)
Discussion started by: anishkumarv
2 Replies

6. Programming

Bash Script to Find the status of URL

#!/bin/bash timevar=`date +%F_%H_%M` #-- > Storing Date and Time in a Variable get_contents=`cat urls.txt` #-- > Getting content of website from file. Note the file should not contain any http:// as its already been taken care of ######### Next Section Does all the processing ######### for i... (0 Replies)
Discussion started by: anishkumarv
0 Replies

7. Solaris

Get the battery status (Sparc T1000)

Hi, How to get the battery status and temperature using command in Solaris? Thanks in advance. (4 Replies)
Discussion started by: forumguest
4 Replies

8. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

9. Shell Programming and Scripting

NIC status bash shell

Hi can someone tell me what command i can use to find the NIC status im using the bash shell. I'v tried ifconfig -a but this comes back as command not found. (3 Replies)
Discussion started by: warlock129
3 Replies

10. Shell Programming and Scripting

script providing input to application prompts

Hi! I want to write a script that will create an archive (via tar) that will restrict the size of the tar file. The size can be constrained using the keyword 'k' and providing the size restriction. The problem is that the script needs to know (detect) when the tar command prompts the user (which... (2 Replies)
Discussion started by: mitch8
2 Replies

Featured Tech Videos