I have a vb scipt that checks our Exchange server Mailbox Database file size. When it is run on the PRTG server from a command line it works, but when run from within PRTG as a custom sensor it fails.
If I modify the script to check a file on the local PRTG server is works fine within PRTG
Here's the script:
strFile = "
HWW032\D$\Program Files (x86)\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb"
set objFSO = createobject("Scripting.FileSystemObject") set objFile = objFSO.GetFile(strFile)
wscript.echo clng(objFile.Size / 1024000) & ":OK"
WScript.Quit("0")
Your help would be greatly appreciated.
Article Comments
Hi Chris,
Returning a float from a Custom Script/EXE Sensor (.bat file) like this
echo 1.25:OK
works just fine. Please make sure to:
- use a point as decimal seperator
- set the sensors value type to "Float" during sensor creation.
Regards,
Feb, 2012 - Permalink
The script is returning an integer. Again if I have the script check the file size of a file that is local to the PRTG server it works fine, but not when checking the fila size of a file across the network. I experience the same issue when attempting this via a batch file.
Feb, 2012 - Permalink
Hi Chris,
I just now noticed that in your script you are using an administrative share (D$) that is only accessible to administrators and not to the PRTG server/probe, that by default runs on the local system account.
For testing purposes you could try running the PRTG core service with administrator credentials.
Regards,
Feb, 2012 - Permalink
Hi,
is the return value to PRTG a Integer? If not please make sure it is as the Script / EXE Sensor only can handle Integers. If you are in need of a Float value as return value please have a look at the Script / EXE Advanced Sensor.
Best regards
Feb, 2012 - Permalink