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!
Article Comments
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.
Jun, 2016 - Permalink
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?
Jun, 2016 - Permalink
There is no permission issue. I checked it. All I am trying to do is check the log file updates for every minutes.
Jun, 2016 - Permalink
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.
Jun, 2016 - Permalink
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:
...or you hardcode it into the script :)
Jun, 2016 - Permalink