Debian Codegraph @

debian/patches/check_clamav/clamav_locations

raw
1 Index: pkg-nagios-plugins-contrib/check_clamav/check_clamav
2 ===================================================================
3 --- pkg-nagios-plugins-contrib.orig/check_clamav/check_clamav
4 +++ pkg-nagios-plugins-contrib/check_clamav/check_clamav
5 @@ -16,18 +16,18 @@
6 #
7 ################################################################################
8 # This script is used to compare the version and signature level of the
9 -# currently running clamd daemon with the latest available versions listed in
10 +# currently running clamscan daemon with the latest available versions listed in
11 # the TXT record for current.cvd.clamav.net.
12 #
13 # In order to use this script, you might need to make the following adjustments:
14 # - Set the "use lib" path correctly (where utils.pm is located.)
15 -# - Set the path to your clamd binary in $clamd_cmd.
16 +# - Set the path to your clamscan binary in $clamscan_cmd.
17 #
18 # This plugin requires the Net::DNS Perl module.
19 ################################################################################
20
21 # Plugin directory / home of utils.pm.
22 -use lib "/usr/local/libexec/nagios";
23 +use lib "/usr/lib/nagios/plugins";
24 use utils qw(%ERRORS &print_revision &support &usage);
25 use Getopt::Long qw(:config no_ignore_case bundling);
26 use File::Basename;
27 @@ -35,8 +35,8 @@ use Net::DNS;
28
29 use strict;
30
31 -# Path to installed clamd binary.
32 -my $clamd_cmd = "/usr/local/sbin/clamd";
33 +# Path to installed clamscan binary.
34 +my $clamscan_cmd = "/usr/bin/clamscan";
35
36 # Leave the rest of this alone:
37 my $prog_name = basename $0;
38 @@ -153,28 +153,28 @@ if ($vers_val != 0) {
39 }
40
41 # Make sure the binary exists.
42 -if (-x $clamd_cmd) {
43 - &print_debug("Found clamd at $clamd_cmd");
44 +if (-x $clamscan_cmd) {
45 + &print_debug("Found clamscan at $clamscan_cmd");
46 } else {
47 - &print_debug("Can't execute clamd at $clamd_cmd");
48 - die("FATAL: Unable to execute $clamd_cmd");
49 + &print_debug("Can't execute clamscan at $clamscan_cmd");
50 + die("FATAL: Unable to execute $clamscan_cmd");
51 }
52
53 &print_debug("Threshhold values: warning=$warn_val, critical=$crit_val");
54
55 # Should return something like: ClamAV 0.87.1/1205/Wed Dec 7 07:00:48 2005
56 -chomp(my $clamd_ver = `$clamd_cmd -V`);
57 +chomp(my $clamscan_ver = `$clamscan_cmd -V`);
58
59 # Should return something like: 0.87.1:34:1206:1134072033:1
60 chomp(my $dnstxt_ver = &lookup_current());
61
62 -# Parse what we get from clamd -V and our DNS query
63 -my @clamdresults = split(/\//,$clamd_ver);
64 +# Parse what we get from clamscan -V and our DNS query
65 +my @clamscanresults = split(/\//,$clamscan_ver);
66 my @txtresults = split(/:/,$dnstxt_ver);
67
68 # Get the currently running ClamAV sig level and cvd date out of this
69 -my $local_latest_daily = $clamdresults[1];
70 -my $local_latest_date = $clamdresults[2];
71 +my $local_latest_daily = $clamscanresults[1];
72 +my $local_latest_date = $clamscanresults[2];
73
74 &print_debug("Local daily.cvd dated $local_latest_date");
75 &print_debug("Local daily.cvd version = $local_latest_daily");