![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hey Perl Gurus | neil1983 | Shell Programming and Scripting | 1 | 12-06-2007 10:03 AM |
| SED GURUS - Help! | Simerian | Shell Programming and Scripting | 2 | 11-03-2006 10:28 AM |
| Date format - Shell scripting gurus please help | geomonap | Shell Programming and Scripting | 3 | 02-02-2006 05:15 AM |
| Help with shell script - Unix Gurus calling | ravred | Shell Programming and Scripting | 4 | 01-26-2006 04:20 AM |
| Any RF unix gurus out there? | Subrosa | UNIX for Advanced & Expert Users | 5 | 10-16-2003 04:08 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
A q for the gurus. Filehandling & reacting to events (?)
Ok, since i am scripting first-timer i want to apology in advance if any of my ideas are way off.
What i am trying to achieve is a script that can listen for alerts from snort. When snort triggers an alert then i want my script to do nothing for X seconds, and after that period of time i want the script to copy a bunch of files (tcpdump-files and possibly the snort-log) to a newly created folder. So in some sort of meta-code i am trying to achieve something like this: If/When snort triggers an alert { Wait 5 minutes Create a new folder /A/B/N (here i would need to name the folder in YYMMDD-HHMM format i believe) Copy all files at /S/D/ to /A/B/N Copy file F to /A/B/N } So the next time snort triggers an alert this script would create yet another folder and copy the files i want to that folder. So, does anyone of you know if this is possible using shellscript? If it is, can anyone perhaps show an example or help me in any way ? Thanks in advance ! /F |
|
||||
|
Wow!
I managed to get the file and folder handling working. And when i came back to this computer i saw that your code snippet did the same thing in about one third of the number of lines that I had so needles to say im going to use your version.Thank you very much for your help. (The feeling when these things finally work as intended is ...sweet). There's only one tiny problem left. Does anyone know how i actually manage to get it to kick off when snort alerts? After a few tests I dont seem to get that part working. i.e I dont really understand the part: "alert_triggered -eq 1". Would it require me to set up some variable(alert_triggered) that is hooked on to snort and listens for alerts? (Or is this alerter functionality already built-in and waiting for me somewhere in linux) Any ideas on how this can be done? (Or did i miss something in the example?) If i need to somehow hook a listener to snort...well im kind of lost so examples will be immensely appreciated ./F |
|
|||||
|
Quote:
Cheers |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|