I’d love to have a reply to this problem, but I’m trying to do a similar thing myself – I thought I might be the first!
I want to retrieve the FromAddress from the Exchange 2007 queues and report back to Nagios any user that has over a certain number of messages in the queue. I plan to use this to help detect compromised accounts as we have a different official solution for sending out large amounts of e-mail. Anyways, I’ve gone an extremely roundabout way to fix this and have finally decided to admit that I need help.
I found a great Exchange Management Shell query and modified it slightly to suit my purposes:
I saved this as c:\nrpe_nt\queue.ps1
I figured out, finally, how to run this from the command line and saved this command as c:\nrpe_nt\queue.bat
I entered this into nrpe.cfg thusly:
When running this from our remote Groundwork/Nagios server, I use the following command:
While this code works for every other nrpe_nt check (such as disk space, cpu utilization, and other checks I’ve written), this one only returns a blank line. Running the command starting with cmd /c from the command line outputs fine.
Anyone have any ideas? I originally tried to run the ps1 from nrpe.cfg with no luck, which is why I ended up with the batch script. Still, I see no reason for this not to work. It doesn’t timeout. Running the command locally takes < 6 seconds to complete and the timeout for check_nrpe is set at 30 seconds. Instead, it returns a blank after about 1 second.
I get the number of mails in the queue, but when I add this to the config file Nagios always returns with 0.
Has anyone else had this problem.[/quote]
My issue is the same on this. And couple weeks ago I did everything but I couldn’t work out it. Just this day as it seemed to me I discovered the troubles’s determination, which should be appropriate here - recover edb files.