AlkantarClanX12
Current Path : /proc/self/root/lib64/nagios/plugins/nccustom/ |
Current File : //proc/self/root/lib64/nagios/plugins/nccustom/check_pem_worker.pl |
#!/usr/bin/perl BEGIN { push @INC, '/var/cpanel/perl5/lib'; } use strict; use warnings FATAL => 'all'; # UNCOMMENT if run from root !!! # use NcCustomHooks::SSL_PEM_GENERATOR; use Data::Dumper; # my $check_sample = NcCustomHooks::SSL_PEM_GENERATOR->get_check_file_path(); my $check_sample = '/tmp/pem_worker_test.tmp'; my %sample_info = (); ($sample_info{'dev'},$sample_info{'ino'},$sample_info{'mode'},$sample_info{'nlink'}, $sample_info{'uid'},$sample_info{'gid'},$sample_info{'rdev'},$sample_info{'size'},$sample_info{'atime'}, $sample_info{'mtime'},$sample_info{'ctime'},$sample_info{'blksize'}, $sample_info{'blocks'}) = stat("$check_sample") or print "Error: Can't open file $check_sample\n" and exit 2; my $time_now = time; my $treschold = 20; if (($time_now - $sample_info{'mtime'}) > $treschold){ print "Error: Check pem-queue-worker - file $check_sample is too old ! \n" and exit 2; } print "OK\n" and exit;