Donating Host DataRequired version: 1.1.6rc3
June 13. 2010
What all about?This time we need your help: some of your real monitoring data from your real hosts. Why? We want to create a public source of example monitoring data from real hosts. For that we need the output of the Check_MK agent of real hosts from as many different hardware and different operating systems as possible. And in order to provide live data, we need regular updates every five minutes. Using donated host dataThe donated data will be published on http://demo.mathias-kettner.de/donatehosts/. With that data it is possible create a test or demonstration monitoring system without touching any real target host and yet monitoring real time live data. All you have to do is to configure some of the hosts listed at that url into all_hosts in your main.mk and use HTTP to fetch the monitoring data. This can be done with the command line tool curl used as a datasource program. The following example shows a complete configuration for Check_MK doing some real monitoring: main.mk
# Select some of the donated hosts and tag them with 'http'
all_hosts = [
"abc123|http",
"xyz456|http",
]
# Fetch data via HTTP (make sure curl is installed)
datasource_programs = [
( "curl --silent http://demo.mathias-kettner.de/donatehosts/<HOST>",
[ "http" ], ALL_HOSTS )
]
# Set IP addresses to localhost, since they have to DNS names
ipaddresses = {
"abc123" : "127.0.0.1",
"xyz456" : "127.0.0.1",
}
# Set check interval for hosts to 5 minutes
extra_service_conf["check_interval"] = [
( "5", [ "http" ], ALL_HOSTS, [ "Check_MK$" ]),
]
Now make an inventory and let Check_MK do the rest of the work: root@linux# check_mk -I tcp root@linux# check_mk -O Donating Host DataJuristical pre-conditionsYou can help us and other Check_MK users by donating some of your host data. Before you do this, please make sure that:
And make sure you've understood that:
Technical pre-conditionsDonating data is done via Email. While other means such as HTTP surely have technical advantages over Email, the latter one is the easiest to get out through firewalls. And Nagios servers have a working email configuration in most cases anyway. Setting up Check_MKPlease first make sure that your monitoring server can send Emails to donatehosts@mathias-kettner.de via the command line utility mail. Important is using a correctly formatted sender address which some mail clients generate by using the option -r (e.g. mailx). Mail coming from root@localhost will be rejected by our server. As a next step, configure in your main.mk (or any other *.mk config file) which hosts you want to donate. This is done by the binary configuration list donation_hosts. The following example configures three hosts to donate: donation_hosts = [ ( [ "xsrv003", "winora12", "swi0017" ] ), ] If you now call check_mk --donate, Check_MK will:
The exact command for sending the email can be configured via donation_command in main.mk: the default value is: donation_command = 'mail -r checkmk@yoursite.de -s "Host donation %s" donatehosts@mathias-kettner.de' % check_mk_version The command is provided the Base64-encoded data on stdin. Your mail command does not need to handle attachments. A short time after that, your host data should appear on http://demo.mathias-kettner.de/donatehosts/. Make it regularSince monitoring implies live data, your last step is to make the upper command regular. We propose an interval of 5 minutes. Easiest way is to configure a cron-job: /etc/cron.d/check_mk_donate */5 * * * * nagios /usr/bin/check_mk --donate Data which is not updated regularily will automatically be removed from our server. So if you want to stop donating your data then just delete your cronjob. |
| ||||||||||||