Solved

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

Posted on 2016-09-18
5
26 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 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Keystroke loggers have been around for a very long time. While the threat is old, some of the remedies are new!
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…
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…

738 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