summaryrefslogtreecommitdiffstats
path: root/plugins/check_apt.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_apt.c')
-rw-r--r--plugins/check_apt.c80
1 files changed, 39 insertions, 41 deletions
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index 2de8e77..902b455 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -30,9 +30,9 @@
30* You should have received a copy of the GNU General Public License 30* You should have received a copy of the GNU General Public License
31* along with this program; if not, write to the Free Software 31* along with this program; if not, write to the Free Software
32* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 32* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 33*
34 $Id$ 34* $Id$
35 35*
36******************************************************************************/ 36******************************************************************************/
37 37
38const char *progname = "check_apt"; 38const char *progname = "check_apt";
@@ -115,7 +115,7 @@ int main (int argc, char **argv) {
115 result = max_state(result, STATE_OK); 115 result = max_state(result, STATE_OK);
116 } 116 }
117 117
118 printf("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n", 118 printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"),
119 state_text(result), 119 state_text(result),
120 packages_available, 120 packages_available,
121 (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", 121 (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade",
@@ -228,21 +228,21 @@ int run_upgrade(int *pkgcount, int *secpkgcount){
228 regres=regcomp(&ireg, include_ptr, REG_EXTENDED); 228 regres=regcomp(&ireg, include_ptr, REG_EXTENDED);
229 if(regres!=0) { 229 if(regres!=0) {
230 regerror(regres, &ireg, rerrbuf, 64); 230 regerror(regres, &ireg, rerrbuf, 64);
231 die(STATE_UNKNOWN, "%s: Error compiling regexp: %s", progname, rerrbuf); 231 die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"), progname, rerrbuf);
232 } 232 }
233 233
234 if(do_exclude!=NULL){ 234 if(do_exclude!=NULL){
235 regres=regcomp(&ereg, do_exclude, REG_EXTENDED); 235 regres=regcomp(&ereg, do_exclude, REG_EXTENDED);
236 if(regres!=0) { 236 if(regres!=0) {
237 regerror(regres, &ereg, rerrbuf, 64); 237 regerror(regres, &ereg, rerrbuf, 64);
238 die(STATE_UNKNOWN, "%s: Error compiling regexp: %s", 238 die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"),
239 progname, rerrbuf); 239 progname, rerrbuf);
240 } 240 }
241 } 241 }
242 regres=regcomp(&sreg, crit_ptr, REG_EXTENDED); 242 regres=regcomp(&sreg, crit_ptr, REG_EXTENDED);
243 if(regres!=0) { 243 if(regres!=0) {
244 regerror(regres, &ereg, rerrbuf, 64); 244 regerror(regres, &ereg, rerrbuf, 64);
245 die(STATE_UNKNOWN, "%s: Error compiling regexp: %s", 245 die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"),
246 progname, rerrbuf); 246 progname, rerrbuf);
247 } 247 }
248 248
@@ -255,7 +255,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){
255 if(result != 0){ 255 if(result != 0){
256 exec_warning=1; 256 exec_warning=1;
257 result = STATE_UNKNOWN; 257 result = STATE_UNKNOWN;
258 fprintf(stderr, "'%s' exited with non-zero status.\n", 258 fprintf(stderr, _("'%s' exited with non-zero status.\n"),
259 cmdline); 259 cmdline);
260 } 260 }
261 261
@@ -324,7 +324,7 @@ int run_update(void){
324 if(result != 0){ 324 if(result != 0){
325 exec_warning=1; 325 exec_warning=1;
326 result = STATE_CRITICAL; 326 result = STATE_CRITICAL;
327 fprintf(stderr, "'%s' exited with non-zero status.\n", 327 fprintf(stderr, _("'%s' exited with non-zero status.\n"),
328 cmdline); 328 cmdline);
329 } 329 }
330 330
@@ -419,38 +419,36 @@ print_help (void)
419 419
420 printf(_(UT_TIMEOUT), timeout_interval); 420 printf(_(UT_TIMEOUT), timeout_interval);
421 421
422 printf(_("\n\ 422 printf (" %s\n", "-U, --upgrade=OPTS");
423 -U, --upgrade=OPTS\n\ 423 printf (" %s\n", _("[Default] Perform an upgrade. If an optional OPTS argument is provided,"));
424 [Default] Perform an upgrade. If an optional OPTS argument is provided,\n\ 424 printf (" %s\n", _("apt-get will be run with these command line options instead of the"));
425 apt-get will be run with these command line options instead of the\n\ 425 printf (" %s", _("default "));
426 default (%s).\n\ 426 printf ("(%s).\n", UPGRADE_DEFAULT_OPTS);
427 Note that you may be required to have root privileges if you do not use\n\ 427 printf (" %s\n", _("Note that you may be required to have root privileges if you do not use"));
428 the default options.\n\ 428 printf (" %s\n", _("the default options."));
429 -d, --dist-upgrade=OPTS\n\ 429 printf (" %s\n", "-d, --dist-upgrade=OPTS");
430 Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS\n\ 430 printf (" %s\n", _("Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS"));
431 can be provided to override the default options.\n\ 431 printf (" %s\n", _("can be provided to override the default options."));
432 -n, --no-upgrade\n\ 432 printf (" %s\n", " -n, --no-upgrade");
433 Do not run the upgrade. Probably not useful (without -u at least).\n\ 433 printf (" %s\n", _("Do not run the upgrade. Probably not useful (without -u at least)."));
434 -i, --include=REGEXP\n\ 434 printf (" %s\n", "-i, --include=REGEXP");
435 Include only packages matching REGEXP. Can be specified multiple times;\n\ 435 printf (" %s\n", _("Include only packages matching REGEXP. Can be specified multiple times"));
436 the values will be combined together. Any patches matching this list\n\ 436 printf (" %s\n", _("the values will be combined together. Any patches matching this list"));
437 cause the plugin to return WARNING status. Others will be ignored.\n\ 437 printf (" %s\n", _("cause the plugin to return WARNING status. Others will be ignored."));
438 Default is to include all packages.\n\ 438 printf (" %s\n", _("Default is to include all packages."));
439 -e, --exclude=REGEXP\n\ 439 printf (" %s\n", "-e, --exclude=REGEXP");
440 Exclude packages matching REGEXP from the list of packages that would\n\ 440 printf (" %s\n", _("Exclude packages matching REGEXP from the list of packages that would"));
441 otherwise be included. Can be specified multiple times; the values\n\ 441 printf (" %s\n", _("otherwise be included. Can be specified multiple times; the values"));
442 will be combined together. Default is to exclude no packages.\n\ 442 printf (" %s\n", _("will be combined together. Default is to exclude no packages."));
443 -c, --critical=REGEXP\n\ 443 printf (" %s\n", "-c, --critical=REGEXP");
444 If the full package information of any of the upgradable packages match\n\ 444 printf (" %s\n", _("If the full package information of any of the upgradable packages match"));
445 this REGEXP, the plugin will return CRITICAL status. Can be specified\n\ 445 printf (" %s\n", _("this REGEXP, the plugin will return CRITICAL status. Can be specified"));
446 multiple times like above. Default is a regexp matching security\n\ 446 printf (" %s\n", _("multiple times like above. Default is a regexp matching security"));
447 upgrades for Debian and Ubuntu:\n\ 447 printf (" %s\n", _("upgrades for Debian and Ubuntu:"));
448 \t%s\n\ 448 printf (" \t\%s\n", SECURITY_RE);
449 Note that the package must first match the include list before its\n\ 449 printf (" %s\n", _("Note that the package must first match the include list before its"));
450 information is compared against the critical list.\n\ 450 printf (" %s\n\n\n", _("information is compared against the critical list."));
451 \n\n"), 451
452 UPGRADE_DEFAULT_OPTS, SECURITY_RE);
453
454 printf ("%s\n\n", _("The following options require root privileges and should be used with care:")); 452 printf ("%s\n\n", _("The following options require root privileges and should be used with care:"));
455 printf (" %s\n", "-u, --update=OPTS"); 453 printf (" %s\n", "-u, --update=OPTS");
456 printf (" %s\n", _("First perform an 'apt-get update'. An optional OPTS parameter overrides")); 454 printf (" %s\n", _("First perform an 'apt-get update'. An optional OPTS parameter overrides"));