08-10-2013 06:48 AM
Hi ALL Folks,
I hope u all doing good.
I have 200 clients in my data center.I have an outage in my data center.
I need to ping abd bptestbpcd those 200 client so that I can initiate the backup after the successful run of the command.
Can Any body please provide me the script in ehich I can put those 200 client and run that script that will show me the output of ping and bptestbpcd in a single go.
Thanks in Advance
NBU: 7.1.0.2
OS:LINUX
Solved! Go to Solution.
08-11-2013 09:26 AM
apologize , missing space after echo. i just tested it..
use the below lines it should work now..
for i in `cat /tmp/client_list` ;do echo -------------$i------------ >> /tmp/ping_result; /bin/ping -c 4 $i >>/tmp/ping_result ;done
for i in `cat /tmp/client_list` ;do echo -------------$i------------ >> /tmp/bptestbpcd_result; sudo/usr/openv/netbackup/bin/admincmd/bptestbpcd -client $i >>/tmp/bptestbpcd_result ;done
08-10-2013 08:38 AM
hi
08-10-2013 08:50 AM
4) run the file /tmp/ping_test
How to run this?
08-10-2013 08:56 AM
just type below in script name in command prompt and hit enter.
/tmp/ping_test
do the same for /tmp/bptestbpcd_test also..
08-10-2013 08:56 AM
[root admincmd]$ cd /tmp
[root tmp]$ sudo vi client_list
[root tmp]$ sudo chmod 777 client_list
[root tmp]$ sudo vi ping_test
[root tmp]$ sudo chmod 777 ping_test
[root tmp]$ sudo vi ping_result
[root tmp]$ sudo chmod 777 ping_result
[root tmp]$ sudo ./ping_test
./ping_test: line 1: syntax error near unexpected token `do'
./ping_test: line 1: `for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result;do ping -c 4 $i >>/tmp/ping_result ;done'
[root tmp]$ cat client_list
lx504.na.fordic.in
lx299..na.fordic.in
lx231.na.fordic.in
lx233.na.fordic.in
[root tmp]$ cat ping_test
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result;do ping -c 4 $i >>/tmp/ping_result ;done
08-10-2013 09:01 AM
[root tmp]$ /tmp/ping_test
/tmp/ping_test: line 1: syntax error near unexpected token `do'
/tmp/ping_test: line 1: `for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result;do ping -c 4 $i >>/tmp/ping_result ;done'
Getting the error.
08-10-2013 09:17 AM
resolved.. use this...
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result; ping -c 4 $i >>/tmp/ping_result ;done
08-10-2013 09:26 AM
should i run
sudo ./ping_test?
08-10-2013 09:28 AM
did you update the file ping_test with the line that i have provides..
if yes.. go ahead and run it
08-10-2013 09:32 AM
Yes I have update it.
[root tmp]$ sudo ./ping_test
./ping_test: line 1: echo----------lx504.na.fordic.in--------------: command not found
./ping_test: line 1: echo-------------lx299.na.fordic.in------------: command not found
./ping_test: line 1: echo-------------lx231.na.fordic.in------------: command not found
./ping_test: line 1: echo-------------lx233.na.fordic.in------------: command not found
[root tmp]$ cat ping_test
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result; ping -c 4 $i >>/tmp/ping_result ;done
08-10-2013 10:03 AM
Anybody please help me on this please
08-10-2013 10:58 AM
hoo... its not able to find the ping command in your login shell..
how you will use the ping command...?
sudo ping <servername>
if yes.. you again need to replace the script.. ping in the script should be replace with the command how it works in your environment.
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result; sudo ping -c 4 $i >>/tmp/ping_result ;done
you probably need to do the same for bptestbpcd also..
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/bptestbpcd_result; sudo /usr/openv/netbackup/bin/admincmd/bptestbpcd -client $i >>/tmp/bptestbpcd_result ;done
08-11-2013 07:02 AM
In my environment ,we use ping server name to ping .Not sudo ping.
08-11-2013 07:21 AM
Zoan - you need to figure out to to run commands provided/script - we can't remote see how a system is configured.
08-11-2013 07:26 AM
I have one question Nicolai.
Should i run sudo ./ping_test or simply ping_test ?
08-11-2013 07:28 AM
I have Linux OS.64 bit.5.6 version.irectory
I have created all files under /tmp
and I am currently under /tmp directory
08-11-2013 08:03 AM
show us the output of below 2 commands
which ping
ping <masternservername>
08-11-2013 08:21 AM
[root @masterlx log]$ which ping
/bin/ping
[root @masterlx log]$ ping masterlx
PING masterlx.na.fordic.in (14.142.123.149) 56(84) bytes of data.
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=2 ttl=64 time=0.018 ms
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=3 ttl=64 time=0.015 ms
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=4 ttl=64 time=0.015 ms
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=5 ttl=64 time=0.012 ms
64 bytes from masterlx.na.fordic.in (14.142.123.149): icmp_seq=6 ttl=64 time=0.012 ms
--- masterlx.na.fordic.in ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 4999ms
rtt min/avg/max/mdev = 0.012/0.014/0.018/0.005 ms
08-11-2013 09:26 AM
apologize , missing space after echo. i just tested it..
use the below lines it should work now..
for i in `cat /tmp/client_list` ;do echo -------------$i------------ >> /tmp/ping_result; /bin/ping -c 4 $i >>/tmp/ping_result ;done
for i in `cat /tmp/client_list` ;do echo -------------$i------------ >> /tmp/bptestbpcd_result; sudo/usr/openv/netbackup/bin/admincmd/bptestbpcd -client $i >>/tmp/bptestbpcd_result ;done
08-12-2013 02:24 AM
@zoan_nbu - this discussion is turning into a Unix lesson.
Please call your Unix/Linux system administrator, show him/her this thread and let the Admin help you to make this work in your environment.
None of the discussion so far has anything to do with NBU....