cancel
Showing results for 
Search instead for 
Did you mean: 

ping and bptestbpcd

zoan_nbu
Level 4

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

1 ACCEPTED SOLUTION

Accepted Solutions

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

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

View solution in original post

19 REPLIES 19

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

hi 

1)put all client names in the file /tmp/client_list 
 
2)for ping test keep this below lines in file /tmp/ping_test
 
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result;do ping  -c 4 $i >>/tmp/ping_result ;done
 
3)chmod 755 /tmp/ping_test
4) run the file /tmp/ping_test
5) check the result in /tmp/ping_resul
 
 
for bptestbpcd test :-
1) keep this below lines in file /tmp/bptestbpcd_test
 
for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/bptestbpcd_result;/usr/openv/netbackup/bin/admincmd/bptestbpcd -client $i >>/tmp/bptestbpcd_result ;done
 
2)chmod 755 /tmp/bptestbpcd_test
3) run the script /tmp/bptestbpcd_test
4)check the result in /tmp/bptestbpcd_result
 

zoan_nbu
Level 4

4) run the file /tmp/ping_test

 

How to run this?

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

just  type below in script name in command  prompt and hit enter.

/tmp/ping_test 

do the same for /tmp/bptestbpcd_test also..

 

zoan_nbu
Level 4

[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

 

 

zoan_nbu
Level 4

[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.

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

 

resolved.. use this...

for i in `cat /tmp/client_list` ;do echo-------------$i------------ >> /tmp/ping_result; ping  -c 4 $i >>/tmp/ping_result ;done

zoan_nbu
Level 4

should i run

 

sudo ./ping_test?

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

did you update the file ping_test with the line that i have provides..

if yes.. go ahead and run it 

zoan_nbu
Level 4

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

 

zoan_nbu
Level 4

Anybody please help me on this please

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

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

zoan_nbu
Level 4

In my environment ,we use ping server name to ping .Not sudo ping.

 

 

Nicolai
Moderator
Moderator
Partner    VIP   

Zoan - you need to figure out to to run commands provided/script - we can't remote see how a system is configured.

 

zoan_nbu
Level 4

I have one question Nicolai.

Should i run  sudo ./ping_test  or simply ping_test  ?

zoan_nbu
Level 4

I have Linux OS.64 bit.5.6 version.irectory

 

I have created all files under /tmp

and I am currently under /tmp directory

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

show us the output of  below 2 commands

which ping 

ping <masternservername>

zoan_nbu
Level 4

[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

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

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

Marianne
Level 6
Partner    VIP    Accredited Certified

@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....