Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-09-18
5
Medium Priority
?
37 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:Mike
  • 3
5 Comments
 
LVL 17

Assisted Solution

by:lruiz52
lruiz52 earned 400 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 65

Assisted Solution

by:btan
btan earned 1600 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:Mike
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 65

Accepted Solution

by:
btan earned 1600 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 65

Expert Comment

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

Featured Post

Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

Question has a verified solution.

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

How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
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…
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…

783 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