Back

Openlava Elim

Pulling some information together for Openlava users documenting the ability to write your own monitor resources which the scheduler will then manage. This is handy so jobs go in PENDing mode while waiting for custom resoures to become available instead of crashing immeditaley upon submission.

#~/bin/bash

#Author:  James Davis

#Updated:  Dec 9, 2015

#declare the features we want to search for

declare -a features=(

    'svverification'

    'mtiverification'

    'msimhdlsim'

    'msimhdlmix'

  )

#endless loop that will echo out the line openlava is waiting for every 60 seconds

while true

  do

#counts how many features are in the array above and puts it as the first entry in the output

output="${#features[@]} "

    for i in ${features[@]}; do

      #line will equal the line that is in the format Users of FEATURE: (Total of XX licenses issued; Total of XX licenses in use)

      line=`/apps/flexnet-11.12/lmutil lmstat -c 1700@licensing -f $i | sed -n "/^Users of $i/p"`i

      #issued is the 1st numbers found

      issued=`echo $line  | sed -r 's/([^0-9]*([0-9]*)){1}.*/\2/'`

      #used is the 2nd numbers found

      used=`echo $line |  sed -r 's/([^0-9]*([0-9]*)){2}.*/\2/'`

      #subtract total and in use to get how many licenses are available

      available=$((issued-used))

      #concatenate the string for output

      output+="$i $available "

     done

     echo "$output"

     sleep 60

  done
  


Back