2 Replies Latest reply on Sep 22, 2016 6:56 AM by Bill Robinson

    sendmail attachment script fails with file not found

    Dinesh Babu Bashyam

      Hi, I am writing a simple script to send email, but it fails saying "Command execution failed. com.bladelogic.om.infra.mfw.util.BlException: File provided does not exist".  Can anyone tell me what I am doing wrong here?

       

      While I replace the nsh //AIXserver/work/OS/OS.ksh >> /tmp/oslog with

       

      nsh //linuxserver/tmp/a.sh >> //linuxserver/tmp/oslog  --> this works perfectly as the a.sh script just merely echos a welcome message

       

      This script nsh //AIXserver/work/OS/OS.ksh does some patching works, I suspect there is some other way to get the output, but not sure what it is.  When the script runs I give the server name on which this nsh script should run but why its not able to find the file I am not sure.

       

      #!/usr/bin/nsh

      set -x

      SERVER_GROUP=$1

       

      blcli_execute Server listServersInGroup "${SERVER_GROUP}"

      blcli_storeenv SERVER_LIST

       

       

      while read serverName

      do

      nsh //AIXserver/work/OS/OS.ksh >> /tmp/oslog

      done <<< "$(echo "${SERVER_LIST}" | awk 'NF')"

       

       

      blcli_execute Server getBulkServerPropertyValuesAndLogResults "/tmp" "oslog"

       

       

      mv "/tmp/oslog" "mov_oslog"

       

       

      blcli_execute Email sendMailWithAttachment "admin@company.com" "dinesh@company.com" "BL_Server_Inventory_UNIX: ${SERVER_GROUP}" "Attached is the Server Inventory Report ${SERVER_GROUP}" "/tmp" "mov_oslog"

      Error Sep 22, 2016 6:27:36 AM Command execution failed. com.bladelogic.om.infra.mfw.util.BlException: File provided does not exist