Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 142 Rev 144
Line 173... Line 173...
173
# 2 - Gives ending information on structures
173
# 2 - Gives ending information on structures
174
# 3 - Gives a lot of info about structures when they are initialized and at the end
174
# 3 - Gives a lot of info about structures when they are initialized and at the end
175
# 4 - Crazy. Dumps just about every structure every time they are changed
175
# 4 - Crazy. Dumps just about every structure every time they are changed
176
#
176
#
177
# $TESTING has been set to a binary. If true, the report is not sent via the transports, but is dumped to /tmp/sysinfo.testing.yaml
177
# $TESTING has been set to a binary. If true, the report is not sent via the transports, but is dumped to /tmp/sysinfo.testing.yaml
-
 
178
#
-
 
179
# Version 3.4.1 20191117 RWR
-
 
180
# Added syslog as a possible option for logging.
-
 
181
#
178
   
182
   
179
 
183
 
180
# find our location and use it for searching for libraries
184
# find our location and use it for searching for libraries
181
BEGIN {
185
BEGIN {
182
   use FindBin;
186
   use FindBin;
Line 189... Line 193...
189
 
193
 
190
# Following are global variables overridden if configuration file exists
194
# Following are global variables overridden if configuration file exists
191
 
195
 
192
my $TESTING = 0; # if set to 1, will do everything, but will dump output to /tmp/sysinfo.testing.yaml
196
my $TESTING = 0; # if set to 1, will do everything, but will dump output to /tmp/sysinfo.testing.yaml
193
 
197
 
194
our $VERSION = '3.4.0';
198
our $VERSION = '3.4.1';
195
 
199
 
196
my $indentLevel = 2; # number of spaces to indent per level in XML or YAML
200
my $indentLevel = 2; # number of spaces to indent per level in XML or YAML
197
 
201
 
198
# paths to search for configuration file
202
# paths to search for configuration file
199
my @confFileSearchPath = ( '.', '/etc/camp/sysinfo-client', '/etc/camp', '/usr/local/etc/camp/sysinfo-client' );
203
my @confFileSearchPath = ( '.', '/etc/camp/sysinfo-client', '/etc/camp', '/usr/local/etc/camp/sysinfo-client' );
Line 256... Line 260...
256
         while ( my $t = shift ) {
260
         while ( my $t = shift ) {
257
            print LOG &timeStamp() . "\t$t\n";
261
            print LOG &timeStamp() . "\t$t\n";
258
         }
262
         }
259
         close LOG;
263
         close LOG;
260
      }
264
      }
-
 
265
   } elsif ( $configuration{'logging'}{'log type'} eq 'syslog' ) {
-
 
266
      use Sys::Syslog;                        # all except setlogsock()
-
 
267
      use Sys::Syslog qw(:standard :macros);  # standard functions & macros
-
 
268
 
-
 
269
      my $syslogName = 'sysinfo-client';
-
 
270
      my $logopt = 'nofatal';
-
 
271
      my $facility = 'LOG_LOCAL0';
-
 
272
      my $priority = 'LOG_NOTICE';
-
 
273
 
-
 
274
      openlog( $syslogName, $logopt, $facility);
-
 
275
      syslog($priority, '%s', @_ );
-
 
276
      closelog();
261
   } else {
277
   } else {
262
      warn "Log type $configuration{'logging'} incorrectly configured\n";
278
      warn "Log type $configuration{'logging'} incorrectly configured\n";
263
      return 0;
279
      return 0;
264
   }
280
   }
265
   return 1;
281
   return 1;