README.md 3.86 KB
Newer Older
1
2
# NAME

3
debrepo-version-check - Test if Debian package versions in local repo are up-to-date
4
5
6

# USAGE

7
debrepo-version-check list
8

9
debrepo-version-check check <package\_name1>\[,<package\_name2>,...\]
10

11
debrepo-version-check --help
12

13
debrepo-version-check --manual
14
15
16

# DESCRIPTION

17
Given the name of a Debian package **debrepo-version-check** compares the
Adam Lewenberg's avatar
Adam Lewenberg committed
18
19
20
21
22
upstream package version with the local package version. If the local
version is not at least as large as the upstream version the test fails
and sends the usual Test::More output to standard output, and (optionally)
an alert will be sent to the Nagios servers specified with the
**--nagios-servers** option.
23
24
25

The local package version is derived by looking for the package in the
Debian repository specified by the **--local-repo-url** URL; if this option
Adam Lewenberg's avatar
Adam Lewenberg committed
26
is not supplied, a default of _http://debian.stanford.edu/debian-stanford_
27
28
is used.

29
**debrepo-version-check** can only do checks against a limited number of
Adam Lewenberg's avatar
Adam Lewenberg committed
30
packages; use the **list** action to see those packages that
31
32
**debrepo-version-check** can check. Attempting to check a package that
**debrepo-version-check** does not know about will result in an error.
Adam Lewenberg's avatar
Adam Lewenberg committed
33

34
35
36
37
# REQUIRED ARGUMENTS

You need to supply an action, either "**list**" or "**check**".

Adam Lewenberg's avatar
Adam Lewenberg committed
38
39
# EXAMPLES

40
To see a list of packages supported by **debrepo-version-check**:
Adam Lewenberg's avatar
Adam Lewenberg committed
41

42
     $ debrepo-version-check list
Adam Lewenberg's avatar
Adam Lewenberg committed
43
44
45
46

To check that the _terraform_ package in the local Debian repository is
at the same version as the upstream version:

47
     $ debrepo-version-check check terraform
Adam Lewenberg's avatar
Adam Lewenberg committed
48
49
50
51
52
53
54
     ok 1 - local version of terraform at least as large as upstream version
     1..1

To check that the _terraform_ package in the local Debian repository is
at the same version as the upstream version AND send the results to a
couple of Nagios servers:

55
     $ debrepo-version-check check terraform --nagios-servers 192.168.1.2,192.168.3.4
Adam Lewenberg's avatar
Adam Lewenberg committed
56

57
58
# ACTIONS

Adam Lewenberg's avatar
Adam Lewenberg committed
59
- _list_
60
61
62
63

    This action lists all the packages that debain-repo-watch can do tests
    against.

Adam Lewenberg's avatar
Adam Lewenberg committed
64
- _check_ _package\_name1,\[,package\_name2,...\]_
65
66

    To run checks use the **check** action. This action requires a second
Adam Lewenberg's avatar
Adam Lewenberg committed
67
68
69
    argument that is a comma-delimited list of package names. If all of the
    package checks success, when the script exits it will return 0, otherwise
    it will return with 1.
70
71
72
73
74
75
76
77
78
79
80

# OPTIONS

- **-h|--help**

    Display the help screen.

- **-m|--manual**

    Display the man page.

Adam Lewenberg's avatar
Adam Lewenberg committed
81
82
83
84
85
86
- **--local-repo-url** _URL of local Debian repository_

    Specify the URL to the local Debian repository to check against. If this
    option is omitted then _http://debian.stanford.edu/debian-stanford_ will
    be used.

Adam Lewenberg's avatar
Adam Lewenberg committed
87
- **--nagios-server** _server1\[,server2,...\]_
88
89
90
91
92
93
94
95
96

    A comma-delimited list of server addresses or hostnames. Each test result
    will be sent to these servers as a Nagios passive alert. The Nagios test
    name used will be "package <package\_name> version". For example, if
    testing that the wallet-client package is up-to-date, the Nagios test name
    will be "package wallet-client version". The hostname sent in the passive
    alert will be "example.com" unless overridden by the **--nagios-hostname**
    option.

Adam Lewenberg's avatar
Adam Lewenberg committed
97
- **--nagios-hostname** _hostname_
98
99
100
101
102

    Nagios test results are associated with a host. By default, this script
    will use the hostname "example.com". If you want to override this, use the
    **--nagios-hostname** option.

Adam Lewenberg's avatar
Adam Lewenberg committed
103
- **--test-name-override** _test-name_
104
105

    The name of the test sent to Nagios is normally "package <package\_name>
Adam Lewenberg's avatar
Adam Lewenberg committed
106
    version". If you want to change this, use the **--test-name-override**
107
108
109
110
    option. Note that if you use this option, then the test name sent will be
    the same for all packages checked, so this option is only useful when
    checking a single package.

Adam Lewenberg's avatar
Adam Lewenberg committed
111
112
113
114
115
- **-q|--quiet**

    Use this option to suppress all Test::More output. The exit code (0 or 1)
    will still be output as usual.

116
117
118
- **--verbose**

    Show more information during run.