Email alert when client in blacklist joins network
I have a textfile with a list of strings I want to monitor in my network.
alertlist:
So it can output for me whenever the a strings it matched:
Now what I want is eh a notification, whenever the state changes, example, hans joins, franz leaves franz and tanz joins etc.
not when found or nor, only when the situation changes
how can I do this while keepin the I/O to the flashdrives to a minimum?
Last edited by lowmaster; 04-22-2016 at 09:29 AM..
Reason: making the question more simple
Hmm. Quick question - if a process or user is blacklisted correctly - iptables in linux can do this for you - then it never, ever get your system to start with. Why do you allow them to get going on your system to start with??
The tool to block access by IP is OS dependent. I gave a linux example.
I have optimized the question. I hope it is clearer now...
I just want to do soemthing in this loop, if one the strings in the textfile apear in the shell output the first time, or when they disappear, or re appear..
I have a textfile with a list of strings I want to monitor in my network.
alertlist:
So it can output for me whenever the a strings it matched:
Now what I want is eh a notification, whenever the state changes, example, hans joins, franz leaves franz and tanz joins etc.
not when found or nor, only when the situation changes
how can I do this while keepin the I/O to the flashdrives to a minimum?
If you want to keep I/O to a flashdrive to a minimum, why are you accessing that flashdrive at least four times every 4 seconds?
If you have a list of strings to search for, why do you have to test every four seconds whether or not your list exists? Does this list change frequently while you're running your script?
If you have a program you want to run every 4 seconds and you want to minimize accesses to a flashdrive, why is the program you want to run on a flashdrive?
What does /var/media/ftp/look.sh do? Does it invoke any other software that is located on that flashdrive? Does it access any other files that are located on that flashdrive?
Why are any of these files on a flashdrive if you don't want to access the flashdrive?
What output does /var/media/ftp/look.sh produce? Is the output just strings exactly matching the format of the strings in /var/media/ftp/alertlist.txt, or do lines in the output contain additional text that needs to be stripped away as part of your output?
Can a string in /var/media/ftp/alertlist.txt appear in the output from /var/media/ftp/look.sh more than once? If so, does the output from your script need to notice differences in the number of times a string is found? Or, does it just need to notice when the number of times a given string string appears changes from zero to non-zero and from non-zero to zero?
Does you output just need to give a list of the strings that changed status? Or does the output need to report strings that appeared and strings that disappeared, or the number of times a string appeared in the latest time through the loop?
If these strings are people's names or login IDs, do you really need case insensitive matches? Are UserName and username to be treated as different strings or as a single string?
If you want to keep I/O to a flashdrive to a minimum, why are you accessing that flashdrive at least four times every 4 seconds?
Thats a good point! I need to fix this. 8-)
Quote:
If you have a list of strings to search for, why do you have to test every four seconds whether or not your list exists?
The list changes, but reading it once every hour should be sufficient
If you have a program you want to run every 4 seconds and you want to minimize accesses to a flashdrive, why is the program you want to run on a flashdrive?
Quote:
What does /var/media/ftp/look.sh do? Does it invoke any other software that is located on that flashdrive? Does it access any other files that are located on that flashdrive?
Look.sh calls a system internal function which goes through a set of arrays with which you can output several information. in this case I just let output clients in the network and its state (active/online)
Quote:
Why are any of these files on a flashdrive if you don't want to access the flashdrive?
it is how it is...
Quote:
What output does /var/media/ftp/look.sh produce?
lines in the output like in the alertlist.txt
Quote:
Can a string in /var/media/ftp/alertlist.txt appear in the output from /var/media/ftp/look.sh more than once?
If you mean as a part of a string yes. so if alertlist.txt contains hans, look.sh could output this what I would like to have considered
hans
hansolo
Hansala
Hans joined
Hansala left
Hans left
hansolo joined
etc...
Quote:
If these strings are people's names or login IDs, do you really need case insensitive matches? Are UserName and username to be treated as different strings or as a single string?
I am running the gaussian program on UNIX with bash and I want to form a script that will email me once the output life terminates either "normal termination" or "false" I just started learning this last week so could you let me know how to go about this.:b: (13 Replies)
Hi There
I have to wrote a script where I am able to echo a result of an SQL script, however I want to be able to send an email to myself when it is more than 0 (so whenever a value is returned) is this possible?
I tried one way from looking on the web but this didn't work, I have added my... (8 Replies)
This is my first time writing a script and Im having some trouble,
Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage
I tried grep
Obviosly that hasnt worked,
Any... (8 Replies)
hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version).
i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010).
a. i cant see a list of the contacts,... (0 Replies)
Hello,
I want a script that will scan the file /etc/httpd/conf/httpd.conf and the folder /etc/httpd/libexec/
-bash-2.05b# grep mod_r /etc/httpd/conf/httpd.conf
LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c
-bash-2.05b#
-bash-2.05b# find... (4 Replies)
Hi All,
We plan to use squid has a proxy so my question is if I use squid then is this support email clients like outlook express or microsoft outlook at client side and is any option in the squid to block few of the unwanted URL's
Thanks,
Bachegowda (7 Replies)
I am trying to write a client server chat program in C and am unsure as to how I would broadcast all the users IDs over the network. At the moment I have the usernames stored in a array clientsock.cl_id, I am able to output this information to the server but am unsure how to transmit this... (1 Reply)
I need to code a script, which will run via cron, every 30 minutes.
The script will read a file containing a date&time and number (which represents disk space). The file gets appended to every 30 minutes. Here's a sample of the file:
CPU 1:04/25/02 1:00 am:1972554
CPU 1:04/25/02 1:30... (1 Reply)