aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r--SiteSummary.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm
index 944d964..054f78d 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -15,6 +15,7 @@ our @EXPORT = qw(
get_sitegroup
get_hostname
get_dns_address
+ get_macaddress
get_primary_macaddress
get_primary_ip_address
get_linux_kernel_ver
@@ -102,6 +103,26 @@ sub get_primary_ip_address {
}
#
+# Return all MAC addresses
+sub get_macaddress {
+ my $hostid = shift;
+ my $path = get_filepath_current($hostid, "/system/ifconfig-a");
+ if (open (FILE, $path)) {
+ my @macs;
+ while(<FILE>) {
+ chomp;
+ if (m/Link encap:Ethernet\s+HWaddr (\S+)\s+/) {
+ push(@macs, $1);
+ }
+ }
+ close(FILE);
+ return @macs;
+ } else {
+ return undef;
+ }
+}
+
+#
# Return the IP address on the primary network interface
#
sub get_primary_macaddress {