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
Solved

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

Posted on 2016-09-18
5
24 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
  • 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 63

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 63

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 63

Expert Comment

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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

829 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