rrdtool dump filename.rrd rrdtool info filename.rrd   rrdtool graph /dev/null -s 3600 DEF:ierr=filename.rrd:ds1:AVERAGE VDEF:ioct_a=ierr,AVERAGE PRINT:ierr:%lf this command will get the avg value of ds1 (ds1 is the dataset – you can see it in rrdtool info )  , assign it to variable ierr  and print out #3600 => one hourRead More →

Create a service: sudo vi /etc/systemd/system/rc-local.service Add your code there: [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target Create and make sure /etc/rc.local is executable and add this code inside it: sudo chmod +x /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will “exit 0” on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0 Enable the service: sudoRead More →

My Strongswan : Local IP: 172.30.0.37 Elastic IP: 19.215.188.2 OS: Ubuntu My WAN: Customer grade broadband Internet Public IP:28.77.250.17 – connect to my fiber optics Local gateway IP: 192.168.1.100 we need to setup porftforwarding : UDP port 4500,500, to our router interface 192.16.1.108 My Cisco: Cisco 1841 fa0/1 : 192.168.1.108  – connect to My WAN router local interface fa0/0: 172.16.8.254 – connect to my local switch / pc My Strongswan config: /etc/ipsec.conf config setup # strictcrlpolicy=yes # uniqueids = no conn %default ikelifetime=1440m keylife=60m rekeymargin=3m keyingtries=1 keyexchange=ikev1 authby=secret conn myremoteoffice left=172.30.0.37 #strongswan outside address leftsubnet=172.30.0.0/24,0.0.0.0/0 #network behind strongswan leftid=19.215.188.2 #IKEID sent by strongswan leftfirewall=yes right=28.77.250.17Read More →

i have 2 sites vpn between Strongswan and Cisco 1841 , the vpn works well , but there is a problem , some of ssl website could not open , after some research it turned out that’s the mtu issue. this is how i fix: conf t int fa0/1 ip mtu 1500 int fa0/0 ip mtu 1500 In case of yahoo, i need to update this on strongswan server: $ iptables -t mangle -A FORWARD -o eth0 \ -p tcp -m tcp –tcp-flags SYN,RST SYN \ -m tcpmss –mss 1361:1536 \ -j TCPMSS –set-mss 1360 $ echo 1 >/proc/sys/net/ipv4/ip_no_pmtu_disc For your reference: MTU woes inRead More →

#add this line in Type 3 – ^${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record Value DESTINATION_ADDRESS (\w+.\w+.\w+) Value TYPE (\w+) Value VLAN (\w+) Value DESTINATION_PORT (\S+) Start ^Destination\s+Address\s+Address\s+Type\s+VLAN\s+Destination\s+Port -> TYPE1 ^\s+vlan\s+mac address\s+type\s+learn\s+age\s+ports -> TYPE2 ^\s+vlan\s+mac address\s+type\s+protocols\s+port -> TYPE3 ^Vlan\s+Mac Address\s+Type\s+Ports -> TYPE4 TYPE1 ^${DESTINATION_ADDRESS}\s+${TYPE}\s+${VLAN}\s+${DESTINATION_PORT} -> Record TYPE2 ^[*|\s]\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+\S+\s+${DESTINATION_PORT} -> Record TYPE3 ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record ^${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record TYPE4 ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT} -> Record  Read More →

When you tried to stop Nagios to monitor some services from web interfaces – you see the message below: Sorry, but Nagios is currently not checking for external commands, so your command will not be committed! This is because we haven’t enable this feature in our configuration, it’s easy to fix. Open your nagios config file , /etc/nagios3/nagios.cfg Look for this line: check_external_commands=0   change it to check_external_commands=1   and reload nagios /etc/init.d/nagios3 restart You might receive this error: Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!.  The fix is # /etc/init.d/nagios3 stop Stopping nagios3 monitoring daemon: nagios3Waiting for nagios3 daemon to die… . # dpkg-statoverride –updateRead More →