mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add power polling for non-ipmi, unfortunately ipoman supplies kwH used, not current wattage
git-svn-id: http://www.observium.org/svn/observer/trunk@2125 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -204,7 +204,7 @@ if ($deleted_ports) { echo('<li><a href="ports/deleted/"><img src="images/16/cro
|
||||
<?php
|
||||
|
||||
# FIXME does not check user permissions...
|
||||
$sql = "SELECT sensor_class,COUNT(sensor_id) AS c FROM sensors GROUP BY sensor_class";
|
||||
$sql = "SELECT sensor_class,COUNT(sensor_id) AS c FROM sensors GROUP BY sensor_class ORDER BY sensor_class ";
|
||||
$result = mysql_query($sql);
|
||||
while ($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
@@ -254,6 +254,7 @@ foreach (array('current','frequency','power','voltage') as $item)
|
||||
}
|
||||
}
|
||||
|
||||
# Show remaining/custom sensor types if there are any in the database
|
||||
if ($menu_sensors && $sep)
|
||||
{
|
||||
echo('<li><hr width="140" /></li>');
|
||||
|
@@ -24,12 +24,10 @@ if ($device['os'] == "ipoman")
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, "inletConfigCurrentHigh", $oids_in, "IPOMANII-MIB");
|
||||
echo("inletStatusCurrent ");
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, "inletStatusCurrent", $oids_in, "IPOMANII-MIB");
|
||||
// $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusKwatt", $oids_in, "IPOMANII-MIB"); // Not implemented yet in Obs?
|
||||
echo("outletConfigCurrentHigh ");
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, "outletConfigCurrentHigh", $oids_out, "IPOMANII-MIB");
|
||||
echo("outletStatusCurrent ");
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, "outletStatusCurrent", $oids_out, "IPOMANII-MIB");
|
||||
// $oids_out = snmpwalk_cache_multi_oid($device, "outletStatusKwatt", $oids_out, "IPOMANII-MIB"); // See above
|
||||
|
||||
if (is_array($oids_in))
|
||||
{
|
||||
|
12
includes/discovery/power.inc.php
Normal file
12
includes/discovery/power.inc.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
echo("Power: ");
|
||||
|
||||
include_dir("includes/discovery/power");
|
||||
|
||||
if ($debug) { print_r($valid['power']); }
|
||||
|
||||
check_valid_sensors($device, 'power', $valid_sensor);
|
||||
|
||||
echo("\n");
|
||||
|
||||
?>
|
@@ -13,6 +13,7 @@ include("includes/discovery/humidity.inc.php");
|
||||
include("includes/discovery/voltages.inc.php");
|
||||
include("includes/discovery/frequencies.inc.php");
|
||||
include("includes/discovery/current.inc.php");
|
||||
include("includes/discovery/power.inc.php");
|
||||
include("includes/discovery/fanspeeds.inc.php");
|
||||
|
||||
unset($valid_sensor);
|
||||
|
@@ -4,6 +4,7 @@ poll_sensor($device,'current','A');
|
||||
poll_sensor($device,'frequency', 'Hz');
|
||||
poll_sensor($device,'fanspeed', 'rpm');
|
||||
poll_sensor($device,'humidity', '%');
|
||||
poll_sensor($device,'power', 'W');
|
||||
#poll_sensor($device,'voltage', 'V');
|
||||
|
||||
# FIXME voltages have other filenames
|
||||
|
Reference in New Issue
Block a user