aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2007-07-02 23:04:00 +0000
committerPetter Reinholdtsen <pere@hungry.com>2007-07-02 23:04:00 +0000
commitbd8862b6b69e4e72331ab4ac2f3dac851a288c14 (patch)
treed57ea3af359672f9f377202b25c67687e58ab04f
parent178079b26776121f68fcef4067648a9c90d264b9 (diff)
downloadsitesummary-bd8862b6b69e4e72331ab4ac2f3dac851a288c14.tar.gz
sitesummary-bd8862b6b69e4e72331ab4ac2f3dac851a288c14.tar.bz2
sitesummary-bd8862b6b69e4e72331ab4ac2f3dac851a288c14.tar.xz
* Add draft function is_munin_client() to sitesummary-nodes. It
should be used to only list the clients with the munin-node package installed in the munin configuration.
-rw-r--r--debian/changelog3
-rw-r--r--sitesummary-client.conf4
-rwxr-xr-xsitesummary-nodes9
3 files changed, 15 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index d5b3f3b..e804354 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ sitesummary (0.0.27) UNRELEASED; urgency=low
* Modify the client code to sleep for a random number of seconds
between 0 and 3600 to make sure all clients do not overload the
server.
+ * Add draft function is_munin_client() to sitesummary-nodes. It
+ should be used to only list the clients with the munin-node
+ package installed in the munin configuration.
-- Petter Reinholdtsen <pere@debian.org> Tue, 3 Jul 2007 00:49:14 +0200
diff --git a/sitesummary-client.conf b/sitesummary-client.conf
index 0d74905..563bf6d 100644
--- a/sitesummary-client.conf
+++ b/sitesummary-client.conf
@@ -3,3 +3,7 @@ serverurls="http://localhost/cgi-bin/sitesummary-collector.cgi"
fragdirs="/usr/lib/sitesummary/collect.d /etc/sitesummary/collect.d"
gpgencrypt=false
+
+# Random sleep between 0 and $runsleep seconds before running. 3600
+# is one hour.
+runsleep="3600"
diff --git a/sitesummary-nodes b/sitesummary-nodes
index 1c3b0df..8fd3478 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -25,7 +25,7 @@ if ($opts{'m'}) {
sub handle_host {
my $hostid = shift;
my $hostname = get_hostname($hostid);
- $hostnames{$hostname} = 1;
+ $hostnames{$hostname} = $hostid;
}
sub print_list {
@@ -34,8 +34,15 @@ sub print_list {
}
}
+sub is_munin_client {
+ my $hostid = shift;
+ # Should check debian/dpkg-l for 'ii *munin-node '
+ 1; # Assume all nodes are munin nodes for now
+}
+
sub print_munin_list {
for my $hostname (sort keys %hostnames) {
+ return unless (is_munin_client($hostnames{$hostname}));
# Using hostname as address, to avoid hardcoding IP addresses in
# the file. Might be an idea to fetch the IP address from