LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-11-2011, 09:17 AM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
Filter snmpd entries from /var/log/messages


All, i am receiving numerous entries for programs such as snmpd in my messages file. Is there a way to add a rule somewhere to have these and other annoying unimportant entries go to /dev/null or something?

I tried adding an entry to /etc/syslog.conf, but that hosed any logging into the messages file, so maybe i added it wrong?

I want to try and do this with out installing anything additional.

Thanks!!
 
Old 03-11-2011, 12:31 PM   #2
dr_agon
Member
 
Registered: Sep 2007
Location: Poland
Distribution: Ubuntu LTS
Posts: 105
Blog Entries: 12

Rep: Reputation: 26
You were right to look at syslog.conf. Just read the man carefully, and adjust facility and priority to your needs.

Perhaps you need to configure logging to higher priority (eg. "error" instead of "info" or similar).

You may try to look at snmpd doc to learn what facility it sends logging messages to, and adjust only this facility in syslog.conf.

I don't know, but there might be some logging options for snmpd itself, which you can customize.
 
Old 03-11-2011, 02:03 PM   #3
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
I read the man page on syslog.conf and thought i had the solution based on what i read, but as i said, it hosed logging all together. So i was hoping someone could post me how an entry should look if you wanted to use the syslog.conf file to filter snmp type messages. I will also be looking to use that same example to filter other annoying entries if i see them as well, so if anyone knows if this can be done, please give me an example of what the entry would look like in syslog.conf.
 
Old 03-11-2011, 11:30 PM   #4
dr_agon
Member
 
Registered: Sep 2007
Location: Poland
Distribution: Ubuntu LTS
Posts: 105
Blog Entries: 12

Rep: Reputation: 26
I don't use snmpd, so I cannot give you the direct solution.

The part of my syslog.conf which logs to /var/log/messages looks like this:
Code:
*.=info;*.=notice;*.=warn;\
	auth,authpriv.none;\
	cron,daemon.none;\
	mail,news.none		-/var/log/messages
Check your syslog.conf and try to set different priorities, for example delete *.=info;*.=notice; and set cron,daemon to warn instead of none.

Settings in syslog.conf will affect the whole logging system. It means, that if you set your minimal logging priority to warning you will disable info messages from all programs. Consider redirecting lower priority messages to another log file, to keep log/messages clean and yet retain all information.
If you want to change only snmpd logging you must find appropriate option in its config.
 
Old 03-13-2011, 12:36 PM   #5
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
I tried that, that's where i mentioned that nothing was being logged to messages because that hosed it.
 
Old 03-14-2011, 04:15 AM   #6
dr_agon
Member
 
Registered: Sep 2007
Location: Poland
Distribution: Ubuntu LTS
Posts: 105
Blog Entries: 12

Rep: Reputation: 26
If you post the changes you made to syslog.conf maybe someone will find the mistake you made which stopped all logging.
 
Old 03-18-2011, 04:10 PM   #7
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
I will post shortly

Last edited by investmentbnker75; 03-21-2011 at 09:08 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate entries in /var/log/messages stan da ork Red Hat 2 10-29-2008 09:20 AM
SNMPD errors in /var/log/messages investmentbnker75 Linux - Server 1 08-29-2008 01:17 AM
Are these entries a problem in my /var/log/messages jim.thornton Linux - Server 4 02-08-2008 08:16 AM
New Entries in /var/log/messages sathyguy Linux - Security 3 04-26-2006 05:36 AM
/var/log/messages weird entries blizunt7 Linux - Security 5 11-01-2005 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:17 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