![](http://habrastorage.org/getpro/habr/avatars/0dc/fd9/02b/0dcfd902b74a7a853e41abc42218b4a9.gif)
The smallest Habra-karmograf - for munin
![](https://habrastorage.org/getpro/habr/post_images/80b/f1b/017/80bf1b017c84ed42e92f0fdf56d87ae8.png)
So I wrote my tiny munin- plugin for Habr. If you don’t need it, then you won’t see anything interesting under the cut: a few lines of PHP, XML parsing by standard means - for everything about everything 10 minutes. The polling frequency is standard, once every 5 minutes.
Result
![](https://habrastorage.org/getpro/habr/post_images/c8d/ab6/958/c8dab6958a764bea2534c7c47bd76e6b.png)
Source code
Download: s.14.by/habracarma#!/usr/bin/php
1) && ($argv[1] == 'config'))
{
print("graph_title KarmaGraph $username
graph_category web
graph_vlabel #
karma.label Karma
rating.label Rating
");
exit();
}
$xml = new SimpleXMLElement(file_get_contents("http://habrahabr.ru/api/profile/$username/"));
print('karma.value ' . $xml->karma . "\n");
print('rating.value ' . $xml->rating . "\n");
?>
Installation
- Of course you need munin , almost any version.
- Put the plugin in / usr / share / munin / plugins /
- Specify the username inside the plugin. I did not begin to make it into a separate config - so only more work for everyone.
- Make a symlink on it in / etc / munin / plugins
- chmod a + x habracarma
- Restart munin-node
I hope someone will find it useful.