New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How to give shared network file path in the custom vb script?

Votes:

0

Your Vote:

Up

Down

I have a vb script to check the log file update for every minute and it works perfectly in my local machine. Now I am using this script to monitor the log file in one of my server. I have created a device with the server name(XXX) and added a sensor Custom EXE/Script on the server name XXXXXXXXX

In the script i have file path as: set File= "
roenma003a\mis$\Program Files\GIA NM General\General Image Archiver\2015.11.29_ERROR.log" (Which runs perfectly in my local machine) Then while running the script in PRTG server I have modified the file path as below: set File= "mis$\Program Files\GIA NM General\General Image Archiver\2015.11.29_ERROR.log" (This one is on the server XXX)

This Fails and I am getting Timeout (code:PE018) error. I am thinking PRTG is not able to find the file location because of the file path the way i have defined.

Is this the correct way of defining the file path in the script while running the script on the prtg server?

Your help is much appreciated.

Thanks!

log script shared-network-path

Created on Jun 10, 2016 3:45:41 PM by  mayo (0) 1



5 Replies

Votes:

0

Your Vote:

Up

Down

Since the script is always executed on the PRTG side (either the core server or the remote probe), you'll have to pass the device name as parameter in the sensor configuration and insert it into the path:

set File= "\\<server>\mis$\Program Files\GIA NM General\General Image Archiver\2015.11.29_ERROR.log"

...or you hardcode it into the script :)

Created on Jun 13, 2016 6:40:05 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Thank you for your quick reply but it still doesn't work. I have hard coded the File path in the script. Please see below .

@echo off
setlocal
set File= "\\roenma003a\mis$\Program Files\GIA NM General\General Image Archiver\2015.11.29_ERROR.log"
set Interval=10
for %%a in ("%File%") do set FileName=%%~nxa
set OldFileTime=X
:Loop
for %%a in ("%File%") do set NewFileTime=%%~ta

ping.exe -n %Interval% localhost >NUL
if not "%OldFileTime%"=="%NewFileTime%" (
	set OldFileTime=%NewFileTime%
	goto :Loop
)

echo fail
goto Loop

I am running this script in PRTG and I am always getting the Time Out Code Error.

When I run locally this is working perfectly but PRTG I get time out. Looks like file path is not finding.

Created on Jun 13, 2016 1:11:37 PM by  mayo (0) 1

Last change on Jun 14, 2016 6:02:37 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Could it be a permission problem? Can you try to let the PRTG Probe Service run under your user account to check that (open up services.msc, right click the PRTG Probe Service, open properties and configure it in the account tab)? Or do you need any other credentials in order to access the share?

What are you actually trying to monitor? Maybe there's a simpler solution?

Created on Jun 14, 2016 6:03:58 AM by  Stephan Linke [Paessler Support]

Last change on Jun 14, 2016 6:05:18 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

There is no permission issue. I checked it. All I am trying to do is check the log file updates for every minutes.

Created on Jun 14, 2016 1:23:17 PM by  mayo (0) 1



Votes:

0

Your Vote:

Up

Down

What exactly are you checking in the script? Maybe I can come up with a PowerShell counterpart; it's usually more versatile when it comes to network file operations.

Created on Jun 14, 2016 1:35:00 PM by  Stephan Linke [Paessler Support]



Please log in or register to enter your reply.


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.