-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://www.observium.org/svn/observer/trunk@2398 61d68cd4-352d-0410-923a-c4978735b2b8
- Loading branch information
adama
committed
Aug 14, 2011
1 parent
336c9d1
commit 3c25c58
Showing
5 changed files
with
3,897 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
global $valid_sensor; | ||
|
||
// blindly copied from sentry3 | ||
|
||
if ($device['os'] == 'raritan') | ||
{ | ||
$divisor = "1000"; | ||
$outlet_divisor = $divisor; | ||
$multiplier = "1"; | ||
|
||
################################# | ||
# Check for per-outlet polling | ||
$outlet_oids = snmp_walk($device, "outletIndex", "-Osqn", "PDU-MIB"); | ||
$outlet_oids = trim($outlet_oids); | ||
|
||
if ($outlet_oids) echo("PDU Outlet "); | ||
foreach (explode("\n", $outlet_oids) as $outlet_data) | ||
{ | ||
$outlet_data = trim($outlet_data); | ||
if ($outlet_data) | ||
{ | ||
list($outlet_oid,$outlet_descr) = explode(" ", $outlet_data,2); | ||
$outlet_split_oid = explode('.',$outlet_oid); | ||
$outlet_index = $outlet_split_oid[count($outlet_split_oid)-1]; | ||
|
||
$outletsuffix = "$outlet_index"; | ||
$outlet_insert_index=$outlet_index; | ||
|
||
#outletLoadValue: "A non-negative value indicates the measured load in milli Amps" | ||
$outlet_oid = ".1.3.6.1.4.1.13742.4.1.2.2.1.4.$outletsuffix"; | ||
$outlet_descr = snmp_get($device,"outletLabel.$outletsuffix", "-Ovq", "PDU-MIB"); | ||
$outlet_low_warn_limit = NULL; | ||
$outlet_low_limit = NULL; | ||
$outlet_high_warn_limit = snmp_get($device,"outletCurrentUpperWarning.$outletsuffix", "-Ovq", "PDU-MIB") / $outlet_divisor; | ||
$outlet_high_limit = snmp_get($device,"outletCurrentUpperCritical.$outletsuffix", "-Ovq", "PDU-MIB") / $outlet_divisor; | ||
$outlet_current = snmp_get($device,"outletCurrent.$outletsuffix", "-Ovq", "PDU-MIB") / $outlet_divisor; | ||
|
||
if ($outlet_current >= 0) { | ||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current); | ||
} | ||
} // if ($outlet_data) | ||
|
||
// unset($outlet_data); | ||
// unset($outlet_oids); | ||
// unset($outlet_oid); | ||
// unset($outlet_descr); | ||
// unset($outlet_low_warn_limit); | ||
// unset($outlet_low_limit); | ||
// unset($outlet_high_warn_limit); | ||
// unset($outlet_high_limit); | ||
// unset($outlet_current); | ||
|
||
} // foreach (explode("\n", $outlet_oids) as $outlet_data) | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
if (!$os) | ||
{ | ||
if (strstr($sysDescr, "Raritan")) { $os = "raritan"; } | ||
} | ||
|
||
?> | ||
<?php | ||
|
||
if (!$os) | ||
{ | ||
if (strstr($sysDescr, "Raritan")) { $os = "raritan"; } | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.