Changeset 05e72aab2592abb86657ba9c041689fc94c8bb23

Show
Ignore:
Timestamp:
03/25/10 15:22:52 (4 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1269530572 +0000
git-parent:

[a417f742bacb15ab9439a9a01f7f91ee3bd19e8b]

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

Change Sample.pm to use run_command instead of backticks

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

Files:

Legend:

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

    rbd4339d r05e72aa  
    55 
    66use base 'Resmon::Module'; 
     7 
     8use Resmon::ExtComm qw(run_command cache_command); 
    79 
    810=pod 
     
    9395    # This is an example of running an external command. There are much better 
    9496    # ways to get the current date. 
    95     my $date = `date +%d`
     97    my $date = run_command('date +%d')
    9698    chomp $date; 
     99 
     100    # Another example of running an external command: 
     101    # This command caches the output for 600 seconds. You should probably 
     102    # rely on the check interval rather than cache_command unless you have 
     103    # the same command being run on multiple checks. 
     104 
     105    # my $output = cache_command('some_command', 600); 
    97106 
    98107    return {