Our legacy site: www.webwob.com   

VUgen scripting methods (page 3)

This page will cover more BASH scripting methods, following on from the legacy site pages.

     LoadRunner CI/CD      *_LR_CI_*      LR_CI_+      Email_out      Email_in      Cookies 1      TUTORIAL      sprintf      debug      VUgen      Kill -9      disk space      AWS S3      dig (DNS++)      substitute      curl with timings      LR_Jenkins_graphs     


Areas covered on this page

1: Root DNS lookup to list servers

2: Copy over directories to a new location (cp -ndpR)

3: Human readable disk sizes etc.

I use this to see quickly see how many servers are deployed in my test environment

Root DNS lookup to list servers  

  $ dig +short all_web.environment.channel.com
bind-utils needs adding to cygwin

      Example 2:
for i in {1..9}; do dig +short app0$i.xxxv1-prod.s7cloud.co.uk; done

      ( I put
in there, change that for the farm/environment you’re interested in. )

Example3 including output:

      $ for i in {1..9}; do dig +short app0$i.xxxv1-stage.s7cloud.co.uk; done
If there’s no IP address then there’s no app server.. it looks like there are some CNAMEs for app04,5,6 but no corresponding A records, I would expect this is from a previous scale up followed by scale back down again. Should it go back up to 6 servers, those CNAMEs would be replaced.

Get count of pure IPs returned  

  dig +short allweb.stage.channel.com | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | wc -l

nslookup queries the DNS entry for a domain name or ip address
tracert queries the route for a domain name or ip address. ( adding -h 3 limits the hops to 3, for example )


Copy over directories to a new location

Preserve links. Don't overwrite existing files.

  cp -ndpR <source> <destination>
  -p same as --preserve=mode,ownership,timestamps
  -n, --no-clobber do not overwrite an existing file
  -d same as --no-dereference --preserve=links
  -R, -r, --recursive copy directories recursively


Human readable disk sizes etc.

  df -H
  du -sh */   
  ls -lh   

  df - display free disk space with df viewed as human readable.
  du – displaying disk usage for a specific file, folder, directory
  ls – for the generic list command, you’ll need to attach -h to another flag, like -l: