1 Reply Latest reply on Aug 30, 2019 9:16 AM by Mark Francome

    is there any commands to display the disk space for windows and Linux servers

    balaji ganesan
      Share This:

      is there any commands to display the disk space for windows and Linux servers. Since we are getting space issue on the server frequently. So am trying to schedule a job which frequently check the disk space on servers and am trying to setup an alert as well in advance to avoid this problem frequently.

       

      Regards

      Balaji Ganesan

        • 1. Re: is there any commands to display the disk space for windows and Linux servers
          Mark Francome

          Hi Balaji,

           

          Are you specifically interested in the Control-M systems? If so, see my post here -

           

          is there any commands for checking the space on control-M server

           

          which I paste here -

           

          1. An embedded script on the Control-M Server (running as the Control-M server userid) -

           

          #!/bin/bash

          usage=$(df -h /opt | tail -1 | cut -d' ' -f9 | cut -d'%' -f1)

          if [[ ${usage} -gt "85" ]]; then

          exit ${usage}

          else

          exit 0

          fi

           

          The above will end as NOTOK if the usage under /opt exceeds 85%.

           

          2. Run the ctmdiskspace utility command, e.g. -

           

          ctmdiskspace -limit 8% -path /pkgs/cntrlm/server

           

          3. I run this on my EM server, to test if that goes over 95% used -

           

          df ${HOME} |perl -ne 'm/\s(\d+)\%/o && exit (($1>94)?1:0)'

           

          4. I even have a test for the Control-M Agents which turns the used percentage into a variable for use in the subsequent shout -

           

          set +x; df -k $HOME |perl -ne 'if (/^.*?(\d+)\s*\%/o && ($1>=92)) {print qq{Control-M home filesystem on %%NODEID is ${1}% full\n}};' && df -k $HOME | grep -vE '^Filesystem|/dev' | awk '{ print $4 }' | xargs -t -i ctmvar -action set -var "%%%#%\FS_USD_2" -varexpr {}

           

           

          Antonio Gomes and Ilyas Shaikh also give their solutions on the linked reply.

           

          The Unix command is df -k ....