Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have inherited a Munin installation and I want to make a list of all the monitored hosts. Is there a command or other way to export a list of all monitored hosts to CSV or XML?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

It seems rather lame, but I find that

grep '^\[' /etc/munin/munin.conf

pulls out all the host entries, and nothing much else; you can slice-and-dice it with (eg) tr from there.

share|improve this answer
add comment

The easiest way is probably to look in <dbdir>/munin-update.stats (on RHEL and Debian, dbdir is /var/lib/munin). That file contains a line for each host that was checked in the last run. Each line is of the format:

UD|hypervisor;both;esxi1|4.25

There are three fields, separated by |s. "UD" stands for something like "update detail"; there's also a "UT" line with the total time it took to update everything, so you should probably grep '^UD' /var/lib/munin/munin-update.stats. The second field is the host and its categories, in the same format that /etc/munin/munin.conf has. The third field is the number of seconds it took to get the host's data.

This approach is a little better than grepping through /etc/munin/munin.conf directly for two reasons: Primarily because munin has include directives so it's possible that not all of your hosts are defined directly in the main config file; and secondly just because the file format is simpler, so it's easier to get data out of it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.