Wednesday, July 26, 2017

▷ HP-UX network info (네트워크 정보)

[ To find network info ]


HP-UX)
      netstat -ni -w | grep -v '^lo' | sed -n '2,$ p' | awk '{ print $1, $4 }' | while read DEV_NAME DEV_ADDR
      do
         DEV_NAME_CUT=`echo ${DEV_NAME} | tr -d '*' | cut -d: -f1`
         DEV_MAC=`lanscan | grep -w "${DEV_NAME_CUT}" | awk \
            '{for(i=3;i<14;i=i+2) {
                 m=substr($2,i,2);
                 MAC=MAC":"m;
              }
              print MAC;
             }' | sed -e 's/^://'`
         ...
     
         printf "%s %s %s\n" "${DEV_NAME}" "${DEV_MAC}" "${DEV_ADDR}"
      done
   
      nwmgr | grep '^lan' | awk '$2=="UP" && $6!="" { print $1, $3, $6 }' | while read DEV_NAME DEV_MAC DEV_REL
      do
         DEV_MAC=`echo ${DEV_MAC} | awk '{for(i=3;i<14;i=i+2) { m=substr($1,i,2); MAC=MAC":"m; }; print MAC; }' | sed -e 's/^://'`
     
         # if it is a related interface
         printf "%s %s %s\n" "${DEV_NAME}" "${DEV_MAC}" "(Related=${DEV_REL})"
      done
   
      ;;

No comments:

Post a Comment

◈ Recent Post

▷ UITest demo with TestOne (Mobile, Keypad and Drag until found tip)

[ UITest Demo Environment ] 1. UITest Solution: TestOne 2. Description 데모 설명    How to use keypad, and to drag until found.     키패드를...

◈ Popular Posts