I am trying to integrate Spectrum with BMC system using BMC's msend utility. msend is a utility to send event/alarm data to BMC system. I have modified AlarmNotifier's SetScript so it invokes msend to relay alarm data to BMC system when there is alarm.
However, whenever AlarmNotifier invokes the SetScript msend always failed with the following error.
Error. Cell 'xxxxxxx' cannot be initialized. Check your server directory file and program arguments. 'xxxxxxx' is ignored.
Fatal error! msend cannot find any valid cell. Are there any cell specified in the program argument or for the ServerName parameter?
If I open a bash shell and run the command manually/interactively with all the argument values then msend works without error.
This is due to different value of MCELL_HOME environment variable that is used by msend utility. When it is run interactively on a bash shell, the MCELL_HOME environment variable contains D:\win32app\Spectrum\Notifier\msend value which is Windows style directory path. When SetScript was invoked by AlarmNotifier, the MCELL_HOME environment variable contains /D/win32app/Spectrum/Notifier/msend value which is Unix style directory path. Unix style directory path is not recognized by msend and causes this failure.
Spectrum installed on Windows and AlarmNotifier customized to use the BMC msend utility.
Add the following line in SetScript to fix MCELL_HOME environment variable value before the msend line.
Notes: we need triple backslashes to escape backslash character properly in the script.