Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Email alert when client in blacklist joins network Post 302975522 by Don Cragun on Tuesday 14th of June 2016 06:14:36 PM
Old 06-14-2016
I apologize for not getting back to you sooner. When I saw some of your responses below, I guess I just lost interest.
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
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-)
So, have you done anything to fix this in the last six weeks?
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
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
OK. Have you made any changes to your script to only check this file once per hour?
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
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?
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)
That didn't answer either question.

Is /var/media/ftp/look.sh dependent on anything on the flashdrive? I.e., can we copy it off of the flash drive into /tmp and run it from there (which would change the number of accesses to the flashdrive from once every four seconds to just once)? And, why is it on your flashdrive at all? Why isn't it in your $HOME/bin directory instead?
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
Why are any of these files on a flashdrive if you don't want to access the flashdrive?
it is how it is...
This is what made me lose interest in this thread. If it is how it is and you aren't interested in changing it, why should we bother making suggestions?
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
What output does /var/media/ftp/look.sh produce?
lines in the output like in the alertlist.txt
OK. Thanks. That helps.
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
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...
No, that is not what I meant. Can look.sh return two or more lines containing a name like hans? (Presumably, this would indicate that two or more wifi stations have detected that hans is within range.) If a given name can be reported more than once, does your script need to report that a user appears or disappears, or does it need to report that the number of times a user appears has changed?
Quote:
Originally Posted by lowmaster
Quote:
Originally Posted by Don Cragun
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?
ideally yes
OK. I assume this is because whoever is editing alertlist.txt is careless with the shift key when adding names to the list.
Quote:
Originally Posted by lowmaster
I saw there is a watch command available
This should display all output differences? can maybe this be used for this?

can this be used to just consider the data in the lists?

watch - Repeat Linux / Unix Command Regular Intervals
It sounds like this might work perfectly for you... if you do NOT want to reduce the number of times your flashdrive is accessed.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email alert script

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)
Discussion started by: moon
1 Replies

2. Programming

HELP broadcasting client IDs to network in C

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)
Discussion started by: dooker
1 Replies

3. IP Networking

Squid and email client

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)
Discussion started by: bache_gowda
7 Replies

4. Shell Programming and Scripting

email Alert

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)
Discussion started by: fed.linuxgossip
4 Replies

5. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

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)
Discussion started by: V4705
0 Replies

6. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

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)
Discussion started by: jay02
8 Replies

7. UNIX for Beginners Questions & Answers

Email Alert in UNIX

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)
Discussion started by: simpsa27
8 Replies

8. Shell Programming and Scripting

Email alert after termination

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)
Discussion started by: Jade_Michael
13 Replies
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy