Stop SNMP Connection and Transport Socket Log

Stop SNMP Connection and Transport Socket Log in /var/log/messages.

The following logs always fills the /var/log/messages and makes difficult to identify the other System and OS related logs.
And it always logs in two places in /var/log/messages and /var/log/snmpd.log respectively.

Connection from - 192.168.177.35
transport socket = 14

With two ways we can stop the log to go to /var/log/messages and loging in only to one place /var/log/snmpd.log.
Procedure 1
Step1.
view the service script /etc/init.d/snmpd
if you find the following lines

if [ -e /etc/sysconfig/snmpd.options ]; then
. /etc/sysconfig/snmpd.options
else
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
fi

Step 2.
Create a file /etc/sysconfig/snmpd.options
#touch /etc/sysconfig/snmpd.options

Step 3.
Insert the following in the above created file.
OPTIONS="-LS e d -Lf /dev/null -p /var/run/snmpd.pid -a"

Step 4.
Restart the snmpd service
#/etc/init.d/snmpd restart

Procidure 2
Step1.
view the service script /etc/init.d/snmpd
if you find only the following lines with out any if loop
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

Step 2.
Edit the above line as follow:-
OPTIONS="-LS e d -Lf /dev/null -p /var/run/snmpd.pid -a"

Step 4.
Restart the snmpd service
#/etc/init.d/snmpd restart

Comments

Popular posts from this blog

configure Netbackup email notification on Unix