LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-12-2013, 10:39 PM   #1
trimaymishra
LQ Newbie
 
Registered: Feb 2013
Posts: 2
Blog Entries: 1

Rep: Reputation: Disabled
Question Scripting on server logs


I want to read a log file through scripting and if that logs is nt running then a mail should come to me...is that possible through shell scripts???
 
Old 02-13-2013, 01:42 AM   #2
ram5019
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Hi ,

its possible via shell scripting

or you can use swatch: Automated Log Monitoring tool in linux , search for google
linuxjournal.com
 
Old 02-13-2013, 09:17 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,608

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by trimaymishra View Post
I want to read a log file through scripting and if that logs is nt running then a mail should come to me...is that possible through shell scripts???
Yes, you just have to write the script. And your question is confusing...do you want to look at a log file and get email when you see a certain pattern? Or do you want to know if system logging is running or not? Because they're two different things, and your question could be either.

And do you already have a mail system set up to handle sending emails from your Linux system???
 
Old 03-05-2013, 07:12 AM   #4
trimaymishra
LQ Newbie
 
Registered: Feb 2013
Posts: 2

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Yes, you just have to write the script. And your question is confusing...do you want to look at a log file and get email when you see a certain pattern? Or do you want to know if system logging is running or not? Because they're two different things, and your question could be either.

And do you already have a mail system set up to handle sending emails from your Linux system???
I want to read the logs whether it is running or not? if not running then a mail should come to my mail a/c.I am monitoring the servers on Nagios,no additional mailing system is set up.
 
Old 03-05-2013, 10:47 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,608

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by trimaymishra View Post
I want to read the logs whether it is running or not? if not running then a mail should come to my mail a/c.I am monitoring the servers on Nagios,no additional mailing system is set up.
Still confusingly worded, but if you want to check to see if a service is running or not, use the scripts that are already in /etc/init.d. Chances are, there is an "/etc/init.d/syslog" file (might be syslog-ng). To check the status, just run the script ("/etc/init.d/syslog status"). It'll tell you if it's running or not.

And if you don't have a mail system set up, how do you think you're going to get an email if it's not working?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logs Explaining: Worrying Server Log After Possible Attack (sites probed the server) amanacare Linux - Security 7 06-25-2012 04:06 PM
Need Scripting Help To Manage Old Logs oldyankee Linux - Newbie 8 03-22-2012 07:00 PM
configuring syslog server and exporting of logs to the server kpratik Linux - Server 6 01-18-2011 10:50 AM
Finding LDAP Server Logs / Application Logs in Linux arbignay Linux - Newbie 2 03-24-2008 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration