Sponsored Content
Top Forums Shell Programming and Scripting How do I calculate total number of active and non active hosts? Post 302761821 by fusetrips on Sunday 27th of January 2013 05:42:47 AM
Old 01-27-2013
How do I calculate total number of active and non active hosts?

Code:
#!/bin/bash
for digit in $(seq 1 10)
do 
if ping -c1 -w2 192.168.1.$digit &> /dev/null 
then 
echo "192.168.1.$digit is UP"
else
echo "192.168.1.$digit is DOWN"
fi 
done


Last edited by Scrutinizer; 01-27-2013 at 06:56 AM.. Reason: code tags
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Active / Non Active users ?

Hey, I have few Questions : 1. How to Check/Find who all are the users accessing the server using their id ? 2. How to Check who is the active user or non active user (whose id exists but the access privileges has been removed) ? I am presently using AIX5.3 as a server. Please suggest... (3 Replies)
Discussion started by: varungupta
3 Replies

2. AIX

Question about HACMP for active-active mode

Hi all, I am new to HACMP. So sorry for the newie question. But I did search the forum and it seems that no one asks this before. So if a 2-node cluster runs in active-active mode (and the same application), what is the benefit of using HACMP ? If it runs in active-stanby, it is easy to... (9 Replies)
Discussion started by: qiulang
9 Replies

3. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

4. Web Development

How to find number of http connections active currently in apache web server

Hi I have a solaris 9 OS with apache web server running on top of it. i want to know how many http connections are active at any point in time. (In other words how many users are accessing my website it at any moment of time) How to get it..? hit counters are not required... ----------... (0 Replies)
Discussion started by: aemunathan
0 Replies

5. Solaris

Link based Active Active IPMP

Hi, I need to configure 4 ip address (same subnet and mask) in one ipmp group (two interfaces) in an active active formation (link based). Can some one provide the steps or a tutorial link. Thanks (2 Replies)
Discussion started by: Mack1982
2 Replies

6. Shell Programming and Scripting

How to calculate the total number of weeks from a specify year?

Hi anyone can help? How to calculate total number of weeks from a specify date, for example, 01 Jan 2012. Thx! (2 Replies)
Discussion started by: rayray2013
2 Replies

7. UNIX for Beginners Questions & Answers

Find number of ACTIVE SSH putty sessions, excluding where the user hopped on to a diff server

Hi - If iam logged on to server A, on 4 putty windows using SSH ... and out of these 4 logged-in sessions, in one of the sessions if i did SSH from server A to server B; i would now have 4 putty windows sessions ... of which 3 are actively logged on to Server A while 1 putty window is actively... (2 Replies)
Discussion started by: i4ismail
2 Replies

8. Solaris

How to calculate total number of cores on my servers ?

Hi, I want to get total number of cores on my all non-global zones on Solaris 10. I got two methods and both are giving different results. Below link is a script, which tells me that total cores are 8 Mandalika's scratchpad: Oracle Solaris: Show Me the CPU, vCPU, Core Counts and the... (4 Replies)
Discussion started by: ron323232
4 Replies
PACKET.PKT(1)							 packet.pkt 1.0.1						     PACKET.PKT(1)

NAME
packet.pkt - Pkt module DESCRIPTION
Provides the object for a packet and the string representation of the packet. This object has an attribute for each of the layers in the packet so each layer can be accessed directly instead of going through each layer. To access the nfs layer object you can use 'x.nfs' instead of using 'x.ethernet.ip.tcp.rpc.nfs' which would very cumbersome to use. Also, since NFS can be used with either TCP or UDP it would be harder to to access the nfs object independently or the protocol. Packet object attributes: Pkt( record = Record information (frame number, etc.) ethernet = ETHERNET II (RFC 894) object ip = IPv4 object tcp = TCP object rpc = RPC object nfs = NFS object ) CLASSES
class Pkt(baseobj.BaseObj) Packet object Usage: from packet.pkt import Pkt x = Pkt() Methods defined here: --------------------- __str__(self) String representation of object The representation depends on the verbose level set by debug_repr(). If set to 0 the generic object representation is returned. If set to 1 the representation of is condensed into a single line. It contains, the frame number, IP source and destination and/or the last layer: '1 0.386615 192.168.0.62 -> 192.168.0.17 TCP 2049 -> 708, seq: 3395733180, ack: 3294169773, ACK,SYN' '5 0.530957 00:0c:29:54:09:ef -> ff:ff:ff:ff:ff:ff, type: 0x806' '19 0.434370 192.168.0.17 -> 192.168.0.62 NFS v4 COMPOUND4 call SEQUENCE;PUTFH;GETATTR' If set to 2 the representation of the object is a line for each layer: 'Pkt( RECORD: frame 19 @ 0.434370 secs, 238 bytes on wire, 238 bytes captured ETHERNET: 00:0c:29:54:09:ef -> e4:ce:8f:58:9f:f4, type: 0x800(IPv4) IP: 192.168.0.17 -> 192.168.0.62, protocol: 6(TCP), len: 224 TCP: src port 708 -> dst port 2049, seq: 3294170673, ack: 3395734137, len: 172, flags: ACK,PSH RPC: CALL(0), program: 100003, version: 4, procedure: 1, xid: 0x1437d3d5 NFS: COMPOUND4args(tag='', minorversion=1, argarray=[nfs_argop4(argop=OP_SEQUENCE, ...), ...]) )' SEE ALSO
baseobj(1) BUGS
No known bugs. AUTHOR
Jorge Mora (mora@netapp.com) NFStest 1.0.2 10 April 2013 PACKET.PKT(1)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy