preliminary support for unix agent. probably will eat your cat and rape your dog, at this point.

git-svn-id: http://www.observium.org/svn/observer/trunk@2923 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-03-26 09:37:55 +00:00
parent b86abdba7c
commit 98ffa46ea0
6 changed files with 223 additions and 0 deletions
+9
View File
@@ -215,6 +215,15 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
</li>');
}
if ($config['poller_modules']['unix-agent'] && @dbFetchCell("SELECT COUNT(*) FROM `packages` WHERE device_id = '".$device['device_id']."'") > '0')
{
echo('<li class="' . $select['packages'] . '">
<a href="'.generate_device_url($device, array('tab' => 'packages')).'">
<img src="images/16/box.png" align="absmiddle" border="0" /> Packages
</a>
</li>');
}
if ($config['enable_inventory'] && @dbFetchCell("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."'") > '0')
{
echo('<li class="' . $select['entphysical'] . '">
+27
View File
@@ -0,0 +1,27 @@
<?php
echo('<table cellspacing="0" cellpadding="5" width="100%">');
$i=0;
foreach (dbFetchRows("SELECT * FROM `packages` WHERE `device_id` = ? ORDER BY `name`", array($device['device_id'])) as $entry)
{
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr bgcolor=$row_colour>");
echo('<td width=200><a href="'. generate_url($vars, array('name' => $entry['name'])).'">'.$entry['name'].'</a></td>');
echo("<td>".$entry['version']."-".$entry['build']."</td>");
echo("<td>".$entry['arch']."</td>");
echo("<td>".$entry['manager']."</td>");
echo("<td>".format_si($entry['size'])."</td>");
echo("</tr>");
$i++;
}
echo("</table>");
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
foreach ($vars as $var => $value)
{
if ($value != "")
{
switch ($var)
{
case 'name':
$where .= " AND `$var` LIKE ?";
$param[] = "%".$value."%";
break;
}
}
}
echo('<table cellspacing="0" cellpadding="5" width="100%">');
$i=0;
foreach (dbFetchRows("SELECT * FROM `packages` WHERE 1 $where GROUP BY `name`", $param) as $entry)
{
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr bgcolor=$row_colour>");
echo('<td width=200><a href="'. generate_url($vars, array('name' => $entry['name'])).'">'.$entry['name'].'</a></td>');
echo("<td>");
foreach (dbFetchRows("SELECT * FROM `packages` WHERE `name` = ? ORDER BY version, build", array($entry['name'])) as $entry_v)
{
$entry['blah'][$entry_v['version']][$entry_v['build']][$entry_v['device_id']] = 1;
}
foreach ($entry['blah'] as $version => $bleu)
{
$content = '<div style="width: 800px;">';
foreach ($bleu as $build => $bloo)
{
$content .= '<div style="background-color: #eeeeee; margin: 5px;"><span style="font-weight: bold; ">'.$version.'-'.$build.'</span>';
foreach ($bloo as $device_id => $no)
{
$this_device = device_by_id_cache($device_id);
$content .= '<span style="background-color: #f5f5f5; margin: 5px;">'.$this_device['hostname'].'</span> ';
}
$content .= "</div>";
}
$content .= "</div>";
echo("<span style='margin:5px;'>".overlib_link("", $version, $content, NULL)."</span>");
}
echo("<td>");
echo("</tr>");
$i++;
}
echo("</table>");
?>