Sponsored Content
Top Forums Shell Programming and Scripting Shell script to ping multiple servers Post 302994029 by fretagi on Friday 17th of March 2017 03:16:15 PM
Old 03-17-2017
this is the output of the script with set -x
Code:
 ./netcheck.sh
+ date
Friday, March 17, 2017 09:10:54 PM CAT
+ cat /var/tmp/servers.list
+ read output
+ ping -c 1 192.168.6.4
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.4 is up'
node 192.168.6.4 is up
+ read output
+ ping -c 1 192.168.6.41
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.41 is up'
node 192.168.6.41 is up
+ read output
+ ping -c 1 192.168.6.24
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.24 is up'
node 192.168.6.24 is up
+ read output
+ ping -c 1 192.168.6.11
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.11 is up'
node 192.168.6.11 is up
+ read output
+ ping -c 1 192.168.6.108
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.108 is up'
node 192.168.6.108 is up
+ read output
+ ping -c 1 192.168.6.26
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.26 is up'
node 192.168.6.26 is up
+ read output
+ ping -c 1 192.168.6.51
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.51 is up'
node 192.168.6.51 is up
+ read output
+ ping -c 1 192.168.5.50
+ '[' 1 -eq 0 ']'
+ echo 'node 192.168.5.50 is down'
+ mailx -s '192.168.5.50 not pinging' xyz@asdf.com -b xyz@gmail.com
+ read output
+ ping -c 1 192.168.6.8
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.8 is up'
node 192.168.6.8 is up
+ read output
+ ping -c 1 192.168.6.9
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.9 is up'
node 192.168.6.9 is up
+ read output
+ ping -c 1 192.168.6.25
Invalid operation mode f
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.25 is up'
node 192.168.6.25 is up
+ read output
+ ping -c 1 192.168.6.26
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.26 is up'
node 192.168.6.26 is up
+ read output
+ ping -c 1 192.168.6.71
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.71 is up'
node 192.168.6.71 is up
+ read output
+ ping -c 1 192.168.6.107
+ '[' 0 -eq 0 ']'
+ echo 'node 192.168.6.107 is up'
node 192.168.6.107 is up
+ read output

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

script to ping servers

Hi , I would like to automate a script to ping all the unix servers perodically thru cronjob. Is there any script out there? If so Please give me. Thanks in advance. (2 Replies)
Discussion started by: sriny
2 Replies

2. Shell Programming and Scripting

Prevent wrong user from using shell script for multiple remote servers

Hi, I am running a shell script from a central server to multiple remote servers using the following code: application_check() { # Linux/UNIX box with ssh key based login SERVERS=`cat /tmp/server-details` # SSH User name USR="user" # create new file > /tmp/abc.log # connect... (2 Replies)
Discussion started by: mystition
2 Replies

3. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

4. Shell Programming and Scripting

Ping the hostname of many servers using a script

Hi We have some 300 servers in the Data center and some of them are running with AIX and some of them are running with Solaris. I need a script which can be run in one of the server and that script should ping the hostname of all the 300 servers. Also the script should notify if any server is... (9 Replies)
Discussion started by: newtoaixos
9 Replies

5. Shell Programming and Scripting

run vi/vim encrypted shell script without decryption on multiple servers

Hello Everyone, How do we run vi/vim encrypted shell script without decryption on multiple servers. It is a simple bash script and vim -nx <filename> has been used to encrypt with desired password. Now I have few errors, the syntax is absolutely fine as I have run that script multiple times on... (0 Replies)
Discussion started by: lovesaikrishna
0 Replies

6. Shell Programming and Scripting

Shell script to connect to multiple ssh servers

Hello, I have access to several linux servers (mostly centos based) located in a DC in another country. from day to day I need to login to each of them to do some work (they dont have gui/window manager installed, I work only from console), or even to just do a check like df -h for disc usage.... (3 Replies)
Discussion started by: MaRiOsGR
3 Replies

7. Shell Programming and Scripting

Script to Ping Servers

Hey, It's me again! Still trying to learn to become a better scripter on the job :) New challenge for assistance, if anyone cares to help, and its two parted! First part, I wanted to create a script at work that would ping a server that was supplied in an argument, then a count (amount of times)... (5 Replies)
Discussion started by: gkelly1117
5 Replies

8. Shell Programming and Scripting

Ping script to list of servers

Hi Friends, I have experience in redhat/ Ubuntu OS, but I am very new to solaries os. my servers OS is Oracle Solaris 10 8/11 s10x_u10wos_17b X86. I have a file contains 200 servers IPs one by one. now I want a script to chaeck which IPs are pinging, not pingning. I... (8 Replies)
Discussion started by: kumar85shiv
8 Replies

9. Shell Programming and Scripting

Need shell script to Telnet multiple node , Ping some IP and print output

Hi Team, Need shell script to Telnet multiple node , Ping some IP and print output like pass or fail. Need this script to check reachability of multiple nodes at same time. Help me. I use this but not working... Eg. in this script i need to telnet... (4 Replies)
Discussion started by: Ganesh Mankar
4 Replies

10. Shell Programming and Scripting

Shell script for connecting multiple servers and then copying 30 days old files

Shell script for connecting multiple servers and then copying 30 days old files from those server . HI , I have 6 multiple servers pla1,pla2,pla3,pla4,pla5,pla6 1. These six servers have common shared mount point /var/share 2. Running script from /var/share to connect these servers.I... (1 Reply)
Discussion started by: rcroyal88
1 Replies
NOS-TUN(8)						    BSD System Manager's Manual 						NOS-TUN(8)

NAME
nos-tun -- implement ``nos'' or ``ka9q'' style IP over IP tunnel SYNOPSIS
nos-tun -t tunnel -s source -d destination -p protocol_number [source] target DESCRIPTION
The nos-tun utility is used to establish an nos style tunnel, (also known as ka9q or IP-IP tunnel) using a tun(4) kernel interface. Tunnel is the name of the tunnel device /dev/tun0 for example. Source and destination are the addresses used on the tunnel device. If you configure the tunnel against a cisco router, use a netmask of ``255.255.255.252'' on the cisco. This is because the tunnel is a point-to-point interface in the FreeBSD end, a concept cisco does not really implement. Protocol number sets tunnel mode. Original KA9Q NOS uses 94 but many people use 4 on the worldwide backbone of ampr.org. Target is the address of the remote tunnel device, this must match the source address set on the remote end. EXAMPLES
This end, a FreeBSD box on address 192.168.59.34: nos-tun -t /dev/tun0 -s 192.168.61.1 -d 192.168.61.2 192.168.56.45 Remote cisco on address 192.168.56.45: interface tunnel 0 ip address 192.168.61.2 255.255.255.252 tunnel mode nos tunnel destination 192.168.59.34 tunnel source 192.168.56.45 AUTHORS
Nickolay N. Dudorov <nnd@itfs.nsk.su> wrote the program, Poul-Henning Kamp <phk@FreeBSD.org> wrote the man-page. Isao SEKI <iseki@gongon.com> added a new flag, IP protocol number. BUGS
We do not allow for setting our source address for multihomed machines. BSD
April 11, 1998 BSD
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy