I’m still facing the problem, any solutions?
Problem: Local checkmk has no permission for exchange transport queue. So the check has no result. How can I monitor the MS Exchange transport queue with checkmk?
This is the skript which give the needed result, when I start it with my user, but no result when checkmk run it.
#Aufbauen einer Verbindung zum Exchange
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$env:computername.berlin.rosaluxemburgstiftung.de/PowerShell/ -Authentication Kerberos
$Null=Import-PSSession $Session -DisableNameChecking -AllowClobber
Clear-Host
#Auslesen der Warteschlangen
$Queue = Get-Queue | Select Identity, DeliveryType, MessageCount
#Ergebnis fuer CheckMK lesbar machen
foreach ($Line in $Queue) {
$Type = $Line.DeliveryType
$Count = $Line.MessageCount
$Identity = $Line.Identity
write-host P "Message_Queue_$Type" "Mails=$Count;100;200" $Count Mails in der Warteschlange.
}
#Verbindung zum Exchange schließen
Remove-PSSession $Session
Best regards,
Dom