How to idenitfy a process ID using the TCP Port
Recently i had an issue in one of my linux machines, where I was unable to start the acronis_agent service which listens on TCP Port ;
Later I realised that already so many processes are listening on the TCP port.
To check the open connection for a TCP port
# netstat -an | grep 9876 ( In my case acronis_agent uses TCP 9876)
It was showing multiple connections………….
To check the PID(Process ID ) for all the sessions which are using the port 9876
#lsof -i TCP:9876
finally you could use the almighty command “kill -9 PID” …. boom everything became normal.
Linux Guide
Anyy body looking for a brief documentation on RHEL can make use of the below files , which I made for my linux class
How to change the MTU Value in Windows
Due to some network related issues you may need to reset the MTU vaules in you systems.
* To Change the MTU Value
netsh interface ipv4 set subinterface “Local Area Connection” mtu=1300 store=persistent
Of course REBOOT needed.
* If do you what to verify this setting:
netsh int ip show int
Sendmail STARTTLS: read error=generic SSL error
I was having an issue with my sendmail server where I receives this error which will cause the sendmails logs grow drastically and fill the /var partition.
further it will stop the mail flow ( when /var partition is full)
So i wrote this bash script which does the following;
– look for this error in the maillog
– when it finds it will kill the sendmail process which is causing the sendmail to log multiple entries in the logfile and will restart the sendmail and syslog daemons.
anybody is welcome to give their comment on improvements or any drawbacks on this script good luck…….
#!/bin/bash
LAST=’last message’
SSL=”STARTTLS: read error=generic SSL error (0)”
S1=”0″
cp /var/log/maillog /home/muralee/log_check/maillog
grep “STARTTLS: read error=generic SSL error (0)” /home/muralee/log_check/maillog |awk ‘/sendmail/ {print $5}’ | tr -d [digit:]”sendmail[]” > records.txt
#grep “STARTTLS: read error=generic SSL error (0)” /home/muralee/maillog.1 |awk ‘/sendmail/ {print $5}’ | tr -d [digit:]”sendmail[]” > records.txt
results=$(wc -l records.txt | awk ‘/records/ {print $1}’)
if [[ $results -eq 0 ]];then
echo “Sendmail is Fine”
fi
if [[ $results -ne 0 ]]; then
pkill sendmail
/etc/init.d/sendmail restart
/etc/init.d/syslog restart
echo “Problem resolved”
cat /dev/null > records.txt