Updates from January, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Jeff Forman 11:33 am on January 30, 2011 Permalink
    Tags: freebsd, munin   

    Remind me: Configuring BIND9 plugin for Munin on FreeBSD (and Linux) 

    I was attempting to get Munin working on a new FreeBSD machine, monitoring the rate of queries to a Bind9 DNS server. Every time I attempted ‘munin-run bind9′ I was presented with the same error:

    2011/01/29-18:09:55 [3581] Error output from bind9:
    2011/01/29-18:09:55 [3581]     Died at /usr/local/etc/munin/plugins/bind9 line 41.
    2011/01/29-18:09:55 [3581] Service 'bind9' exited with status 2/0.
    

    Digging around in the Bind9 Munin plugin, line 41 complains about a state file that Munin uses. The plugin immediately tries to open the state file, without checking if the file is actually present. (TODO: Check to see what ramifications there are to just creating the file if it is not present.)

    Line 41:

        open(Q,"< $STATEFILE") or die;
    

    After digging around to figure out the plugin state directory (/var/munin/plugin-state, for those following along at home), I was back in business.

    [root@dns1 ~]# cd /var/munin/plugin-state
    [root@dns1 /var/munin/plugin-state]# touch bind9.state
    [root@dns1 /var/munin/plugin-state]# chgrp munin bind9.state
    [root@dns1 /var/munin/plugin-state]# chmod g+rw bind9.state
    [root@dns1 /var/munin/plugin-state]# ls -al
    total 4
    drwxrwxr-x  2 nobody  munin  512 Jan 29 18:13 .
    drwxr-xr-x  3 munin   munin  512 Jan 29 14:47 ..
    -rw-rw-r--  1 root    munin    0 Jan 29 18:13 bind9.state
    

    Relevant bind named.conf stanza for query logging:

    logging {
      channel default_queries {
        file "/var/log/queries.log" versions 3 size 500k;
        severity info;
        print-severity yes;
        print-category yes;
        print-time yes;
      };
      category queries { default_queries; };
    };
    

    With that, ‘munin-run bind9′ worked. I restarted the munin-node process and queries are now being graphed as expected.

    [Update 2012-02-20: Getting this working on Ubuntu Server]

    After banging my head against the wall trying to get this plugin working on Linux, dying on the same line (about the inability to find the state file), this is how I got it working.

    Create the following file with the appropriate permissions.

    root@grenache:/var/lib/munin/plugin-state# ls -al bind9.state 
    -rw-rw-r-- 1 nobody munin 22 2012-02-20 15:39 bind9.state

    And now, voila:

     root@grenache:/var/lib/munin/plugin-state# munin-run bind9
     query_PTR.value 25
     query_A.value 109
     query_AAAA.value 199
     query_other.value 0
     
  • Jeff Forman 8:35 pm on January 8, 2011 Permalink  

    Munin monitoring your SB6120 Comcast Cable Modem 

    For those who have spent time debugging their Comcast Internet connection, we all know the frustration of trying to explain to Comcast that something on their end is the problem. In this case, more data is better: latency history, ping times, traceroutes, etc. You can run Smokeping to monitor latency between your home connection and a remote Internet IP address for example. You can also print out traceroute examples and email them if you have an astute support contact. But if you want to monitor the data your cable modem is seeing, you need to look at the signal to noise ratio of your connection. This ratio refers to how much of your signal has been disturbed by noise on the physical line (Thanks Wikipedia). Newer cable modems will use multiple channels along the same line to increase your download and upload speed, and each channel can be disturbed independently.

    Enter Munin, an RRD-graph based tool that creates easy to understand (for the most part) graphs of data over time. Munin plugins can be written to scrape any data you are able to programatically retrieve and whip it into a pretty graph. The plugin I wrote for Munin scrapes the data from a Motorola Surfboard SB6120 modem’s status page, and presents it in an easy-to-digest format for Munin. Previous Munin plugins handled the old SB4120 and SB5120 modems. These are old DOCSIS 2.0 products, and therefore the status page has evolved, and displays the connection data in a way where the old plugin does not work on the SB6120 modem.

    Without further adieu, the graph produced by my plugin is:
    The graph shows the various downstream and upstream channels, graphing the signal-to-noise ratio dB (decibel) of each respective channel.  Suggested values for Comcast in particular can be found in a FAQ entry from Broadband Reports. These are just suggestions, and different values will have different effects on your Internet connection. A severe dip in the graph could correspond to your modem being unable to stay sycned with Comcast’s infrastructure, which translates to an unstable Internet connection.

    Installation instructions follow common Munin plugin practices, by creating the plugin (or a symlink to the plugin) in the /etc/munin/plugins/ directory to the plugin code. Mine is written in Python, so a basic Python install is required on your machine. Source can be found can be found in my munin-surfboard6120 repo on Github.

    Enjoy! (Comments/criticisms are welcomed to improve the usefulness of this plugin)

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel