mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix dpkg so it really shows ALL installed packages
git-svn-id: http://www.observium.org/svn/observer/trunk@3132 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -7,12 +7,12 @@ if [ -x /usr/bin/dpkg-query ]; then
|
|||||||
FILE=/tmp/observium-agent-dpkg
|
FILE=/tmp/observium-agent-dpkg
|
||||||
|
|
||||||
if [ ! -e $FILE ]; then
|
if [ ! -e $FILE ]; then
|
||||||
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep "^install"|cut -d\ -f4- > $FILE
|
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE
|
||||||
fi
|
fi
|
||||||
FILEMTIME=$(stat -c %Y $FILE)
|
FILEMTIME=$(stat -c %Y $FILE)
|
||||||
FILEAGE=$(($DATE-$FILEMTIME))
|
FILEAGE=$(($DATE-$FILEMTIME))
|
||||||
if [ $FILEAGE -gt 1800 ]; then
|
if [ $FILEAGE -gt 1800 ]; then
|
||||||
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep "^install"|cut -d\ -f4- > $FILE
|
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE
|
||||||
fi
|
fi
|
||||||
echo "<<<dpkg>>>"
|
echo "<<<dpkg>>>"
|
||||||
cat $FILE
|
cat $FILE
|
||||||
|
|||||||
Reference in New Issue
Block a user