nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Require Shell Script Which sends all server info on mail

This is a discussion on Require Shell Script Which sends all server info on mail within the Linux software forums, part of the Linux Getting Started category; Dear All. I require a shell script for Linux, which sends me a all logs file ,space available on server ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-10-2006, 01:13 AM
Member
User
 
Join Date: Mar 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
puppen
Default Require Shell Script Which sends all server info on mail

Dear All.

I require a shell script for Linux, which sends me a all logs file ,space available on server and when server is rebooted in particular time interval. So all the information I want on my mail.

This problem is that my Linux server does not have public ip so it should forward mail to particular MTA.

Basically I want all the server information on my mail in every 1 hour time.
Is there any way I can do it, Pls help me.
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #2 (permalink)  
Old 25-10-2006, 08:37 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

There is a program called nbsmtp. It allows to specify which MTA you would like to use.
Download and compile program http://nbsmtp.ferdyx.org/

Code:
cat /tmp/mail.txt | ./nbsmtp -f you@yourdot.com -h remote.relay.email.server.com -p 25 -u smtp-user -p smtp-passwd -M 1
or
Code:
./nbsmtp -f you@yourdot.com -h remote.relay.email.server.com -p 25 -u smtp-user -p smtp-passwd -M 1 < /tmp/mail.txt
Reply With Quote
  #3 (permalink)  
Old 25-10-2006, 07:17 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
puppen
Default

Dear Monk.

Thanks for your reply, I do not know whether u have understand my point or not.

Simplt what I want is all server logs and how much space available on server, shoud automatically come on my mail.
I have another server which works as MTA it just sends a mail to internet cloud.
So I want is my limus server send a mail to this server with all info and this server forward a mail to any mail ID may be Yahoo or Gmail.

Waiting for your reply.

Regards.
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #4 (permalink)  
Old 25-10-2006, 08:07 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
OS: Suse, RHEL, Vista
Posts: 199
Thanks: 12
Thanked 9 Times in 9 Posts
Rep Power: 7
sweta has a spectacular aura about sweta has a spectacular aura about
Default

Use mail command to send email
Code:
mail -s "subject" me@yahoo.com < log.file.txt
Use matt command to send an email attachment
Code:
mutt -s "subect" -a  /var/log/mail.log  me@yahoo.com < /dev/null
You need to configure sendmail as null mail client to forward all mail to central mail server or MTA hub.

What monk told is quite advance and it is only recommended if you need to authenticate SSL mail or in chrooted jail.
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Tomcat shell script cron job to restart server kasimani Shell scripting 4 03-05-2008 07:46 PM
shell script to send mail for each login. ephdia Shell scripting 2 27-11-2007 04:42 PM
bash script to collect info adahan Shell scripting 7 31-10-2007 06:06 PM
Require shell script using rsync puppen Shell scripting 4 23-04-2006 12:52 AM
require shell script puppen Shell scripting 4 12-04-2006 09:42 PM


All times are GMT +5.5. The time now is 03:31 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38