mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add dpkg lister script for unix agent
git-svn-id: http://www.observium.org/svn/observer/trunk@2929 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -457,6 +457,15 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
|
||||
}
|
||||
?>
|
||||
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'packages'))); ?>" class="drop"><img src="images/16/box.png" border="0" align="absmiddle" /> Packages</a>
|
||||
<div class="dropdown_1column">
|
||||
<div class="col_1">
|
||||
<ul>
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'packages'))); ?>"><img src="images/16/box.png" border="0" align="absmiddle" /> All Packages</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="menu_right"><a href="#" class="drop"><img src="images/16/wrench.png" border="0" align="absmiddle" /> System</a><!-- Begin Home Item -->
|
||||
|
||||
<div class="dropdown_3columns align_right"><!-- Begin 2 columns container -->
|
||||
@@ -492,12 +501,10 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
|
||||
<img src="images/icons/flags/be.png"> <strong>Tom Laermans</strong> Developer<br />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col_1">
|
||||
<h2>Settings</h2>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
if ($_SESSION['userlevel'] >= '10')
|
||||
{
|
||||
echo('
|
||||
|
19
scripts/agent-local/dpkg
Executable file
19
scripts/agent-local/dpkg
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Cache the file for 30 minutes
|
||||
# If you want to override this, put the command in cron.
|
||||
# We cache because it is a 1sec delay, which is painful for the poller
|
||||
if [ -x /usr/bin/dpkg-query ]; then
|
||||
DATE=$(date +%s)
|
||||
FILE=/tmp/observium-agent-dpkg
|
||||
if [ ! -e $FILE ]; then
|
||||
dpkg-query -W --showformat='${Package} ${Version} ${Architecture} ${Installed-Size}\n' > $FILE
|
||||
fi
|
||||
FILEMTIME=$(stat -c %Y $FILE)
|
||||
FILEAGE=$(($DATE-$FILEMTIME))
|
||||
if [ $FILEAGE -gt 1800 ]; then
|
||||
dpkg-query -W --showformat='${Package} ${Version} ${Architecture} ${Installed-Size}\n' > $FILE
|
||||
fi
|
||||
echo "<<<dpkg>>>"
|
||||
cat $FILE
|
||||
fi
|
||||
|
@@ -1,6 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Cache the file for 30 minutes
|
||||
# If you want to override this, put the command in cron.
|
||||
# We cache because it is a 1sec delay, which is painful for the poller
|
||||
if [ -x /bin/rpm ]; then
|
||||
DATE=$(date +%s)
|
||||
FILE=/tmp/observium-agent-rpm
|
||||
if [ ! -e $FILE ]; then
|
||||
/bin/rpm -q --all --queryformat '%{N} %{V} %{R} %{ARCH} %{SIZE}\n' > $FILE
|
||||
fi
|
||||
FILEMTIME=$(stat -c %Y $FILE)
|
||||
FILEAGE=$(($DATE-$FILEMTIME))
|
||||
if [ $FILEAGE -gt 1800 ]; then
|
||||
/bin/rpm -q --all --queryformat '%{N} %{V} %{R} %{ARCH} %{SIZE}\n' > $FILE
|
||||
fi
|
||||
echo "<<<rpm>>>"
|
||||
/bin/rpm -q --all --queryformat '%{N} %{V} %{R} %{ARCH} %{SIZE}\n'
|
||||
cat $FILE
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user