Solved

SolarWinds - How to verify file has been created on daily bases..

Posted on 2016-09-18
5
28 Views
Last Modified: 2016-10-08
Greeting Experts,

I am in need of some help... I use a script to create a log file every 24 hrs from Network Security device on our network. The script work w/o any problem but I need to verify the file has been created base on our security policy.  My organization uses Solar Winds Log&Event Manger as part of data management  program... I would like to use to monitor the script by verifying  the zip file has been created.. I.e.  by getting an email tell me the size of the file.. something to the effect of file size less than 0 kb....  can someone direct me in the right direction.
0
Comment
Question by:amstoots
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 17

Assisted Solution

by:lruiz52
lruiz52 earned 100 total points (awarded by participants)
ID: 41804115
You can accomplish what you need with powershell, I had to do some think similar and used the template found in the link below to help with my script.

http://salvoz.com/blog/2012/03/28/powershell-check-for-existence-of-file-and-send-email-if-file-does-not-exist/
0
 
LVL 64

Assisted Solution

by:btan
btan earned 400 total points (awarded by participants)
ID: 41804312
You may want to check the log parser (though it stated for SAM)

The Log Parser template -allows you to check a specified log file and determine the total number of lines that match your search criteria
https://thwack.solarwinds.com/docs/DOC-146181

Find a string in a logfile and count matches (Powershell) - A powershell application will find any matching text in the specified file and report back how many matches it found
https://thwack.solarwinds.com/docs/DOC-189371

Find a string in a logfile using a counter file - This script uses a counter to determine if there are more matches on the current poll than there were on the last poll. If there's more errors on the current poll it will return a DOWN status.
https://thwack.solarwinds.com/docs/DOC-189457

The script will probably will need to work on further on tuning to you need, thereafter just need to create an alert that will look for the status of the component and send an email if the alert is triggered.

Hope this helps
0
 

Author Comment

by:amstoots
ID: 41805750
The name of the file changes everyday with the following  "%Day%Month%Year%ngx.zip (i.e. 19092016ngz.zip)... Is there a way to change over the powershell script to incorporate this
0
 
LVL 64

Accepted Solution

by:
btan earned 400 total points (awarded by participants)
ID: 41805753
The last link in earlier has search string of regex

$filepath = "D:\temp\Sample_Log.log" #this is the file to be searched for matches
$countfile = "D:\Temp\countfile.txt" #this is the temp file that will store your count so you can compare the new count to it
$regex = "INFO: Job started:" #this is the string you're looking for

# Pull in the old count number from $countfile
$old_count = Get-Content $countfile

# Search the flipped file for the string listed in the $regex variable
$find_matches = Get-Content $filepath | Select-String -pattern $regex

Open in new window

you will probably have to adjust the file path referring to regex type or enumerate base on current date..
0
 
LVL 64

Expert Comment

by:btan
ID: 41834900
As suggested in use of Powershell scripts.
0

Featured Post

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question