Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a simple way to monitor RabbitMQ queues from SCOM. In particular, I want to be notified when a particular queue (one we use for "dead letters") is not empty.

RabbitMQ has a RESTful web API (the RabbitMQ Management HTTP API) that will return the desired data; it only supports JSON. I've already wrapped the call to that in a .NET library. I've written a PowerShell script to interface between that and SCOM, but our network administrator can't get it to work. He'd prefer a VBScript solution.

I can expose the .NET library to COM and call that from VBScript. This seems absurdly complex. Is there a simpler way?

share|improve this question
up vote 1 down vote accepted

Any reason your network administrator doesn't just call your powershell script from a VBScript? I know it doesn't help the absurd complexity, but it might be the easiest solution. Tell him to write a custom monitor containing this simple piece of vbs:

Set objShell = CreateObject("WScript.Shell")
strPoSHCmd = "powershell.exe -noprofile -command C:\path\to\script.ps1"
objShell.Run strPoSHCmd

Edit the C:\path\to\script.ps1 to suit your needs. You could also have the vbscript returning the values from PowerShell (supposing your PS script returns a value), to SCOM, by creating a MOM.ScriptAPI propertyBag, like this:

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()

Set objShell = CreateObject("WScript.Shell")
strPoSHCmd = "powershell.exe -noprofile -command C:\path\to\script.ps1"
PSReturn = objShell.Run strPoSHCmd

Call oBag.AddValue("Output",PSReturn)
Call oAPI.Return(oBag)
share|improve this answer
Thanks! I'll suggest that. – TrueWill Feb 17 '12 at 2:23
Just added a more realistic example – Mathias R. Jessen Feb 20 '12 at 16:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.