Cacti monitoring
I wanted to monitor Internet access within UK and continental routes to US. My setup varies but relays on SOHO routers connected over 3G mobile network, ADSL or radio point-to-point link. None of my devices are SNMP enabled therefore having a little options I would like to use continuous ping to certain POP and analysing a ping latency it should provide me with reliability of the link.
In course to accomplish this I have chosen Cacti http://www.cacti.net/index.php to draw nice graphs and coupled with Nectar plugin http://docs.cacti.net/plugin:nectar to email me on a regular basis.
My linux box is Ubuntu 13.04
Install email system and dependency packages
Cacti relays on a few packages and even though these will be installed as required dependency I prefer install them before cacti it self
sudo apt-get install apache2 snmp snmpd
Then installing email system to allow send emails MTA
sudo apt-get install exim4
Run the following command to configure exim4
sudo dpkg-reconfigure exim4-config
Set the following (Google smtp services: smtp.gmail.com:465 or smtp.gmail.com:587)
General type of mail configuration: mail sent by smarthost; no local mail System mail name: (default) IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 Other destinations for which mail is accepted: (default) Visible domain name for local users: hostname.pio2pio.vot.pl IP address or host name of the outgoing smarthost: smtp.gmail.com::587 Keep number of DNS-queries minimal (Dial-on-Demand)? No Split configuration into small files? No
The exim4 SMTP server is now set to route emails thru Gmail. Now all we need to do is to tell exim4 the username and password we are going to use. To accomplish this create a text file called /etc/exim4/passwd.client. Update the file to read:
# password file used when the local exim is authenticating to a remote # host as a client. # # see exim4_passwd_client(5) for more documentation # # Example: ### target.mail.server.example:login:password gmail-smtp.l.google.com:you@gmail.com:password *.google.com:you@gmail.com:password smtp.gmail.com:you@gmail.com:password
Replace you@gmail.com:password with your login information.
Reload the exim4 server:
sudo /etc/init.d/exim4 reload
To test the configuration launch a terminal and type:
echo 'ok' | mail -s 'Gmail SMTP Relay Test' youremail@domain.com
To preview exim4 logs
cat /var/log/exim4/mainlog tail -1000f /var/log/exim4/mainlog
To check connection to smtp.gmail.com:587, you should receive these 3 lines:
telnet smtp.gmail.com 587 Trying 173.194.67.108... Connected to gmail-smtp-msa.l.google.com. Escape character is '^]'. 220 mx.google.com ESMTP w4sm36472599wia.9 - gsmtp
At the moment I am unsuccessful to send emails from Ubuntu box ....... wip