This feed contains pages in the "debienna" category.

% scalable monitoring with collectd and nagios % Fabian Linzberger e@lefant.net % 2008-12-04

some links beforehand

collectd

  • rich performance monitoring (snmp has little data for a linux host)
  • push model
  • uses rrdtool for storage
  • allows for mod_perl-style plugins
  • can poll snmp stuff
  • faster than munin
  • little config needed, just works!

see yourself for more: collectd features

minimal collectd server config

#Hostname "localhost"
FQDNLookup true

<span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=loadplugin&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>LoadPlugin</span> network
<span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=loadplugin&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>LoadPlugin</span> rrdtool

<Plugin network>
        Listen "217.19.46.22"
        Listen "2002:d913:2e16::1"
</Plugin>

<Plugin rrdtool>
        <span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=datadir&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>DataDir</span> "/var/lib/collectd/rrd"
</Plugin>

minimal collectd client config

#Hostname "localhost"
FQDNLookup true

<span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=loadplugin&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>LoadPlugin</span> network
<span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=loadplugin&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>LoadPlugin</span> cpu
<span class="createlink"><a href="http://lefant.net/cgi-bin/ikiwiki.cgi?page=loadplugin&amp;from=debienna%2Fcollectd_and_nagios&amp;do=create" rel="nofollow">?</a>LoadPlugin</span> df

<Plugin network>
        Server "rerun.lefant.net"
</Plugin>

collectd webfrontend

enable using

sudo cp /usr/share/doc/collectd/examples/collection.cgi \
/usr/lib/cgi-bin/collection.cgi

and adapt webserver as needed.

demo url: http://rerun.lefant.net/cgi-bin/collection.cgi

just for fun:

  • install collectd and send your data to rerun like in the example above!

nagios

  • host and service availability monitoring
  • testing for sysadmins!

webinterface statusmap

statusmap

webinterface services

services

more screenshots

notification email

***** Nagios *****

Notification Type: PROBLEM

Service: LOAD
Host: rerun.lefant.net
Address: rerun.lefant.net
State: CRITICAL

Date/Time: Thu Dec 4 17:20:48 CET 2008

Additional Info:

(Service Check Timed Out)

cnagios

  • homepage
  • screenshot
  • runs in screen and can do grep for host and service names

nagios objects

  • hosts
  • services
  • commands

  • contacts

  • escalations
  • timeperiods

  • maps (using parent relationships)

nagios object overview

host example

define host{
  use        generic-host-bundled
  host_name  rerun.lefant.net
  address    rerun.lefant.net
  parents    odyssey.lefant.net
}

nagios docs for host objects

service example

define service{
  use                  generic-service-bundled
  hosts                www1,www2
  service_description  HTTP
  check_command        check_http
}

nagios docs for services

command example

very easy to extend, just put your script there or collectd-nagios (debian version buggy, see end)

define command{
  command_name  check_collectd
  command_line  /usr/local/bin/collectd-nagios \
    -s /var/run/collectd-unixsock -H $HOSTNAME$ \
    -n $ARG1$ -d $ARG2$ -w $ARG3$ -c $ARG4$
}
define command{
  command_name  check_collectd_percentage
  command_line  /usr/local/bin/collectd-nagios \
    -s /var/run/collectd-unixsock -H $HOSTNAME$ \
    -n $ARG1$ -g percentage -d $ARG2$ -d $ARG3$ \
    -w $ARG4$ -c $ARG5$
}

templates

define default properties via templates:

define host{
  name                          generic-host
  notifications_enabled         1
  process_perf_data             1
  retain_status_information     1
  retain_nonstatus_information  1
    check_command               check-host-alive
    max_check_attempts          10
    notification_interval       0
    notification_period         24x7
    notification_options        d,u,r
    contact_groups              admins
  register                      0
}

inheritance

this can also be inherited and customized:

define host {
  use generic-host
  name generic-host-bundled
  register                      0
  contact_groups                lefant
}

works fine for things that can be configured for hosts.

problem: service centric

however hosts cannot configure services to be monitored...

define host{
  use         generic-host-bundled
  host_name   rerun.lefant.net
  address     rerun.lefant.net
  parents     odyssey.lefant.net
  services    HTTP,SMPT         # doesn't work!!!
}

problem: service centric (2)

define service{
  use                  generic-service-bundled
  hosts                www1,www2
  service_description  HTTP
  check_command        check_http
}
define service{
  use                  generic-service-bundled
  hosts                www1
  service_description  SMTP
  check_command        check_smtp
}

imagine 10 or 20 services to be monitored for every box, you get to configure all of them, for every host.

pay your service hostgroup tax!

define service{
  use                  generic-service-bundled
  service_description  HTTP
  hostgroup_name       HTTP
  check_command        check_http
}
define hostgroup{
  hostgroup_name       HTTP
}

host config with taxes paid

define host{
  use                  generic-host-bundled
  host_name            rerun.lefant.net
  address              rerun.lefant.net
  parents              odyssey.lefant.net
  hostgroups           HTTP,COLLECTD
}

service hostgroup tax (continued)

then even grouping services works fine:

define service{
  use                  generic-service-bundled
  service_description  SWAP-FREE
  hostgroup_name       SWAP-FREE
  check_command        check_collectd\
    !swap/swap-free!value!209715200:!104857600:
}
define hostgroup{
  hostgroup_name       SWAP-FREE
  hostgroup_members    COLLECTD
}

(note the collectd nagios integration example here)

more nagios collectd service checks

define service{
  use                  generic-service-bundled
  service_description  LOAD
  hostgroup_name       LOAD
  check_command        check_collectd\
    !load/load!midterm!5!10
}
define hostgroup{
  hostgroup_name       LOAD
  hostgroup_members    COLLECTD
}

more nagios collectd service checks

(percentage needs patch, see end)

define service{
  use                  generic-service-bundled
  service_description  DF-ROOT
  hostgroup_name       DF-ROOT
  #check_command        check_collectd\
  #!df/df-root!free!601000000:!301000000:
  check_command        check_collectd_percentage\
    !df/df-root!used!free!20:!10:
}
define hostgroup{
  hostgroup_name       DF-ROOT
  hostgroup_members    COLLECTD
}

further links

more examples: lefants config templates in git

to compile cnagios / collectd

sudo aptitude install lex yacc automake autoconf \
libtool bison flex libltdl3-dev pkg-config \
libperl-dev libncurses5-dev

fixed collectd-nagios:

git clone git://git.verplant.org/collectd.git
git checkout 953bd0f881faa40c415a1f1a9d7e2da739d343ff
#or just use latest

further links (2)

my puny percentage patch:

playing with initial version of openvz monitoring via perl plugin:

final notes

  • know-how for this talk was in part sponsored by RevDev my current employer

  • questions?


Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna

i have created debian backports to etch of current versions of mpd, rtorrent and mt-daapd and the dependencies needed to build / install them.

add

deb http://lefant.net/debian/ etch-backports main

to your /etc/apt/sources.list in case you are interested.

mt-daapd and rhythmbox are a great pair to store music on one computer and play on another, with little configuration on the server and none on the client, by the magic of zeroconf! highly recommended. should also work with itunes and other stuff from apple.

Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna

yesterday at debienna i gave a talk about computer networking in general, ipv6 and vpn in particular. afterwards we had some nice further discussion.

i have also created a page in the wiki with some links in case you are interested: NetzwerkenConnectYourDevices

Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna

highlights and random thoughts:

present at some point in the evening or another: lefant, harald, karl, andreas, maks, rotty, markus, gregor

i play around with the new metalab 2.0 soup.io, there is now soup.lefant.net. also there is a aggregate plugin of ikiwiki resulting in lefants soup on ikiwiki.

looking at the quintessenz backup server in the office i find that backuppc is slow and boxbackup is quick and efficient. i also run a boxbackup server at home on my nslu2 (32mb ram for those who don't know it), it is also in debian sid and there is an etch version on backports.org.

it seems an official darcs.debian.org is being planned. i was contacted as the debian maintainer for darcsweb and hurried to finally reply to two of the open bugs. of course i hope darcs.debian.org will feature darcsweb ;)

checking out firehol. default config works good enough for my laptop ;)

after about a week of use rss2imap seems to be good enough as a google reader replacement. a little of my privacy returns ;)

http://www.mozart-oz.org/features.html is surely interesting for the functionally inclined.

at a later time we also discussed some further topics we would like to talk about in the future.

Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna

2007-07-22

for some time now i have been using f-spot (website: http://f-spot.org/, which is a nice photo organization software for gnome. above all f-spot has great support for tagging, which in my opinion is a very important feature. you can also automatically create a static html thumbnail gallery for your website or export to flickr or gallery (the php thing many people seem to be using). however this way either you loose your tags (static html, gallery) or you handover your pictures and control over the url to flickr (which limits you to 200 pictures in their free plan anyway).

phpfspot (website: http://oss.netshadow.at/oss/phpfspot/Project, freshmeat: http://freshmeat.net/projects/phpfspot/) to the rescue!

after some whining on my part at work my colleague at work andreas unterkircher started looking for a better webfrontend solution (foremost including good support for the tags) himself and, finding none, started coding. for reference there is pennave with a similar goal (website: [http://pennave.sourceforge.net/](http://pennave.sourceforge. net/)), however speed was really lacking and development very slow).

i am now happily running phpfspot myself (link: http://gallery.lefant.net/). i also use the thumbnail export feature to create thumbnail galleries for use in the debienna wiki (link: http://debienna.at/). the thumbnails on the starting page are created dynamically for each page visit (try reloading, see http://debienna.at/?action=raw for the page source and the ?RandomQuote hack) which uses the FotoFortunes wiki page as its source (warning, huge page). using phpfspots export feature i can now create the content of the ?FotoFortunes page automatically after selecting all pictures with the debienna tag.

the same works with literal html for blog entries like this one. find a thumbnail gallery of all my images tagged with "screens" below:

i am happy, thanks unki!

Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna

since we are getting much too little attention online anyway, i will start blogging about debienna treff regularly from now on.

highlights:

maxx visits us once again (in his suit, straight from work, yay!)

maks talks about rsyslogd. he is looking for someone to package it.

koki reports about first experiences with puppet, tries to make my thinkpads bios beep when it is about to run out of battery.

i take a look at the ipv6 configuration in the q/office with harald, happily discovering that it still works and that i can even ping and connect to some machines in my home network ;)

sixxs is a cool ipv6 tunnel broker

ipv6 connectivity fuer rerun.lefant.net restored.

i am totally envious of haralds cool funkfeuer reverse lookup for his home ip: k10v1.funkfeuer.at

noscript ist ein leiwandes firefox plugin, das es erlaubt selektiv javascript fuer manche hosts freizuschalten und andere nicht.

we briefly discuss the general resolution that has recently been proposed General Resolution: Endorse the concept of Debian Maintainers.

andreas fleckl starts updating our changelog. hacks on his dovecot / postfix virtualuser setup. koki recommends a link and helps out a little bit.

it seems dnsmasq does not at all cache dns lookups (even when they are done via udp, this behaviour is documented in the FAQ for tcp lookups). confirmed via tcpdump on debian etch, freewrt and freifunk firmware. odd. if you know a decent dnscache for an embedded device distribution (like freewrt or freifunk firmware), let us know.

Posted Fri 20 Nov 2009 05:43:42 PM CET Tags: debienna