Smokeping Exercises Network Monitoring and Management Smokeping --------- Notes: ------ * Commands preceded with "$" imply that you should execute the command as a general user - not as root. * Commands preceded with "#" imply that you should be working as root. * Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>") imply that you are executing commands on remote equipment, or within another program. Exercises ---------- 0. Log in to your PC or open a terminal window as the sysadmn user. Once you are logged in you can continue with these exercises. 1. Install Smokeping $ sudo apt-get install smokeping 2. Initial Configuration $ cd /etc/smokeping/config.d $ ls -l -rwxr-xr-x 1 root root 578 2010-02-26 01:55 Alerts -rwxr-xr-x 1 root root 237 2010-02-26 01:55 Database -rwxr-xr-x 1 root root 413 2010-02-26 05:40 General -rwxr-xr-x 1 root root 271 2010-02-26 01:55 pathnames -rwxr-xr-x 1 root root 859 2010-02-26 01:55 Presentation -rwxr-xr-x 1 root root 116 2010-02-26 01:55 Probes -rwxr-xr-x 1 root root 155 2010-02-26 01:55 Slaves -rwxr-xr-x 1 root root 8990 2010-02-26 06:30 Targets $ sudo vi General Change the following lines: owner = NOC contact = sysadm@localhost cgiurl = http://localhost/cgi-bin/smokeping.cgi mailhost = localhost Save the file and exit. Now let's restart the Smokeping service to verify that no mistakes have been made before going any further: $ sudo service smokeping restart 2. Configure monitoring of devices The majority of your time and work configuring Smokeping will be done in the file /etc/smokeping/config.d/Targets. For this class please do the following: Use the default FPing probe to check: - all the PCs in your group - classroom NOC - switches - routers You can use the classroom Network Diagram on the classroom wiki to figure out addresses for each item, etc. Create some hierarchy to the Smokeping menu for your checks. Such as: +Local menu = Network Monitoring and Management title = NOC Server for Network Monitoring Class ++LocalMachine menu = The NOC@NetManage title = The NOC@NetManage host = localhost # # Classroom PCs # ++PCs +++pc1 menu = pc1 title = pc1 host = pc1 +++pc2 menu = pc2 title = pc2 host = pc2 Save the file and restart Smokeping: $ sudo service smokeping restart Go to your browser and check the Smokeping page: http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi If everything is looking OK, continue adding: ++Routers +++rtr menu = rtr title = Gateway Router host = rtr +++rtr1 menu = rtr1 title = Router 1, Group 1 host = rtr1 ++Switch ++sw menu = sw title = Backbone Switch host = sw ... Save the file, restart smokeping, and check your browser again. 3. Add new probes The current entry in Probes is fine, but if you wish to use additional Smokeping checks you can add them in here and you can specify their default behavior. You can do this, as well, in the Targets file if you wish. Here is an example of a Probes file that would specify what to use to check for HTTP and DNS latency as well as the FPing probe that is used for ping latency: $ sudo vi Probes *** Probes *** + FPing binary = /usr/bin/fping + EchoPingHttp + DNS binary = /usr/bin/dig pings = 5 step = 180 lookup = www.nsrc.org Save the file. 4. Add HTTP latency checks Now edit your Targets again: $ sudo vi Targets Add a check for HTTP latency for all the classroom PCs. This will mean adding another category, such as: ++HTTP Servers probe = EchoPingHttp menu = HTTP Response title = HTTP Response Student PCs +++pc1 menu = pc1 title = PC1 HTTP Response Time host = pc1 +++pc1 host = pc2 title = PC2 HTTP Response Time host = pc2 ... If you have time, consider checking some machines that are external to our classroom and the conference (your organization's website, a popular web page, etc...) 5. Add DNS Latency Checks You can check either or both internal or external names using the DNS latency probe. Add a menu hierarchy for DNS Latency. Check an external address (nsrc.org) and an internal address (noc). This will look something like this (in Targets): +DNS probe = DNS menu = External DNS Check title = DNS Latency ++nsrc host = nsrc.org ++noc host = noc.mgmt Exit and save your changes to the file Targets. Restart Smokeping to see the changes: $ sudo service smokeping restart Look at additional Smokeping probes and consider implementing some of them: http://oss.oetiker.ch/smokeping/probe/index.en.html As trying to explain all syntactical details of how the file /etc/smokeping/config.d/Targets is used would require several pages we will go through some examples in class, and you can refer to the Smokeping configuration files that are in use on the classroom NOC box by going to: http://noc/configs/etc/smokeping http://noc/configs/etc/smokeping/config.d