Install TCPPing
1: Install tcptraceroute
shell> sudo yum install tcptraceroute
2: Download TCPPing and set permissions
shell> sudo cd /usr/bin/
shell> sudo wget https://pingpros.com/pub/tcpping
shell> sudo chmod 755 tcpping
Install HPing
1: Install EPEL Repository
shell> sudo yum install epel-release
2: Install HPing3
shell> sudo yum install hping3
Credits:
TCPPING – http://www.vdberg.org/~richard/tcpping
yum install rsyslog
yum install postfix
chkconfig rsyslog on
sudo mkdir /var/log/syslog
vim /etc/rsyslog.conf
Uncomment the UDP and TCP syslog reception items to match below:
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
Add Template before GLOBAL DIRECTIVES
$template RemoteLogs,”/var/log/syslog/%HOSTNAME%/%$now%.log” *
*.* ?RemoteLogs
& ~
Make sure rsyslog is on on boot and restart it
systemctl enable rsyslog.service
systemctl restart rsyslog.service
Setup Email Alerting
$ModLoad ommail
$ActionMailSMTPServer localhost
$ActionMailFrom networkteam@pingpros.com
$ActionMailTo networkteam@pingpros.com
$template mailSubject,”Network Issue on %hostname%”
$template mailBody,”RSYSLOG Alert\nmsg=’%msg%'”
$ActionMailSubject mailSubject
# make sure we receive a mail only once in an
# hours (3600 seconds)
$ActionExecOnlyOnceEveryInterval 3600
# the if … then … mailBody must be on one line!
if ($msg contains ‘BGP’ or $msg contains ‘bgp’ or $msg contains ‘OSPF’ or $msg contains ‘ospf’ or $msg contains ‘FLAP’ or $msg contains ‘down’ or $msg contains ‘DOWN’ or $msg contains ‘SPAN’ or $msg contains ‘span’ or $msg contains ‘loop’ or $msg contains ‘LOOP’ or $msg contains ‘up’ or $msg contains ‘UP’) then :ommail:;mailBody
# re-set interval so that other actions are not affected
$ActionExecOnlyOnceEveryInterval 0
Setup logrotate
sudo vim /etc/logrotate.conf
At very bottom of the file do the following
# Rotate the log daily up to 5 years of retention 365 times 5
/var/log/syslog/*.log /var/log/syslog/*/*.log {
dateext
dateformat .%Y-%m-%d
daily
rotate 1825
compress
}
Test the rotations
logrotate -d /etc/logrotate.conf
Linux ifconfig commands are being deprecated. Here is a quick overview.
Deprecated command
|
Replacement command(s)
|
arp |
ip n (ip neighbor) |
ifconfig |
ip a (ip addr), ip link, ip -s (ip -stats) |
iptunnel |
ip tunnel |
iwconfig |
iw |
nameif |
ip link, ifrename |
netstat |
ss, ip route (for netstat-r), ip -s link (for netstat -i), ip maddr (for netstat-g) |
route |
ip r (ip route) |