Changeset 515131ccfa898b2fde519d866813438739744647

Show
Ignore:
Timestamp:
10/05/09 21:44:04 (9 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1254779044 +0000
git-parent:

[b37d9231bd2b88061742c81de52aa2d5b1a74153]

git-author:
Mark Harrison <mark@omniti.com> 1254779044 +0000
Message:

Change the method of specifying a host to hostname/path/to/file

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

Files:

Legend:

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

    rb37d923 r515131c  
    77  my $arg = shift; 
    88  my $host; 
    9   my $object; 
    10   if ($arg->{'object'} =~ ';') { 
    11     # Specify the host in hostname:/path/to/file format, this method allows 
    12     # you to monitor the same file on multiple hosts 
    13     ($host, $file) = split /;/,$arg->{'object'},2; 
    14   } else { 
    15     # Specify host as a paramater. This method doesn't allow you to monitor 
    16     # the same file on multiple hosts 
    17     $host = $arg->{'host'}; 
    18     $file = $arg->{'object'}; 
    19   } 
     9  my $file; 
     10  # Specify the host in hostname/path/to/file format, this method allows 
     11  # you to monitor the same file on multiple hosts 
     12  ($host, $file) = $arg->{'object'} =~ /^([^\/]+)?(\/.*)$/; 
     13  # Specify host as a paramater. This method doesn't allow you to monitor 
     14  # the same file on multiple hosts 
     15  $host ||= $arg->{'host'}; 
    2016  my $output = cache_command("ssh -i /root/.ssh/id_dsa $host du -k $file", 600); 
    2117  $output =~ /^(\d+)\s/;