| 1 | rodolico | 1 | # Configuration file for process_sysinfo system
 | 
        
           |  |  | 2 | #
 | 
        
           |  |  | 3 | #
 | 
        
           |  |  | 4 | #
 | 
        
           |  |  | 5 |   | 
        
           |  |  | 6 | # where are our libraries?
 | 
        
           |  |  | 7 |   | 
        
           |  |  | 8 | $LIBRARIES = '/home/rodolico/wip/dd_tools/web/computer_asset_manager/modules/sysinfo/cli_tools';
 | 
        
           |  |  | 9 | $DSN = 'DBI:mysql:camp';
 | 
        
           |  |  | 10 | $DB_USER = 'test';
 | 
        
           |  |  | 11 | $DB_PASS = 'test';
 | 
        
           |  |  | 12 |   | 
        
           |  |  | 13 | # only required if reports are sent from process_sysinfo. Not the norm.
 | 
        
           |  |  | 14 | $iMailResults = 0; # if 0 (false), ignore following variables
 | 
        
           |  |  | 15 | $mailTo = 'rod@dailydata.net';
 | 
        
           |  |  | 16 | $mailCC = '';
 | 
        
           |  |  | 17 | $mailBCC = '';
 | 
        
           |  |  | 18 | $mailServer = 'mail.dailydata.net';
 | 
        
           |  |  | 19 | $mailServerPort = 25;
 | 
        
           |  |  | 20 | $mailFrom = 'sysinfo@dailydata.net';
 | 
        
           |  |  | 21 | $SENDMAIL = '/usr/sbin/sendmail -tU';
 | 
        
           |  |  | 22 |   | 
        
           |  |  | 23 | $DiskUsageAlert = 0.90; # will generate a warning if any disk has more than this percent capacity used
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 |   | 
        
           |  |  | 26 | # where postProcess puts processed reports by default
 | 
        
           |  |  | 27 | $saveDir='/home/rodolico/wip/dd_tools/web/computer_asset_manager/modules/sysinfo/cli_tools/save';
 | 
        
           |  |  | 28 | # Tagets to search for incoming messages, if not passed on the command line
 | 
        
           |  |  | 29 | @mailDir=('/home/rodolico/wip/dd_tools/web/computer_asset_manager/modules/sysinfo/cli_tools/test_data');
 | 
        
           |  |  | 30 | # anonymous subroutine that determines where the sysinfo executable is, ie checks for it in the current path
 | 
        
           |  |  | 31 | $SYSINFO= eval{
 | 
        
           |  |  | 32 |                      use File::Basename;
 | 
        
           |  |  | 33 |                      use Cwd qw(realpath);
 | 
        
           |  |  | 34 |                      my $path = realpath($0); # get my real path. $0 is current program, realpath calculates the true path to it
 | 
        
           |  |  | 35 |                      my($filename, $directories, $suffix) = fileparse($path,('.pl')); # break filename apart
 | 
        
           |  |  | 36 |                      "$directories/process_sysinfo";
 | 
        
           |  |  | 37 |                   };
 | 
        
           |  |  | 38 | #$SYSINFO='/root/bin/process_sysinfo';
 | 
        
           |  |  | 39 |   | 
        
           |  |  | 40 | # this sub is placed in the configuration file as it is the most likely piece of code
 | 
        
           |  |  | 41 | # the sysadmin will want to modify.
 | 
        
           |  |  | 42 | # after a report has been modified, this routine will "post process" it.
 | 
        
           |  |  | 43 | # The default action is to move it to the directory defined in $saveDir above, however
 | 
        
           |  |  | 44 | # feel free to modify this to your needs. You might add it to a tgz, move it to a separate
 | 
        
           |  |  | 45 | # directory or, if you're feeling brave, just delete it.
 | 
        
           |  |  | 46 | sub postProcess {
 | 
        
           |  |  | 47 |    my $filename = shift;
 | 
        
           |  |  | 48 |    `mv $filename $saveDir`;
 | 
        
           |  |  | 49 | }
 |