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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...