aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-nodes
diff options
context:
space:
mode:
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();