Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional UPS #1381

Merged
merged 3 commits into from Jul 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions includes/defaults.inc.php
Expand Up @@ -575,6 +575,7 @@
$config['modules_compat']['rfc1628']['poweralert'] = 1;
$config['modules_compat']['rfc1628']['multimatic'] = 1;
$config['modules_compat']['rfc1628']['webpower'] = 1;
$config['modules_compat']['rfc1628']['huaweiups'] = 1;

# Enable daily updates
$config['update'] = 1;
Expand Down
9 changes: 9 additions & 0 deletions includes/definitions.inc.php
Expand Up @@ -1162,6 +1162,15 @@
$config['os'][$os]['type'] = "power";
$config['os'][$os]['icon'] = "multimatic";

// Huawei UPS
$os = "huaweiups";
$config['os'][$os]['text'] = "Huawei UPS";
$config['os'][$os]['group'] = "ups";
$config['os'][$os]['type'] = "power";
$config['os'][$os]['icon'] = "huawei";
$config['os'][$os]['over'][0]['graph'] = "device_current";
$config['os'][$os]['over'][0]['text'] = "Current";

foreach ($config['os'] as $this_os => $blah)
{
if (isset($config['os'][$this_os]['group']))
Expand Down
3 changes: 3 additions & 0 deletions includes/discovery/frequencies/rfc1628.inc.php
Expand Up @@ -15,6 +15,7 @@
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "rfc1628";
$divisor = 10;
if ($device['os'] == "huaweiups") { $divisor = 100; };
$index = '3.2.0.'.$i;
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
}
Expand All @@ -24,6 +25,7 @@
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "rfc1628";
$divisor = 10;
if ($device['os'] == "huaweiups") { $divisor = 100; };
$index = '4.2.0';
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);

Expand All @@ -32,6 +34,7 @@
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "rfc1628";
$divisor = 10;
if ($device['os'] == "huaweiups") { $divisor = 100; };
$index = '5.1.0';
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
}
Expand Down
12 changes: 12 additions & 0 deletions includes/discovery/os/huaweiups.inc.php
@@ -0,0 +1,12 @@
<?php

if (!$os)
{
if (preg_match("/^Linux GSE200M/", $sysDescr)) {
if (strstr(snmp_get($device, "UPS-MIB::upsIdentManufacturer.0", "-Oqv", ""), "HUAWEI")){
$os = "huaweiups";
}
}
}

?>
3 changes: 2 additions & 1 deletion includes/discovery/os/netmanplus.inc.php
Expand Up @@ -3,6 +3,7 @@
if (!$os)
{
if (preg_match("/^NetMan.*plus/", $sysDescr)) { $os = "netmanplus"; }
if (strstr($sysObjectId, ".1.3.6.1.4.1.5491.6")) { $os = "netmanplus"; }
}

?>
?>