Skip to main content

Posts

Showing posts with the label unix

ICMP Ping a Class C Network Subnet on Unix or Linux and return corresponding MAC Address

Ping a subnet by defining first three octets and return corresponding MAC Addresses for any IP addresses that respond to ICMP Ping on directly attached network. You may have come across this requirement but I use it very often to update the inventory and status of my network. Something I maintain and find very useful to audit the network, find anomilies and know what is allocated to what. Also useful if you manage MAC Address filtering on your Router. ------------------- Begin of script ./multiping ---------------------- #!/bin/bash echo "Usage: ./multiping [subnet e.g. 192.168.1]" CURR=1 SUBNET="$1" FILE=multiping.log touch $FILE function multiping() { ping -c1 -t1 $SUBNET.$CURR 2>&1 >/dev/null if [ "$?" -eq "0" ]; then echo $(arp $SUBNET.$CURR) >> $FILE fi } while [ $CURR -lt 255 ] ; do multiping & let CURR=$CURR+1 let MOD=$CURR%100 #this code is for prevent the saturation of the executable connections if [[ $MOD -eq...

How to find memory information on Linux, Unix, Solaris, AIX, HPUX, OpenVMS or FreeBSD

Solaris dmesg | grep mem prtdiag | grep Memory prtconf -v | grep Memory AIX bootinfo -r lsattr -E1 sys0 -a realmem getconf REAL_MEMORY HPUX dmesg | grep Physical /opt/ignite/bin/print_manifest | grep Memory machinfo | grep Memory Linux dmesg | grep Memory grep -i memtotal /proc/meminfo free OpenVMS show mem /page FreeBSD dmesg | grep memory grep memory /var/run/dmesg.boot sysctl -a | grep mem