Changeset 37857c4c91096e325fa1d70b9d1ea78ab5c7f15d

Show
Ignore:
Timestamp:
03/23/07 22:08:36 (8 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1174687716 +0000
git-parent:

[ae5283c7e99faf2b995945c770a82f65747b3616]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1174687716 +0000
Message:

support PORT and INTERFACE in the config

git-svn-id: https://labs.omniti.com/resmon/trunk@34 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Config.pm

    rc43001e r37857c4  
    4141        next; 
    4242      } 
     43      elsif(/\S*PORT\s+(\d+)\s*;\s*/) { 
     44        $self->{port} = $1; 
     45        next; 
     46      } 
     47      elsif(/\S*INTERFACE\s+(\S+)\s*;\s*/) { 
     48        $self->{interface} = $1; 
     49        next; 
     50      } 
    4351      elsif(/\s*INTERVAL\s+(\d+)\s*;\s*/) { 
    4452        $self->{interval} = $1; 
  • resmon

    rae5283c r37857c4  
    3333  $config = Resmon::Config->new($config_file); 
    3434  $config->{statusfile} = $status_file if($status_file); 
     35  $config->{port} = $port if($port); 
     36  $config->{interface} = $interface if($interface); 
    3537} 
    3638 
     
    6466my $status = Resmon::Status->new($config->{statusfile}); 
    6567$status->open(); 
    66 $status->serve_http_on($interface, $port) if($port); 
     68$status->serve_http_on($config->{interface}, $config->{port}) 
     69  if($config->{port}); 
    6770 
    6871while(1) {