aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-nodes
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2008-06-11 22:25:08 +0000
committerPetter Reinholdtsen <pere@hungry.com>2008-06-11 22:25:08 +0000
commit6cf415a705f8a36383b99d645ec276ebbff08a2f (patch)
tree79bbfe27bcb33d320e8bcda34f864f96387324cf /sitesummary-nodes
parent83daba8c63a6c8be4f11a92377c2966b607e326e (diff)
downloadsitesummary-6cf415a705f8a36383b99d645ec276ebbff08a2f.tar.gz
sitesummary-6cf415a705f8a36383b99d645ec276ebbff08a2f.tar.bz2
sitesummary-6cf415a705f8a36383b99d645ec276ebbff08a2f.tar.xz
* Add usage information to sitesummary-nodes.
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-xsitesummary-nodes18
1 files changed, 16 insertions, 2 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes
index c5b2f70..b753a76 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -9,14 +9,28 @@ use warnings;
use SiteSummary;
use Getopt::Std;
+sub usage {
+ print <<EOF;
+Usage: $0 [-hmnw]
+
+ -h Show usage information
+ -m Generate munin configuration for all munin clients
+ -n Generate nagios configuration for all nagios clients
+ -w List all client DNS/IP-addresses and MAC addresses
+EOF
+}
+
my %opts;
-getopts("mnw", \%opts);
+getopts("hmnw", \%opts) || (usage(), exit(1));
my %hostnames;
for_all_hosts(\&handle_host);
-if ($opts{'m'}) {
+if ($opts{'h'}) {
+ usage();
+ exit 0;
+} elsif ($opts{'m'}) {
print_munin_list();
} elsif ($opts{'w'}) {
print_ip_hw_list();