simple script to alert of archive logs filling


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting simple script to alert of archive logs filling
# 8  
Old 06-17-2008
Hammer & Screwdriver

Modify this:
Code:
#df -m >tmp_log_anal

so you write out to tmp_log_anal with that line of info.
I was not sure the param's you used when you gave me the results of your command; hence I commented it out but pasted your response manually into the tmp_log_anal file. (a little cheat-around!)
# 9  
Old 06-18-2008
Quote:
Originally Posted by Incremental
OK thanks for the reply.
Actually there is just this directory that I need to monitor - /archlogs.
Here is a copy of what I see when I do df -m:


/dev/lv02 8064.00 7810.80 4% 17 1% /archlogs


So the size is 8064M. So once it hits around 7257M I would like an email fired to me and my boss.
not that I am expert, but this should get you going:

Code:
#!/bin/ksh
a=`df -k | grep /archlogs | awk '{print $5}'`
if [ ${a} < 90% ]; then
     mailx -s "Yo bro,  you're logs are full man ${a} used" someone@noone.net
fi

you might need to modify the vaiable a though.

edit: I missed the above responses... they are probably better.

Last edited by trey85stang; 06-18-2008 at 02:08 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[bash] script is filling up my /var/log

I am trying to create a script that checks if my VPN connection is up and running... Everything seems to work as except but for some reason, the script fills up my /var/log/auth.log with the below information Dec 13 01:07:44 debian sudo: soichiro : TTY=pts/0 ; PWD=/home/soichiro/Desktop ;... (5 Replies)
Discussion started by: soichiro
5 Replies

2. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

3. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies

4. Shell Programming and Scripting

Script filling password from command line

I have this command that i am calling from php (exec()): openssl pkcs12 -export -in cert.pem -inkey key.pem -out cred.p12 and then i need to insert password twice Enter Export Password: Verifying - Enter Export Password: I need script that will fill the password... (3 Replies)
Discussion started by: rockyada
3 Replies

5. Solaris

archive logs mount point space check script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. -------------------------------------------------------------------------... (0 Replies)
Discussion started by: dreams5617
0 Replies

6. Shell Programming and Scripting

simple script to alert if internet not working?

Hi, I am constantly automaticaly downloading a few things on the internet but since my internet connection is unstable, it sometimes wont work. Thing is the internet will appear to be connected, but no website can be accessed and no program can successfully connect to any location. I can fix... (4 Replies)
Discussion started by: fuzzylogic25
4 Replies

7. Shell Programming and Scripting

Filling out Web Form from Script

I am trying to fill out a web form from within a script I am writing. I think that I should be using curl to do this, but I'm not really sure. The form has username and password fields and a submit button. I want to be able to log in from the command line. Html from the site: <h5... (2 Replies)
Discussion started by: vockleya
2 Replies

8. UNIX for Advanced & Expert Users

how to archive logs older than 5 days & then delete them?

My code is tar -cvf logs.tar `find /usr/openv/logs/512*.log -mtime +2` && find *.log* -mtime +2 -exec rm {} \; this gives me output as: tar: Missing filenames:confused: (1 Reply)
Discussion started by: timus1980
1 Replies
Login or Register to Ask a Question