Browse Folders

Do you have some slick tips and tricks to share with the rest of the Thwack community? If so, you’re in the right place. The Content Sharing Zone is designed for you to share and explore resources that can make managing your systems and network easier than ever. Here you’ll find all kinds of cool tools, like custom Orion reports and alerts you can leverage in your environment, custom scripts for Cirrus and ipMonitor, and even some useful device configurations. Go ahead and start sharing and exploring today!

Detect if a file has been modified (SolarWinds)

Downloads: 112 File Size: 8.7kB
Posted By: denny.lecompte Views: 588
Date Added: 09-02-2008
FileModified

The FileModified script allows you to watch a file to make sure it has not changed since the last time it was monitored. The script compares both the size of the file and the last-modified date to a state file that is generated as a baseline. The file size in bytes is returned as a statistic, allowing you to set thresholds and alerts on the file size.

 

This script requires temporary storage space to store the state file. To reset the status of the component after a file modification has been detected, you must manually delete the .state file. Deleting the .state file allows the script to generate a new baseline for future file comparisons. 

 

Arguments 

filePath stateFilePath

 

filePath

The local path or Universal Naming Convention (UNC) path to the file.

 

stateFilePath

The local path or UNC path to a folder for storing the state file. The state file has a .state file extension.

 

Example

These arguments monitor the file C:\temp\test.txt on the localhost, and uses the C:\temp folder of the localhost for storing the state file. The paths are in UNC syntax.

 

\\localhost\c$\temp\test.txt \\localhost\c$\temp\

Comments

 

seudo2k said:

I am having an issue with the script checking a file on a server that is on a remote subnet. It works great on servers in the same subnet.
09-03-2008 7:18 PM
 

ostapv said:

I am created 2 files test.txt in directory \\localhost\D$\sqllog\test.txt \\localhost\D$\sqllog\ but have error Component Status Details: Windows script execution error. C:\Documents and Settings\All Users\Application Data\SolarWinds\Orion\temp\6948c057-96a1-403e-a9ba-e1eff8b33e20(22, 60) Microsoft VBScript compilation error: Expected end of statement Component Type: Windows Script Monitor Message: C:\Documents and Settings\All Users\Application Data\SolarWinds\Orion\temp\6948c057-96a1-403e-a9ba-e1eff8b33e20(22, 60) Microsoft VBScript compilation error: Expected end of statement
12-03-2008 5:15 AM