All Apps and Add-ons

Splunk for Microsoft Exchange App get-databasestats.ps1 Error

imarks004
Path Finder

Has anyone seen the below error with the fwd_exchange2007_store \bin\get-databasestats.ps1 powershell script? I see this on all for mailbox servers(2active/2passive). I am troubleshooting why some events are not populating back into my indexers and this looked like a good place to start. It seems like most of my Exchange data is populating correctly with just a few exceptions that I am trying to clean up.


09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" The operation '[System.UInt64] / [System.UInt64]' is not defined.
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" At C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bi
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" n\powershell\get-databasestats.ps1:32 char:45
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" + $EdbDriveFree = ($EdbDriveInfo.FreeSpace / <<<< $EdbDriveInfo.Size)
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" * 100.00

1 Solution

donwant
Explorer

There is a bug with Powershell v1 apparently. If you edit the databasestats and cast one or both of the variables to a long it will work.
To cast it to a long just put [long] in front of the variable.

I can't find the reference I used to fix this yesterday now so I can't give proper credit unfortunately.
Correction: finally found the reference!
http://www.techtalkz.com/microsoft-windows-powershell/466362-completely-easy-question-division.html

View solution in original post

0 Karma

donwant
Explorer

There is a bug with Powershell v1 apparently. If you edit the databasestats and cast one or both of the variables to a long it will work.
To cast it to a long just put [long] in front of the variable.

I can't find the reference I used to fix this yesterday now so I can't give proper credit unfortunately.
Correction: finally found the reference!
http://www.techtalkz.com/microsoft-windows-powershell/466362-completely-easy-question-division.html

0 Karma

imarks004
Path Finder

Thanks, adding the [long] in front of the variables fixed this issue.

0 Karma

ahall_splunk
Splunk Employee
Splunk Employee

Can you possibly contact me at msexchange@splunk.com so I can incorporate this into the next release?

0 Karma

ahall_splunk
Splunk Employee
Splunk Employee

The key part here is that the [System.UInt64] / [ System.UInt64] is not defined. This is a core feature of Powershell, so it's likely that there is a problem with your Powershell implementation. To diagnose further, you can run this outside of the Splunk system to see what the error is. To do this, run the get-databasestats.ps1 at a powershell command prompt. It should run to completion without errors.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...