If I want to mail the alert condition to a email address what would my code look like....I mean can you replace the Take Some action with some code that would send an alert to an email address with a particular subject. And with current_file=/tmp/current and previous_file=/tmp/previous am I supposed to given a directory path that I want to monitor? I want to do it for all the directory under /home and I am performing this testing with root user.
For the e-mail, it depends what you want to send and who to.
The files mentioned are just files for this script to run and do it's work. The key bit is being in the directory/filesystem you want to be monitoring, in this case it's /home as in listed in the du command.
If the email is to the directory owner, then it depends if you have an e-mail address (or could build one) for each user. Perhaps you have it as the user comment so you could extract it from /etc/passwd (usually field 5 I think) Once you have determined the e-mail address, your command could be something like:-
If your email is not based on the same server, then you will need to configure the /etc/sendmail.cf file, however this probably just means setting a DS record (which is commented out by default) to name your e-mail server or some relay that will accept smtp and route it on for you. Find the line that is for the DS statement and uncomment it, adding in your mail server, e.g.:-
Make sure that the address can be resolved (DNS prefereably) and that you can open port 25. If you try:-
... then you should get a HELO reply rather than a timeout.
This is help a lot lot more...my email is not based on the same server so I will need to make change in the sendmail.cf. I will check this an let you know.
Please give me brief how the original script given by Robin would cause any implode?
Thanks
You would probably learn more if you tried it for yourself. Run the script. Then delete and/or add a directory. Run the script again. Perform the test with pathnames that occur in early in the sort order for maximum effect.
Quote:
Originally Posted by rbatte1
Since those are kilobytes, that's actually closer to 3 gigabytes.
Hi ,
I am trying to get the folder details having size more than sme specified value and also the name of the folder should be like TEST.
so
1. In the current directory search for all the folders having name like TEST
2. Print the list of the folder names having size more than 100... (3 Replies)
How is the level of access on a particular folder determined? I have heard (its just hearsay so am not particularly sure of it) that the access a particular user/group has to a low level directory is also affected by the level of access granted to the user/group on its parent directories. e.g.
... (1 Reply)
Hi All,
Can anyone refer to me a readymade script for the purpose of log folder size monitoring script.
Example : I have a log folder of size 10 G, and as the logs keep accumulating the folder gets full and i have to manually zip/remove the files in order to keep the server running. Something... (1 Reply)
Whenever i start my server it takes app 2 minutes to get into network (After starting the network service on boot).
I inquire the network guys for possible causes but they say it will need both side monitoring .
One is switch side and the second is server side.
I m not sure how do i check... (6 Replies)
Hello,
Well I have a web with a very bad structure (a vBulletin forum) and I want it redirected to a newer folder in the same server but with a upper level folder.
Current structure is:
https://www.unix.com/vbulletin/upload/index.php
And I want it to be:... (0 Replies)
Hi:
I have:
folderA
|----folderB
|----folder1
|----folder2
|----folder3
|----folder3.1
Question:
How can I find *.txt ONLY from /folderA/folderB/ and not the others folder1,2,3??
I tried:
find... (8 Replies)
I have installed ubuntu. And I have create users ans groups.
Suppose if the user enter into through Putty SSH. He should have access only to home folder and cannot move to other than $HOME. User should not able to root files and /$ files.
Kindly provide solution.
Regards
Vasanth kumar (3 Replies)
hi,
need help in writing a script in perl.
requirement :
1. Search for the files in a particular folder
2. search for a string in the file names
3. Delete the file which matches the string.
Ex: if the folder is C:\TEST
and the folder has 5 files like
2009ABCG.txt
2009MNO.txt... (2 Replies)
Hi,
I would like to find the size of a folder. When I run the command
du -k
It is going through all the sub-folder and files and taking really much time.
Is there any command to get the complete directory size without showing the sub-folder and file size.
Appreciate your response.
... (3 Replies)