diff --git a/agent-local/dpkg b/agent-local/dpkg index 70917ba..e89e2a0 100755 --- a/agent-local/dpkg +++ b/agent-local/dpkg @@ -6,6 +6,8 @@ if [ -x /usr/bin/dpkg-query ]; then DATE=$(date +%s) FILE=/var/cache/librenms/agent-local-dpkg + [ -d /var/cache/librenms ] || mkdir -p /var/cache/librenms + if [ ! -e $FILE ]; then dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE fi