Advanced Monitoring

From Zentyal Linux Small Business Server
Jump to: navigation, search

Advanced Monitoring

Zentyal Server includes a monitoring module based on Collectd. Collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files. ebox-monitor configures this daemon and provides a frontend to graph these RRD files.

To monitor parameters not available through ebox-monitor, we will have to modify Collectd configuration file. Daemons configuration files are overwritten when Zentyal saves changes, so in order to make permanent our changes we will have to edit not files under /etc but the templates on /usr/share/ebox/stubs.

First, we are going to enable the Disk Plugin. We will open /usr/share/ebox/stubs/monitor/collectd.conf.mas and will comment out the line to load the plugin:

 47 LoadPlugin disk

And the will configure it with the following lines:

 90 <Plugin "disk">
 91   Disk "/^sd/"
 92   IgnoreSelected false
 93 </Plugin>

The Disk parameter defines the hard disks going to be monitored, "/^sd/" means all the /dev/sda, /dev/sdb, /dev/sdc, and so on disks. Refer to the Disk plugin documentation for more information.

Now we will see how to monitor Squid HTTP Proxy using SNMP with Collectd. First we will edit the Squid configuration file template on /usr/share/ebox/stubs/squid/squid.conf.mas adding the following lines:

113 acl snmppublic snmp_community public
114 snmp_port 3401
115 snmp_access allow snmppublic localhost

After this, we will restart ebox-squid to apply changes, but make sure the module is already enabled:

$ sudo /etc/init.d/ebox squid restart

Now, go back to the Collectd template, enable SNMP Plugin:

79 LoadPlugin snmp

And we will configure it to monitor one of the Squid parameters, for example cacheProtoClientHttpRequests:

274 <Plugin snmp>
275        <Data "cacheProtoClientHttpRequests">
276                Type "cacheProtoClientHttpRequests"
277                Table false
278                Instance ""
279                Values ""
280        </Data>
281        <Host "localhost">
282                Address ""
283                Version 2
284                Community "public"
285                Collect "cacheProtoClientHttpRequests"
286        </Host>
287 </Plugin>

We can check with snmpwalk (from the snmp package) that Squid replies to SNMP queries:

$ snmpwalk -m /usr/share/snmp/mibs/SQUID.txt -v2c -c public localhost:3401
SQUID-MIB::cacheProtoClientHttpRequests.0 = Counter32: 0

Just to finish, restart ebox-monitor to apply configuration changes made on Collectd template:

$ sudo /etc/init.d/ebox monitor restart

Installing collection3 to graph Collectd

We can install a web application, collection3, to graph these new parameters not included in ebox-monitor. collection3 is in the contrib directory of Collectd releases. Download it from Collectd website, unpack it and copy to /var/www

$ wget http://collectd.org/files/collectd-4.9.2.tar.bz2
$ tar xvjf collectd-4.9.2.tar.bz2
$ sudo cp -r collectd-4.9.2/contrib/collection3 /var/www

Now we need to allow .htaccess configuration files included in collection3. Edit /etc/apache2/sites-enabled/000-default and change AllowOverride to all:

 10         <Directory /var/www/>
 11                 Options Indexes FollowSymLinks MultiViews
 12                 AllowOverride all
 13                 Order allow,deny
 14                 allow from all
 15         </Directory>

To finish install some libraries needed by collection3: libconfig-general-perl and libregexp-common-perl. After restarting Apache we should be able to view collection3 on your web browser at http://ip_address/collection3/bin/.

Personal tools


Zentyal Wiki

Zentyal Doc