<p>This is under Debian wheezy with the Debmon packages.</p>

<pre><code># /usr/lib/nagios/plugins/check_apt
APT OK: 0 packages available for upgrade (0 critical updates). |available_upgrades=0;;;0 critical_updates=0;;;0

# su -c /usr/lib/nagios/plugins/check_apt -s /bin/sh - nagios
APT WARNING: 6 packages available for upgrade (0 critical updates). |available_upgrades=6;;;0 critical_updates=0;;;0
</code></pre>

<p>Related to the problem seems to be this:</p>

<pre><code># # apt-cache policy icinga2-bin
icinga2-bin:
  Installed: 2.1.1-1~debmon70+1
  Candidate: 2.1.1-1~debmon70+1
  Version table:
 *** 2.1.1-1~debmon70+1 0
        400 http://debmon.org/debmon/ debmon-wheezy/main amd64 Packages
        100 /var/lib/dpkg/status
     2.1.1-1~bpo70+1 0
        100 http://ftp.de.debian.org/debian/ wheezy-backports/main amd64 Packages
N: Ignoring file '20auto-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
</code></pre>

<p>Where:</p>

<pre><code># cat /etc/apt/preferences.d/debmon-pin-400 
# prefer Debian Packages over Debmon packages
# do not automatically update
Package:  *
Pin: release o=debmon.org
Pin-Priority: 400
</code></pre>

<p>I'm thinking that it's related to this, because there are 6 packages coming from the debmon Repository that have really similar versions in the backports repository.</p>

<p>However neither "apt-cache policy", nor "dpkg --compare-versions" seem to behave differently when run as the nagios user or root. So at this point I have no idea why check_apt behaves differently under the nagios user.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br><a href="https://github.com/monitoring-plugins/monitoring-plugins/issues/1294">Reply to this email on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFQl2SPHBMaVfI2KjCVG1c22Lzmohuq8ks5nGTT8gaJpZM4CySWy.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/monitoring-plugins/monitoring-plugins/issues/1294","name":"View Issue"}}</script>