4 Replies Latest reply on Jan 4, 2019 7:03 AM by Mark Francome

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

    balaji ganesan
      Share This:

      we have critical jobs running on Control-M server, But the control-M jobs fails due to space issue most of the times, so if we schedule a job to check the space regularly, we can avoid some misses

        • 1. Re: is there any commands for checking the space on control-M server
          Adil Kareem

          Balaji,

           

          From ctm_menu, select Database Menu -> Report-> Database storage report

           

          And the Database Storage Report displays the following attributes of the Control-M/EM database in the server database:

          • Database name

          • Database type

          • Database size (refers to the operating system disk space)

          • Free space

          • Used space

          • Used percentage

          Message (warns the user when there is diminished disk space capacity within the Control-M/EM database server)

           

          Thanks

          Adil

          3 of 3 people found this helpful
          • 2. Re: is there any commands for checking the space on control-M server

            Hi Balagi

             

            ctmdiskspace

            Usage:

            -LIMIT Minimum amount of free space on the device [n% or nK or nM]

            -PATH Full path name of the device to check the free disk space. This option may be specified more than once.

            -QUIET If this flag is specified, no output is displayed on the screen

             

             

            Disk space can be proactively monitored by control-M Watchdog process that can be configured to CONFIG.DAT. You will receive Alert messages when thresholds are reached.

            ctmdiskspace util is native from control-M and it Checks the amount of free disk space on a specified device and sends an error message to the error handler if it is below the threshold.

             

            like this:

            # WatchDog exit's for Control-M

            WD_CTMEXIT_1_INTERVAL 20

            WD_CTMEXIT_1_TIMEOUT 30

            WD_CTMEXIT_1_RUN_STATE Y

            WD_CTMEXIT_1_SUSPEND_STATE N

            WD_CTMEXIT_1_SCRIPT_FILE ctmdiskspace

            WD_CTMEXIT_1_CMD_LINE -LIMIT "10 M" -PATH $HOME

            WD_CTMEXIT_1_ERROR_MSG Low on disk space

             

             

            A>Gomes

            3 of 3 people found this helpful
            • 3. Re: is there any commands for checking the space on control-M server
              Ilyas Shaikh

              Hi Balaji,

               

              If your question is about OS disk space you can use below in jobs to get an alert when OS disk space reaches defined threshold:

               

              1. Unix:

               

              df -h home_directory | awk '{print $5}'

              e.g. df -h /ctm | awk '{print $5}'

               

              2. Windows:

               

              Put the below line in batch file and call batch file through job:

               

              @echo off
              for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%1:'" get FreeSpace /format:value`) do set FreeSpace=%%x
              for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%1:'" get Size /format:value`) do set Size=%%x
              set FreeMB=%FreeSpace:~0,-6%
              set SizeMB=%Size:~0,-6%
              set /a Percentage=100 * FreeMB / SizeMB
              set /a DiskUtil=100 - Percentage

              echo %DiskUtil%%%

               

              For both Unix and Windows you can configure on do actions as follows to receive automatic alert when disk space reached threashold:

              Regards,

              Ilyas Shaikh

              2 of 2 people found this helpful
              • 4. Re: is there any commands for checking the space on control-M server
                Mark Francome

                Yes, we've got a few ...

                 

                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 {}

                 

                2 of 2 people found this helpful