aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r--SiteSummary.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm
index b6b449a..c37871a 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -83,6 +83,29 @@ sub get_hostname {
}
#
+# Return the IP address on the primary network interface
+#
+sub get_primary_ip_address {
+ my $hostid = shift;
+ my $path = get_filepath_current($hostid, "/system/ifconfig-a");
+ # XXX Not implemented
+ my $ip;
+ if (open (FILE, $path)) {
+ while(<FILE>) {
+ chomp;
+ if (m/inet addr:(\S+)\s+/) {
+ $ip = $1;
+ last;
+ }
+ }
+ close(FILE);
+ return $ip;
+ } else {
+ return undef;
+ }
+}
+
+#
# Return Linux kernel version for the machines using Linux.
#
sub get_linux_kernel_ver {