New Munin-plugin for HAProxy

I committed a new Munin-plugin for HAProxy. It’s a multigraph plugin, it discovers all the configured frontends and backends automatically – all you need to provide is the username/password for the haproxy status page.

It produces 8 graphs, + subgraphs for some of the backends, where it presents the same graphs, but with server-specific metrics.

Some of the root-graphs:









Do you use HAProxy and Munin? Check it out!

This entry was posted in Munin, Planet Redpill-Linpro. Bookmark the permalink.

17 Responses to New Munin-plugin for HAProxy

  1. Miah says:

    Looks great! I’m about to give this plugin a try, would be perfect if it supported unix socket. =)

  2. Branko Toic says:

    Excellent plugin! Thumbs up… I’ve just configured it on my haproxy, looking forward to seeing graphs tomorrow morning when they collect more data.

    Tnx for sharing!

  3. Max says:

    When I do munin-run haproxy_ng, it shows values and stuff, but when munin runs its cron, graphs do not update – they stay with ‘nan’.
    I’ve checked permissions and they are fine.

  4. Diego says:

    Great plugin,
    Sorry I am new in munin, buy when i try to configure it I got this error:

    2012/05/17-21:59:00 [17147] Error output from haproxy_ng:
    2012/05/17-21:59:00 [17147] Can’t exec “/etc/munin/plugins/haproxy_ng”: No such file or directory at /usr/share/perl5/Munin/Node/Service.pm line 215.
    2012/05/17-21:59:00 [17147] # ERROR: Failed to exec.

    Thank you.

    • Trygve Vea says:

      Sounds like it’s a symlink pointing to nothing. Make sure to copy the plugin in and make it executable.

      If you still have problems, asking politely on irc, #munin on freenode or oftc will often give you the help needed.

    • Danijel says:

      I have same issue, but symlink is there and it is excutable. When try cat that path it seams fine. What might be the problem?

      Can’t exec “/etc/munin/plugins/haproxy_ng”: No such file or directory at /usr/share/perl5/Munin/Node/Service.pm line 215.

    • landor says:

      You, like me, probably downloaded the file directly.
      You need to replace the @@PERL@@ on the first line of the file with the output of the command `which perl`

  5. Jeff says:

    I am a munin newbie, so maybe I am missing something basic. I installed and configured the plugin, and html pages for HAProxy get generated, but no images get generated (they are all broken links).

    When I run the plugin, this is what I see:

    # sudo -u munin munin-run haproxy_ng
    multigraph HAPActive

    multigraph HAPBandwidthBack

    multigraph HAPBandwidthFront

    multigraph HAPErrorsBack

    multigraph HAPErrorsFront

    multigraph HAPSessionsBack

    multigraph HAPSessionsFront

    multigraph HAPUptime

    How can I debug this problem and figure out why the images aren’t being generated?

    Thanks,
    Jeff

    • Jeff says:

      Nevermind, I figured it out. I had labeled the section in my /etc/munin/plugin-conf.d/munin-node file [haproxy] instead of [haproxy_ng]. It’s working now. Thanks for writing this plugin!

      • Trygve Vea says:

        Thanks!

        I’m glad you figured it out :)

        • Jeff says:

          Actually, the example at the top of the plugin source code says to use [haproxy_backend]. Is that correct? It seems to be working for me with [haproxy_ng]…

          • Trygve Vea says:

            It needs to be consistent with the plugin-name in /etc/munin/plugins, so you’ve spotted an error in the example there.

            [haproxy_ng] or [haproxy_*], etc. will work.

            I will fix the doc-error; Thanks again :)

  6. Gourav Joshi says:

    Thanks for a great plugin.
    Need to use this plugin for multiple instances on same server. Configured as below;

    [haproxy_client1_backend]
    env.url http://client1.example.com/haproxy-status;csv;norefresh
    env.username monitor
    env.password somepasswordorother

    [haproxy_client2_backend]
    env.url http://client2.example.com/haproxy-status;csv;norefresh
    env.username monitor
    env.password somepasswordorother

    Got few graphs working, but not all. And those I can see only after clicking headers, not on main pages. Most importantly frontend graphs for both instances not shown. It shows only one graph of the client1 which is 1st alphabetically.

    Can you please help me with your plugin to configure it for multiple instances.

    Thanks in Advance.
    Gourav

    • Trygve Vea says:

      The plugin isn’t written to split up different instances of itself like this. You can achieve this by using host_name in the config, and creating different sets of hosts in your munin overview.

      Or, the plugin needs to be patched. Which would probably be a bit of work, and not something I would be able to do anytime soon I’m afraid.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>