Add webinterface support for IPMI poller

git-svn-id: http://www.observium.org/svn/observer/trunk@1766 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-12-20 12:26:26 +00:00
parent 6f4e5b5170
commit dacb3d2252
8 changed files with 94 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
<?php
$ipmi_hostname = mres($_POST['ipmi_hostname']);
$ipmi_username = mres($_POST['ipmi_username']);
$ipmi_password = mres($_POST['ipmi_password']);
#FIXME needs more sanity checking! and better feedback
if ($ipmi_hostname != '') { set_dev_attrib($device, 'ipmi_hostname', $ipmi_hostname); } else { del_dev_attrib($device, 'ipmi_hostname'); }
if ($ipmi_username != '') { set_dev_attrib($device, 'ipmi_username', $ipmi_username); } else { del_dev_attrib($device, 'ipmi_username'); }
if ($ipmi_password != '') { set_dev_attrib($device, 'ipmi_password', $ipmi_password); } else { del_dev_attrib($device, 'ipmi_password'); }
$update_message = "Device IPMI data updated.";
$updated = 1;
?>

View File

@@ -320,12 +320,12 @@ function humanspeed($speed)
function print_error($text)
{
echo('<table class="errorbox" cellpadding="3"><tr><td><img src="/images/15/exclamation.png" align="absmiddle">'.$text.'</td></tr></table>');
echo('<table class="errorbox" cellpadding="3"><tr><td><img src="/images/15/exclamation.png" align="absmiddle"> '.$text.'</td></tr></table>');
}
function print_message($text)
{
echo('<table class="messagebox" cellpadding="3"><tr><td><img src="/images/16/tick.png" align="absmiddle">'.$text.'</td></tr></table>');
echo('<table class="messagebox" cellpadding="3"><tr><td><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</td></tr></table>');
}
function devclass($device)