cancel
Showing results for 
Search instead for 
Did you mean: 
Level 7

File Change Monitor - MD5 Checksum

Jump to solution

SAM has a MD5 checksum option under file change monitor component but to my surprise only 1 file can be added at a time per component !

I have a bunch of files under a folder that requires MD5 checksum. I am not sure why there is no option to add multiple files. I opened a support ticket with SW and their response is to create a PowerShell script.
I can't believe that SW does not have an option to select multiple files within a file change component.

Is anyone in this group aware of this issue or if I could get help in writing such script?

regards



















0 Kudos
1 Solution

Accepted Solutions
Highlighted
Level 13

Re: File Change Monitor - MD5 Checksum

Jump to solution

I am doing MD5 hashing of some files single file and with a custom script I wrote in ....vbscript .  I'm also not doing it all in 1 component monitor.  If you're more of a vbscript guy (and I hope not ) I'm using the MD5 hashing algorithm from here: How to generate MD5 using VBScript in classic ASP? - Stack Overflow

BUT if it helps any:  I have run into this type of issue before for other scripts I have written that need to keep track of custom data between Orion script executions to do "diffs" of the data and I believe the only way you're going to get what you want (multiple files checked with 1 component) is to have an external config file that you create somewhere on your solarwinds poller where you keep the files names and the results of the hashing of the file the "last time the script ran" so you can read this as a config file and compare the files and hashes from the current execution to the last execution.  If you use powershell if might be possible to build the config file just using "import-csv" to read it in, use this to get the files to check and compare the hashes, and "export-csv" to write it back out with the new hash values.

Doing this gets weird if you have an HA environment (or multiple pollers) set up.  I have HA and I have a secondary script on task scheduler that, every hour, copies all my "custom config files" for all my custom scripted pollers to my secondary server so if the system fails over the scripts will have a "resaonably recent" copy of the confg data on the backup poller.

It would be *really* helpful if SolarWinds provided a "scratch variable" or two for custom scripts to write to that would remain persistent across polling intervals.  Even if it was a single string variable at least you just put a single JSON formatted string into it to store whatever you needed.

View solution in original post

2 Replies
Highlighted
Product Manager
Product Manager

Re: File Change Monitor - MD5 Checksum

Jump to solution

imran356  wrote:

SAM has a MD5 checksum option under file change monitor component but to my surprise only 1 file can be added at a time per component !

I have a bunch of files under a folder that requires MD5 checksum. I am not sure why there is no option to add multiple files. I opened a support ticket with SW and their response is to create a PowerShell script.
I can't believe that SW does not have an option to select multiple files within a file change component.

Is anyone in this group aware of this issue or if I could get help in writing such script?

regards



















Hi Imran, did you end up writing a powershell script for this workflow or did you create multiple monitors? also, do you know about how many files you're looking to monitor in a batch? If you wrote something up, please share, as I'm track an improvement request under SAM-10076

Highlighted
Level 13

Re: File Change Monitor - MD5 Checksum

Jump to solution

I am doing MD5 hashing of some files single file and with a custom script I wrote in ....vbscript .  I'm also not doing it all in 1 component monitor.  If you're more of a vbscript guy (and I hope not ) I'm using the MD5 hashing algorithm from here: How to generate MD5 using VBScript in classic ASP? - Stack Overflow

BUT if it helps any:  I have run into this type of issue before for other scripts I have written that need to keep track of custom data between Orion script executions to do "diffs" of the data and I believe the only way you're going to get what you want (multiple files checked with 1 component) is to have an external config file that you create somewhere on your solarwinds poller where you keep the files names and the results of the hashing of the file the "last time the script ran" so you can read this as a config file and compare the files and hashes from the current execution to the last execution.  If you use powershell if might be possible to build the config file just using "import-csv" to read it in, use this to get the files to check and compare the hashes, and "export-csv" to write it back out with the new hash values.

Doing this gets weird if you have an HA environment (or multiple pollers) set up.  I have HA and I have a secondary script on task scheduler that, every hour, copies all my "custom config files" for all my custom scripted pollers to my secondary server so if the system fails over the scripts will have a "resaonably recent" copy of the confg data on the backup poller.

It would be *really* helpful if SolarWinds provided a "scratch variable" or two for custom scripts to write to that would remain persistent across polling intervals.  Even if it was a single string variable at least you just put a single JSON formatted string into it to store whatever you needed.

View solution in original post