Subversion Repositories camp_sysinfo_client_3

Rev

Rev 141 | Rev 144 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 141 Rev 142
Line 201... Line 201...
201
my $configurationFile = 'sysinfo-client.yaml'; # name of the configuration file
201
my $configurationFile = 'sysinfo-client.yaml'; # name of the configuration file
202
 
202
 
203
my $reportDate = &timeStamp(); # set report date
203
my $reportDate = &timeStamp(); # set report date
204
 
204
 
205
my %configuration = (
205
my %configuration = (
206
   'logging' => ( 'log type' => 'cache' ),    # if set, will point to logging
206
   'logging' => { 'log type' => 'cache', 'log level' => 0 },    # if set, will point to logging
207
   'moduleDirs' => [], # search paths for modules
207
   'moduleDirs' => [], # search paths for modules
208
   'scriptDirs' => [], # search paths for scripts
208
   'scriptDirs' => [], # search paths for scripts
209
   'clientName' => '',  # Required!! Must be set in conf file (no defaults)
209
   'clientName' => '',  # Required!! Must be set in conf file (no defaults)
210
   'serialNumber' => '', # serial number of machine
210
   'serialNumber' => '', # serial number of machine
211
   'UUID'         => '', # UUID of machine
211
   'UUID'         => '', # UUID of machine
Line 224... Line 224...
224
# return current system date as YYYY-MM-DD HH:MM:SS
224
# return current system date as YYYY-MM-DD HH:MM:SS
225
#
225
#
226
#######################################################
226
#######################################################
227
sub timeStamp {
227
sub timeStamp {
228
   my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
228
   my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
229
   return sprintf "%4d-%02d-%02d %02d:%02d:%02d\n",$year+1900,$mon+1,$mday,$hour,$min,$sec;
229
   return sprintf "%4d-%02d-%02d %02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec;
230
}
230
}
231
   
231
   
232
#######################################################
232
#######################################################
233
# function to simply log things
233
# function to simply log things
234
# first parameter is the priority, if <= $logDef->{'log level'} will print
234
# first parameter is the priority, if <= $logDef->{'log level'} will print