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

Custom Sensor fails when running a vb script checking file size on remote server

Votes:

0

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.

custom-exe custom-script-exe custom-sensor prtg

Created on Feb 8, 2012 12:22:33 AM

Last change on Mar 19, 2015 3:50:45 PM by  Martina Wittmann [Paessler Support]



4 Replies

Votes:

0

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

Created on Feb 8, 2012 9:54:26 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

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,

Created on Feb 8, 2012 1:29:08 PM



Votes:

0

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.

Created on Feb 8, 2012 3:13:22 PM



Votes:

0

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,

Created on Feb 8, 2012 3:23:43 PM




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.