On thing I was always missing in System Center Operations Manager (SCOM) was the notification with other instant messaging (IM) protocols than the build in Microsoft Communicator.
On friday I had some time to test a solution which I will describe here.
On warnung at the beginning: This current solution is experimental. It will run a Miranda client in the system context and can be a large security hole for your SCOM server!
The first thing I had to to is finding a client which can be controlled by command line or by a SDK. I stumbled upon the command line plugin for Miranda IM. Miranda IM is an open source mutli-protocol instant messaging client. With it you can integrate multiple protocols with plugins.
I created a test ICQ account and a surrounding batch file for miranda:
setlocal set log="c:\logging.log" echo. >> %log% echo starting %date% %time% >> %log% rem läuft miranda schon? tasklist | findstr /i miranda32.exe if %errorlevel%.==0. goto laeuft echo Starte Miranda im System Kontext >> %log% start "" "%~dp0miranda32.exe" echo 10 sec warten... ping -w 1000 -n 10 188.8.131.52 goto weiter :laeuft echo Miranda laeuft schon >> %log% :weiter echo mimcmd message %~1 "%~2" >> %log% mimcmd message %~1 "%~2">> %log% endlocal
First it checks if miranda is already running. The command Tasklist is only available in Windows 2008 and later. If it isn’t running it will be startet (has to be in the same directory as the batch file) and the batch waits for 10 seconds. After that it will use the mimcmd command the send the message.
The batch file takes two parameter: 1. the target of the im (can be more than one) 2. The message to send.
To use this batch file you have to create a Command Notification Channel in SCOM:
And here the interesting command line call:
I have used only one target. You can define more then one target by surounding the second parameter (everything between 5 and 49) with qoutes like this: “ICQNumber1 ICQNumber2” or if you want to specify the protocol: “ICQNumber1:ICQ MSNAlias:MSN”. For details look into the readme of the command line plugin.
For sending something to this channel you have to create a subscriber:
And after that you create a normal subscription with the channel and the subscriber.
If everything worded correctly you will see after the first alert in the process list (task manager):
a miranda process in the system context. And in you IM client:
To increase the security you should deactivate and delete all plugins that aren’t necessary. Here is my plugin list:
I will try to start the miranda process with lower privileges but still in the system context.