I did the following script to ping multiple servers, but I keep on receiveing duplicate emails for one server that is down:
So the first email I received had body as "node is down" and subject "not pinging"
and second email I received had body as "node 192.168.5.50 is down" and subject "192.168.5.50 not pinging".
So I have 13 ips on the servers.list, so the only server down is 192.168.6.50
Sounds like you have an empty first line in servers.list (which you unfortunately didn't post). As usual, an incomplete specification yields suboptimal proposals/solutions.
Are these servers in a reasonable subnet? e.g. 10.1.1.x
If they are, then you might consider nmap which can ping a range of servers. Beware that by default it will probe all sorts of ports, which might not be what you want and can cause anti-intrusion alerts to be triggered.
Do not do this to public internet servers else your ISP or others may cut you off.
Something like this might do the trick:
You will need to confirm the correct flags for your implementation. The IP range can be a string such as (in the example above) 10.1.1.0/24 so it will scan the whole class C subnet.
Going with a smaller netmask (i.e. the /24 reducing to /23 or less) will exponentially increase the number of ip addresses tried and exponentially increase the execution time.
It will also increase the likelihood of triggering anti-intrusion alerts, which may be "detrimental to your career prospects"
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)
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)
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)
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)
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)
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)
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)
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)
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)