Search code examples
powershellpowershell-2.0msdtc

Get DTC Active Transactions (Powershell)


I'm writing some Powershell scripts so we can monitor our SQLServer instances through Nagios, I need to get the DTC Active Transaction count in PS so I can output it to Nagios. Is this possible? If so how do I do it?

I'm very much a Windows/Powershell n00b so sorry if this is a basic question. Most of the params I need seem to be avaliable with 'Get-Counter' but this one doesn't seem to be


Solution

  • You could query the performance counters directly from Nagios using check_nrpe instead:

    $USER1$/check_nrpe -H 192.168.1.123 -p 5666 -c CheckCounter -a "Counter:DTCTx=\Distributed Transaction Coordinator\Active Transactions" ShowAll  MaxWarn=100 MaxCrit=150
    

    This assumes that $USER1$ points to your Nagios libexec folder.

    You'd need to set MaxWarn and MaxCrit to thresholds that meet your own alerting requirements.