Wednesday, July 21, 2010

Munin-node Monitoring External Sources of Data, or Virtual Nodes Explained

It happened to me twice to write or to use plugins for munin-node which were not concerning directly the server where the node was installed on. The first one was a plugin using the SNMP interface of an UPS to check the temperature in our server room, and the other one a plugin returning the number of visitors on a forum, by downloading the page and finding the value with a regular expression.

As these plugins were installed on the monitoring machine, I had the temperature of the server room somewhere in between the available entropy and the load graphs on the monitoring machine. With the virtual nodes, I can create a virtual node called ServerRoom1, with for example two plugins, temperature and humidity. There is no physical machine called "ServerRoom1", so the munin-node installed on serverA will just tell me, while I fetches its nodes, which ones are for serverA and which one for ServerRoom1. This is what "config temperature" in a telnet session to my server will return:


config temperature
host_name ServerRoom1
[...]


As you can see, there is an additional line specifying the host name. For the other plugins, no host_name is defined, therefore it is assumed there are for the default node (the one you get the greeting from just after connecting with telnet, remember?). The nodes command will also return several nodes:


nodes
serverA
ServerRoom1
.



There are several ways to say to munin that a plugin is reporting data for a virtual node. The preferred method is the following; edit the file /etc/munin/plugin.conf.d/munin-node on the machine running the node:


serverA $ sudo vi /etc/munin/plugin-conf.d/munin-node

Find the section related to your plugin, or if you can not find it, add it at the end; if your plugin name is temperature, and the name you want to give to the virtual node is ServerRoom1, then add this:



[temperature]
host_name ServerRoom1


Remember to restart munin-node; you should now be able to check via telnet that the node on serverA is presenting two nodes.

You then need to configure munin on the monitoring server:


[ServerRoom1]
  address aaa.aaa.aaa.aaa
  use_node_name no



ServerRoom1 being the name of the virtualnode, and aaa.aaa.aaa.aaa the IP address of the server with the munin-node.
Save, wait 5 minutes, it should work :)


1 comment:

  1. I use Ideals virtual data room for my virtual data. This service has very good conditions for any companies. Especially for deals implementation it is very good.

    ReplyDelete