~ubuntu-branches/ubuntu/trusty/nagios-plugins-contrib/trusty-proposed

« back to all changes in this revision

Viewing changes to check_hpasm/check_hpasm-4.6.3.2/plugins-scripts/subst.in

  • Committer: Package Import Robot
  • Author(s): Bernd Zeimetz, Bernd Zeimetz, Jan Wagner, Evgeni Golov
  • Date: 2013-06-14 20:53:49 UTC
  • Revision ID: package-import@ubuntu.com-20130614205349-34xiy38pm1hzpjoi
Tags: 7.20130614
[ Bernd Zeimetz ]
* [036816ff] Merge pull request #15 from evgeni/master
  check_packages should find security updates on the official security mirror too
* [658a2e93] Add check_checksums nagios plugin.
* [9d5d2056] Updating check_raid.
* [e3ec1293] Updating check_ssl_cert to 1.14.6
* [779543ef] Updating check_hpasm to 4.6.3.2
* [0c838ee9] Updating check_multipath to 0.1.9
* [bec11251] Updating check_whois to 1.13
* [8e0a65d0] Refreshing patches.
* [c0b88cdb] Auto update of debian/copyright
* [59648a17] Fix src link for check_hpasm
* [8c242d0f] Support pre-Wheezy versions of coretutils in check_checksums.
* [7d3d2a06] Update release date in changelog (gah!).
* [768e463b] Merge pull request #16 from evgeni/master
  check_libs: ignore /var/lib/postgresql/ and /var/log/
* [2b9aace5] Bumping standards-Verison, no changes needed.

[ Jan Wagner ]
* [3bb873e4] disable epn for check_rbl

[ Evgeni Golov ]
* [2a7ab4b8] check_libs: ignore /var/spool/

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/awk
 
2
 
 
3
function which(c,path) {
 
4
        cmd = "test -x " c;
 
5
 
 
6
        if (system(cmd)==0) {
 
7
                return c;
 
8
        } 
 
9
 
 
10
        sub(/\/.*\//,"",c);
 
11
  for (dir in path) {
 
12
                        cmd = "test -x " path[dir] "/" c;
 
13
                        if (system(cmd)==0) {
 
14
                                        return path[dir] "/" c;
 
15
                        } 
 
16
        }
 
17
 
 
18
 
 
19
        return c;
 
20
}
 
21
 
 
22
# used to replace "use lib utils.pm" with "use lib @libexecdir"
 
23
#
 
24
function led() {
 
25
        led1 = "@libexecdir@";
 
26
        led2 = "@exec_prefix@";
 
27
        led3 = "@prefix@";
 
28
        if ( match(led1, /^\$\{exec_prefix\}/ ) != 0 ) {
 
29
                return "\"" led3 "/libexec\" " ;
 
30
        
 
31
        }
 
32
        return "\"" led1 "\"" ;
 
33
}
 
34
 
 
35
BEGIN {
 
36
        split(ENVIRON["PATH"] ":/sbin:/usr/sbin",path,/:/);
 
37
 
 
38
}
 
39
 
 
40
# scripting language (first line)
 
41
 
 
42
/^#! ?\/.*\/python/ {sub(/^#! ?\/.*\/python/,"#! @PYTHON@");}
 
43
/^#! ?\/.*\/perl/ {sub(/^#! ?\/.*\/perl/,"#! @PERL@");}
 
44
/^#! ?\/.*\/[a-z]{0,2}awk/ {sub(/^#! ?\/.*\/[a-z]{0,2}awk/,"#! @AWK@");}
 
45
/^#! ?\/.*\/sh/ {sub(/^#! ?\/.*\/sh/,"#! @SHELL@");}
 
46
 
 
47
# add to libexecdir to INC for perl utils.pm
 
48
/^use/ { if (/lib/) { if (/utils.pm|"."/ ) {sub(/utils.pm|"."/,led() )} } }
 
49
 
 
50
 
 
51
# Replace the placeholders with the values from configure
 
52
/#PERL#/ {sub(/#PERL#/,"@PERL@");}
 
53
/my \$NOINSTLEVEL = 'unknown'/ {sub(/unknown/,"@NOINSTLEVEL@");}
 
54
/my \$CELSIUS = 1;/ {sub(/1/,"@CELSIUS@");}
 
55
/my \$PERFDATA = 1;/ {sub(/1/,"@PERFDATA@");}
 
56
/my \$EXTENDEDINFO = 1;/ {sub(/1/,"@EXTENDEDINFO@");}
 
57
/my \$HWINFO = 1;/ {sub(/1/,"@HWINFO@");}
 
58
/my \$HPACUCLI = 1;/ {sub(/1/,"@HPACUCLI@");}
 
59
/version => '.*',/ {sub(/'.*'/,"'@PACKAGE_VERSION@'");}
 
60
 
 
61
{
 
62
        print;
 
63
}
 
64