What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Exchange Whitespace

Votes:

0

Please add "Whitespace" channel to "Exchange Database sensor"!

exchange prtg whitespace

Created on Jul 21, 2014 4:11:15 PM



11 Replies

Votes:

0

we decided not to add that channel to our existing exchange sensors, because even Microsoft says to get reliable data on the whitespace of a database you need to dismount the database and use ESEUTIL

http://blogs.technet.com/b/exchange/archive/2011/12/14/database-maintenance-in-exchange-2010.aspx -> 'How can I check whitepace in a database?

Created on Jul 24, 2014 11:29:17 AM by  Aurelio Lombardi [Paessler Support]



Votes:

0

Ok, please add "AvailableNewMailboxSpace" channel, it's enough.

Created on Jul 24, 2014 12:00:44 PM



Votes:

0

Hello,

we will see what we can do!

Created on Jul 28, 2014 9:27:30 AM by  Aurelio Lombardi [Paessler Support]



Votes:

0

Hi,

as this is the first request for adding this channel we want to make a script available for you to see if this value is usefull and to give other customers the chance to comment on it.

As you can see, the request itself and parsing the value is only a 3 liner + output, the rest of the script may be cut off but it may be helpful in case of an error.

Simply pack the following script in a .ps1-file that must be stored in the 'Custom Sensors\EXEXML'-folder of your PRTG-Installation. After that you can add it as a 'EXE/Script Advanced'-sensor.

Param(
        [string]$server, 
        [string]$user,
        [string]$password, 
        [string]$item="Mailboxdatabase"
    )

# To get this script running with PRTGNetworkMonitor you need to enable RemoteSigned-scripting for 32bit-processes. 
# This can be done with running 'c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe "Set-ExecutionPolicy RemoteSigned"' on a system with default paths


# Examples of Parameters-string in sensorsettings

# Environment ->'Set placeholders as environmentValues':
#   -item MailboxDataBase
# Environment ->'Default Environment':
#   -server %host -user %windowsdomain\%windowsuser -password %windowspassword -item MailboxDatabase
#   -server <ip-address or fqdn of the host> -user <domainname>\<username> -password <password> -item MailboxDatabase


# declare script-wide variables
$warningpreference = "silentlyContinue"
$script:resultText = "OK"

        
function main {
    $statis =  Get-MailboxDatabase -status $item; 

    $statis.AvailableNewMailboxSpace -match "[\(]{1}(.*?)\bbytes[\)]{1}"
    $value = [long]$matches[1]; 
    
    $result = @"
  <result>
    <value>$value</value>
    <unit>BytesMemory</unit>
    <channel>Available New Mailbox Space</channel>
  </result>
  <text>
    $($json.status)
  </text>
"@
    
write-host @"
<?xml version=1.0 encoding=UTF-8 ?>
<prtg>
$result
</prtg>
"@

}
  
function checkCredentials {
    $paramerrors = @() 
    if ($server -eq $null) {
        if (-not ($Env:prtg_host -eq $null)) {
            $script:server = $Env:prtg_host
        } else {
            $paramerrors += "No Serverinformation applied" 
        }
    }
    if ($user -eq $null) {
        if ($Env:prtg_windowsuser -ne $null) {
            $user = $Env:prtg_windowsuser
        }  else { 
            $paramerrors += "No Userinformation applied" 
        }
    }
    if ($user -eq $null) {
        if (($Env:prtg_windowsdomain -ne $null) -and ($Env:prtg_windowsuser -ne $null)) {
            $user = "$($Env:windowsdomain)\$($Env:prtg_windowsuser)" 
        } else { 
            $paramerrors += "No Domaininformation applied" 
        }
    }
    if ($password -eq $null) {
        if ($Env:prtg_windowspassword -ne $null) {
            $password = $Env:prtg_windowspassword
        }  else { 
            $paramerrors += "No Password applied" 
        }
    }

    if ($paramerrors.count -gt 0) { printErrorXml "$([string]::join(", ", $paramerrors))" }

    $secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
    
    $myCred    = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
    
    $script:session = connect $myCred
} 

function connect ($mycred){
    # use the currently loggedon user for the connection 
    #$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$server/PowerShell/ -Authentication Kerberos
    # or use the credentials from params
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$server/PowerShell/ -Authentication Kerberos -Credential $myCred
    # using out-null to supress the instantiating-message within the output...
    Import-PSSession $Session -WarningAction silentlyContinue | out-null
    $session
}

function disconnect($session) {
    # leave the session and free the connection, the default connectionlimit is 18 to a specific Computer!
    Exit-pssession
    if ($session -ne $null) {
        Remove-PSSession -session $session 
    }
}


# print a xml-errormessage
function printErrorXml($errortext = $script:resultText) {
    write-host @"
<?xml version=1.0 encoding=UTF-8 ?>
<prtg>
    <error>1</error>
  <text>$errortext</text>
</prtg>
"@
    
    disconnect($session)
    exit
}

checkCredentials

main

disconnect($session)

exit

Created on Jul 28, 2014 2:19:29 PM by  Dieter Loskarn [Paessler Support]



Votes:

0

I get error: "Error reading response: Invalid XML (Structural error in xml file, 1 open items.)"

Created on Jul 28, 2014 3:52:29 PM



Votes:

0

When you are running the script from the commandline, which output do you get?

Created on Jul 28, 2014 5:37:21 PM by  Dieter Loskarn [Paessler Support]



Votes:

0

Hi, this sensor would be very usefull to us. Does a channel like this already exist in your product at this date?

Import-PSSession : No command proxies have been created, because all of the requested remote commands would shadow exis
ting local commands.  Use the AllowClobber parameter if you want to shadow existing local commands.
At C:\users\ronnyvdb.ecudxb\Desktop\whitespace.ps1:98 char:21
+     Import-PSSession <<<<  $Session -WarningAction silentlyContinue | out-null
    + CategoryInfo          : InvalidResult: (:) [Import-PSSession], ArgumentException
    + FullyQualifiedErrorId : ErrorNoCommandsImportedBecauseOfSkipping,Microsoft.PowerShell.Commands.ImportPSSessionCo
   mmand
The operation couldn't be performed because object 'MailboxDatabase' couldn't be found on 'SRVDOMAIN.ECUDXB.ECULINE.NET
'.
    + CategoryInfo          : NotSpecified: (:) [Get-MailboxDatabase], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : 780B9795,Microsoft.Exchange.Management.SystemConfigurationTasks.GetMailboxDatabase

False
Cannot index into a null array.
At C:\users\ronnyvdb.ecudxb\Desktop\whitespace.ps1:30 char:29
+     $value = [long]$matches[ <<<< 1];
    + CategoryInfo          : InvalidOperation: (1:Int32) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

<?xml version=1.0 encoding=UTF-8 ?>
<prtg>
  <result>
    <value></value>
    <unit>BytesMemory</unit>
    <channel>Available New Mailbox Space</channel>
  </result>
  <text>

  </text>
</prtg>

Created on Mar 16, 2015 7:42:37 AM

Last change on Mar 16, 2015 7:52:23 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Due to the very few requests, there are no changes to this. We will leave this open though, in case further requests come in.

Created on Mar 18, 2015 8:16:14 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Hello.

Thanks for the custom sensor, atm we are using it alot, but I wonder does anyone have an idea of how to get the same information from the Exchange 2007, its a bit tiring to be looking through event log every few days.

Created on May 21, 2015 6:30:42 AM



Votes:

0

Please add the whitespace channel. This will allow my customer to monitor the effect of mailbox cleanup actions of it's users.

Created on Dec 13, 2016 9:25:56 AM



Votes:

0

Hello,

This feature is still on our wish list, but I am afraid that there are no plans to implement it in the near future, sorry.

Best regards

Created on Dec 14, 2016 11:41:56 AM by  Isidora Jeremic [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.