oBag.AddValue and Alert Description
I have a monitor that runs a script that will generate an alert based on a certain response. This works fine in setting the monitor to critical and resetting to healthy when appropriate, alerts are opened and closed accordingly. I wanted to capture some of the output and add it to the alert description, but that is failing with Critical Alert Parameter Replacement Failure error. Failing replacement: $Data/Context/Property[@Name=’Status’]$. Not sure why it doesn't like that parameter. I add the value of Status using Call oBag.AddValue("Status",Status). The unhealthy expression is ( Property[@Name='Status'] Contains Stopped ) Status is the name of the field I'm looking for. The monitor is able to handle that correctly so I'm passing it right. Then the issue must be with the alert description syntax, but that looks correct to me. Note that I don't really want to the value of 'Status' in my alert description, I have other data I want to pass, but if I can't even get 'Status' into my alert description then I'm doing something wrong. Any clues for the clueless?
April 8th, 2011 8:44am

Try $Data/Context/DataItem/Property[@Name=’Status’]$http://OpsMgr.ru/
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 9:50am

Didn't work: Failing replacement: $Data/Context/DataItem/Property[@Name=’Status’]$ Wish this stuff was actually documented in more than a vague fashion.
April 8th, 2011 11:03am

Can you post the full code around this from the xml. There is nothing obviously wrong with the replacement - you might want to check the apostrophe in the @Name= as it seems to be ’ rather than ' - not sure if it would make a difference. Cheers GrahamView OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 11:47am

Your single-quotes are the problem. Note that the "unhealthy" expression has the straight up/down single quotes and the one for status has the "back-tick" type quotes. Assuming that you did a straight copy/paste and didn't get any "help" formatting it when you pasted it into the box here, that's probably your problem. I use $Data/Context/Property[@Name='fileage']$ and it works fine."Fear disturbs your concentration"
April 8th, 2011 11:52am

Yes, I think you're right. I'll try again and see what happens.
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 1:30pm

Excellent! That was the issue, thanks. I sometimes copy and paste right out of a web page so I can be sure of the syntax but I've noticed sometimes quotes are not correct. Not easy to spot either.
April 8th, 2011 2:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics