Difference between revisions of "Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up Remote Monitoring"

From bering-uClibc
Jump to: navigation, search
(Accessing the Data: Added Hardware Sensors sub-section)
m
Line 4: Line 4:
 
| width="20%" align="left"  | [[Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up Tor|Prev]]
 
| width="20%" align="left"  | [[Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up Tor|Prev]]
 
! width="60%" align="center" | [[Bering-uClibc 4.x - User Guide]]
 
! width="60%" align="center" | [[Bering-uClibc 4.x - User Guide]]
| width="20%" align="right"  | [[Bering-uClibc 4.x - User Guide - Advanced Topics - Modifying initrd.lrp|Next]]
+
| width="20%" align="right"  | [[Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Next]]
 
|}
 
|}
 
----
 
----

Revision as of 08:54, 20 June 2011

Advanced Topics - Setting Up Remote Monitoring
Prev Bering-uClibc 4.x - User Guide Next


Objectives

We assume here that you wish to monitor some operational parameters of a Bering-uClibc system. The parameters of interest will vary depending on the precise usage of the system but might include:

  • Network traffic bandwidth through each network interface.
  • Round-trip network latency to different destinations.
  • CPU utilization.
  • Disk utilization.
  • CPU and Motherboard temperatures.

We also assume you wish to use a separate machine as the Network Management Station, which is responsible for collecting and presenting the operational parameter data.

An example of network traffic bandwidth monitoring is the following graph, generated by the Cacti application.

Example Bandwidth Monitoring Graph
Example Bandwidth Monitoring Graph

The overall solution consists of three main components:

  • Some means accessing the operational parameter data.
  • Some means of communicating this data to the Network Management Station.
  • Some means of storing, displaying or otherwise reporting on the data.


Accessing the Data

For "standard" parameters this is covered by the next section, since the tools which Communicate the data are also responsible for accessing the parameter values.

For non-standard parameters it is necessary to do something more specific. Generally this is achieved by implementing a program/script which returns the parameter data in a very simple form - e.g. printing a number to stdout.

Hardware Sensors

Many CPUs and motherboards include temperature sensors, fan speed sensors or other sensors which can be queried using the lm-sensors utilities.

Packages

For Bering-uClibc 4.x the lm-sensors utilities can be installed by loading the following Packages:

  • sensors.lrp
  • libsens.lrp
  • libm.lrp (if that is not already loaded)
  • perl.lrp (only for running "sensors-detect", see below)

Modules

You probably need to load Modules for:

  • Your system's i2c interface hardware
  • Your hardware sensor(s)

The precise Modules required will depend on your hardware.

Automatic Sensor Detection

If you do not know what sensor hardware is installed (and what kernel Module(s) are required) there is a Perl script /usr/sbin/sensors-detect which can scan your system and try to identify any sensors found.

This script relies on the presence of an i2c device file which is implemented by kernel Module i2c-dev.ko so this should be loaded before running the script.

If the script finds a sensor it will tell you what it is and which kernel Module needs to be loaded.

Sensors Command

With the lm-sensors Packages installed and the necessary kernel Modules loaded, the sensors command should display some values. The following example is from an ALIX2D13 board:

# sensors                                                               
lm86-i2c-0-4c                                                                   
Adapter: CS5536 ACB0                                                            
temp1:        +36.0 C  (low  =  +0.0 C, high = +70.0 C)                         
                       (crit = +85.0 C, hyst = +75.0 C)                         
temp2:        +41.1 C  (low  =  +0.0 C, high = +70.0 C)                         
                       (crit = +85.0 C, hyst = +75.0 C)

Simplified Output

The output from the sensors command can be simplified by using a shell script containing the following:

sensors | grep "[Tt]emp" | awk -F: '{print $2}' | tr '+' ' ' | awk '{print $1}'

(Note that the mawk.lrp Package is required for the "awk" command.)

For the above example, this prints simply:

36.0
41.1

which is more suitable for further processing.

Communicating the Data

While there are several alternative approaches, the preferred solution in most cases is to use the Simple Network Management Protocol (SNMP) to let a remote Network Management Station access operational parameters on the Bering-uClibc system over the (internal) network.

TODO: Add details of installing and configuring the SNMP Packages. Copy (some) content from http://leaf.sourceforge.net/doc/bucu-rrdtool.html.


Reporting On the Data

A key benefit of using SNMP as the data communication mechanism is that any one of a number of different applications can be used to collect and report on the results. Since these run on other platforms they are not a focus for this Bering-uClibc documentation, but some brief notes are included below.

  • The Nagios system is popular. This has a focus on status reporting and alerting and is less oriented towards performance monitoring and graphing.
  • The RRDTool system is the leading Open Source solution for logging and graphing time-varying data. This can be used "raw" but is more often used within one of the other systems which provide management tools and an administration user interface.
  • The Cacti application is built on top of RRDTool and has a focus on collecting and graphing time-varying data.

A discussion of the pros and cons of these and other solutions can be found here.



Prev Up Next