Sponsored Content
Full Discussion: Network related script
Top Forums Shell Programming and Scripting Network related script Post 302914792 by Chubler_XL on Thursday 28th of August 2014 12:25:12 AM
Old 08-28-2014
You could try something like this:

Code:
#!/bin/bash

upcnt=0
downcnt=0
for ip in 192.168.1.{3..19}
do
   if ping -c 1 -W 1 $ip > /dev/null
   then
        let upcnt=upcnt+1
        uplist="$uplist\n    $ip"
   else
        let downcnt=downcnt+1
        downlist="$downlist\n    $ip"
   fi
done

printf "$upcnt ips are available:$uplist\n"
printf "$downcnt ips are not available:$downlist\n"

Note: if not response from a server it will wait up to 1 second to be sure server is unreachable - so maximum runtime should be close to 17 seconds.
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Model script related question

Hey fellow bit pushers, I have been seeing an odd problem on a few of my systems and was wondering if any of you have seen it on your systems and possibly know why it happens. We have a custom model script for a printer on our systems. This model script is just a standard ksh script... (2 Replies)
Discussion started by: TioTony
2 Replies

2. Shell Programming and Scripting

shell script related to server

I want to run a shell script in such a manner so that if i will run that script on one place than changes related to that will reflect on all the servers in which i want.Is it possible to write such kind of script?Please respond me as early as possble because it is very urgent for me. (2 Replies)
Discussion started by: nitiwari
2 Replies

3. Shell Programming and Scripting

shell script related query

Hi I have an input to a file. I want the script to return it formatted the input is a number, say , 1234567895 and the output should be 21 43 65 87 59 ,ie, the pair of two digits should be reversed. How can I do this using a shell script? (1 Reply)
Discussion started by: gopsman
1 Replies

4. Solaris

Solaris 10 network, process, database related comands

Hi everbody, Can anyone let me know the resources for list of network, process, database related commands of solaris10 possibly with little bit of explanation. Thanks in advance, Chandra Sekhar. (1 Reply)
Discussion started by: chandoo.java
1 Replies

5. UNIX for Dummies Questions & Answers

script to kill related processes

hi guys, can anyone help me out with the script to kill all the related process at once. i have something like below ps -fu UID PID PPID C STIME TTY TIME CMD xyz 17398 1 2 Dec30 ? 00:31:20 ./psa_mux -simulate -client_ports 22000 xyz 17399 1 2... (2 Replies)
Discussion started by: smithaph
2 Replies

6. Shell Programming and Scripting

Problem related to shell script

I am new in shell script.I want to write a shell script to read username and password from file and compare it with the username and password which is entered by the GUI application. (1 Reply)
Discussion started by: shubhig15
1 Replies

7. AIX

Network related errors

Hi How to check if my AIX server has any network related errors ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

8. Shell Programming and Scripting

Query related to ftp script

Hi, I was planning to write a FTP script that will FTP files to destination folder. All configuration should be done through a properties files, I have developed two files under /home/499633/scripts) scripts folder, and my main file(ftp_script.sh) should read the properties from the properties... (2 Replies)
Discussion started by: rahul125
2 Replies

9. Shell Programming and Scripting

need downloading related help...but its not related to unix

Hi All, I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file See the below link- http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs- Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies

10. Emergency UNIX and Linux Support

Network related issues

Oflate we are finding a few servers experiencing severe slowness. What would be the commands that I need to try to postmortem the situation? (3 Replies)
Discussion started by: ggayathri
3 Replies
POLYGRAPH(7)							   User Commands						      POLYGRAPH(7)

NAME
Polygraph - performance benchmark for web intermediaries DESCRIPTION
Web Polygraph is a performance testing tool for caching proxies, origin server accelerators, L4/7 switches, content filters, and other Web intermediaries. Polygraph's features include: * high-performance HTTP clients and servers * realistic HTTP, FTP, and SSL traffic generation * HTTP Basic, NTLM, and Negotiate proxy authentication * LDAP-friendly generation of user credentials * flexible content simulation * ready-to-use standard workloads for benchmarking * powerful domain-specific configuration language * portable open-source implementation * friendly commercial support Web Polygraph consists of many tools listed below. See individual man pages for more information. Detailed documentation is available at www.web-polygraph.org. polygraph-aka - IP aliases manipulation tool polygraph-beepmon - forwards BEEP messages to an external program polygraph-cdb - content database manipulation tool polygraph-client - Web Polygraph client simulator polygraph-cmp-lx - log comparison tool polygraph-distr-test - distribution test polygraph-dns-cfg - DNS server configuration tool polygraph-lr - console log extractor polygraph-ltrace - trace extractor polygraph-lx - stats extractor polygraph-pgl2acl - translates PGL access rules into Squid Proxy ACLs polygraph-pgl2eng - PGL to English converter polygraph-pgl2ips - PGL IP addresses calculator polygraph-pgl2ldif - LDIF (and other text-based) configuration generator polygraph-pgl-test - PGL validator polygraph-pmix2-ips - PolyMix-2 address calculator polygraph-pmix3-ips - PolyMix-3 address calculator polygraph-polymon - interactive test monitoring tool polygraph-polyprobe - tests TCP throughput in a full client/server mesh polygraph-polyrrd - supplies run-time Polygraph stats to RRDtool polygraph-pop-test - predicts cache hit ratios for a given workload polygraph-reporter - HTML report generator polygraph-rng-test - random number generator test polygraph-server - Web Polygraph server simulator polygraph-udp2tcpd - converts UDP monitoring messages into a TCP stream read by polymon polygraph-webaxe4-ips - WebAxe-4 address calculator COPYRIGHT
Copyright (C) 2003-2006 The Measurement Factory, Inc. SEE ALSO
polygraph-aka(1), polygraph-beepmon(1), polygraph-cdb(1), polygraph-client(1), polygraph-cmp-lx(1), polygraph-distr-test(1), polygraph-dns-cfg(1), polygraph-lr(1), polygraph-ltrace(1), polygraph-lx(1), polygraph-pgl2acl(1), polygraph-pgl2eng(1), polygraph-pgl2ips(1), polygraph-pgl2ldif(1), polygraph-pgl-test(1), polygraph-pmix2-ips(1), polygraph-pmix3-ips(1), polygraph-polymon(1), polygraph-polyprobe(1), polygraph-polyrrd(1), polygraph-pop-test(1), polygraph-reporter(1), polygraph-rng-test(1), polygraph-server(1), polygraph-udp2tcpd(1), polygraph-webaxe4-ips(1) http://www.web-polygraph.org/ - project web site Web Polygraph February 2010 POLYGRAPH(7)
All times are GMT -4. The time now is 11:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy