summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-09-18 01:13:16 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2005-09-18 01:13:16 +0000
commit8d46ed7f24c9f893a20508c5ed77a91a610becfb (patch)
treefa64d52a100582db8a6655feb3fb35343f214bc6
parent5785f053e1b95a619096fa2bc6bcb0c8911d8acf (diff)
Merge in came changes
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@17 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xnagios-check-apt-updates18
1 files changed, 13 insertions, 5 deletions
diff --git a/nagios-check-apt-updates b/nagios-check-apt-updates
index c1a58cd..4d11215 100755
--- a/nagios-check-apt-updates
+++ b/nagios-check-apt-updates
@@ -3,7 +3,7 @@
# nagios check for debian (security) updates,
# based on net-snmp glue to security updates via apt-get.
# Copyright (C) 2004 SILVER SERVER Gmbh
-# Copyright (C) 2004 Peter Palfrader
+# Copyright (C) 2004, 2005 Peter Palfrader
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
-my $VERSION = '0.0.1';
+my $VERSION = '0.0.3 - $Rev$';
my $APT = '/usr/bin/apt-get';
my $USE_SUDO = 1;
my $params;
@@ -50,10 +50,10 @@ if (!GetOptions (
'--warnifupdates' => \$params->{'warnifupdates'},
'--chroot=s' => $params->{'chroots'},
)) {
- die ("$PROGRAM_NAME: Usage: $PROGRAM_NAME [--help|--version] [--sudo|--nosudo] [--verbose]\n");
+ die ("Usage: $PROGRAM_NAME [--help|--version] [--sudo|--nosudo] [--verbose]\n");
};
if ($params->{'help'}) {
- print "$PROGRAM_NAME: Usage: $PROGRAM_NAME [--help|--version] [--sudo|--nosudo] [--verbose]\n";
+ print "Usage: $PROGRAM_NAME [--help|--version] [--sudo|--nosudo] [--verbose]\n";
print "Reports packages to upgrade, updating the list if necessary.\n";
print "\n";
print " --help Print this short help.\n";
@@ -62,13 +62,21 @@ if ($params->{'help'}) {
print " --nosudo Do not use sudo to call apt-get.\n";
print " --warnifupdates Exit with a WARNING status if any updates are available.\n";
print " --verbose Be a little verbose.\n";
+ print " --chroot=<path> Run check in path.\n";
+ print "\n";
+ print "Note that for --sudo (default) you will need entries in /etc/sudoers like these:\n";
+ print "nagios ALL=(ALL) NOPASSWD: /usr/bin/apt-get update\n";
+ print "nagios ALL=(ALL) NOPASSWD: /usr/bin/apt-get --simulate upgrade\n";
+ print "nagios ALL=(ALL) NOPASSWD: /usr/sbin/chroot /chroot-ia32 /usr/bin/apt-get update\n";
+ print "nagios ALL=(ALL) NOPASSWD: /usr/sbin/chroot /chroot-ia32 /usr/bin/apt-get --simulate upgrade\n";
+ print "\n";
exit (0);
};
if ($params->{'version'}) {
print "nagios-check-apt-updates $VERSION\n";
print "nagios check for availability of debian (security) updates\n";
print "Copyright (c) 2004 SILVER SERVER Gmbh\n";
- print "Copyright (c) 2004 Peter Palfrader <peter\@palfrader.org>\n";
+ print "Copyright (c) 2004,2005 Peter Palfrader <peter\@palfrader.org>\n";
exit (0);
};
if ($params->{'sudo'} && $params->{'nosudo'}) {