add some netmanplus voltages

git-svn-id: http://www.observium.org/svn/observer/trunk@1188 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-16 10:31:13 +00:00
parent 8762cfa441
commit ae696dc55c
3 changed files with 58 additions and 2 deletions

View File

@@ -214,7 +214,7 @@ switch ($device['os'])
$temp_id = $split_oid[count($split_oid)-1]; $temp_id = $split_oid[count($split_oid)-1];
$temp_oid = "1.3.6.1.2.1.33.1.2.7.$temp_id"; $temp_oid = "1.3.6.1.2.1.33.1.2.7.$temp_id";
$temp = trim(shell_exec($config['snmpget'] . " -O qv -$snmpver -c $community $hostname:$port $temp_oid")); $temp = trim(shell_exec($config['snmpget'] . " -O qv -$snmpver -c $community $hostname:$port $temp_oid"));
$descr = "Battery " . ($temp_id+1); $descr = "Battery " . (count(explode("\n",$oids)) == 1 ? '' : ($temp_id+1));
discover_temperature($valid_temp, $device, $temp_oid, $temp_id, "netmanplus", $descr, 1, NULL, NULL, $temp); discover_temperature($valid_temp, $device, $temp_oid, $temp_id, "netmanplus", $descr, 1, NULL, NULL, $temp);
} }
} }

View File

@@ -168,6 +168,57 @@ if ($device['os'] == "mgeups")
} }
} }
## Riello UPS Voltages
if ($device['os'] == "netmanplus")
{
echo("NetMan Plus ");
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.5", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids) echo("NetMan Plus Battery Voltage ");
foreach(explode("\n", $oids) as $data)
{
$data = trim($data);
if ($data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid);
$volt_id = $split_oid[count($split_oid)-1];
$volt_oid = "1.3.6.1.2.1.33.1.2.5.$volt_id";
$precision = 10;
$volt = trim(shell_exec($config['snmpget'] . " -O qv -$snmpver -c $community $hostname:$port $volt_oid")) / $precision;
$descr = "Battery " . (count(explode("\n",$oids)) == 1 ? '' : ($volt_id+1));
$type = "netmanplus";
discover_volt($device, $volt_oid, $volt_id, $type, $descr, $precision, NULL, NULL, $volt);
$volt_exists[$type][$volt_id] = 1;
}
}
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.3.3.1.3", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids) echo("NetMan Plus Input Voltage ");
foreach(explode("\n", $oids) as $data)
{
$data = trim($data);
if ($data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid);
$volt_id = $split_oid[count($split_oid)-1];
$volt_oid = "1.3.6.1.2.1.33.1.3.3.1.3.$volt_id";
$precision = 1;
$volt = trim(shell_exec($config['snmpget'] . " -O qv -$snmpver -c $community $hostname:$port $volt_oid")) / $precision;
$descr = "Input phase " . ($volt_id);
$type = "netmanplus";
discover_volt($device, $volt_oid, $volt_id, $type, $descr, $precision, NULL, NULL, $volt);
$volt_exists[$type][$volt_id] = 1;
}
}
}
## Delete removed sensors ## Delete removed sensors

View File

@@ -34,7 +34,8 @@ $os_groups['iosxr'] = "ios";
$os_groups['ios'] = "ios"; $os_groups['ios'] = "ios";
$os_groups['asa'] = "ios"; $os_groups['asa'] = "ios";
$os_groups['mgeups'] = "ups"; $os_groups['mgeups'] = "ups";
$os_groups['netmanplus'] = "ups";
$os_groups['dell-laser'] = "printer"; $os_groups['dell-laser'] = "printer";
@@ -68,6 +69,9 @@ $os_text['allied'] = "AlliedWare";
$os_text['mgeups'] = "MGE UPS"; $os_text['mgeups'] = "MGE UPS";
$os_text['apc'] = "APC"; $os_text['apc'] = "APC";
$os_text['areca'] = "Areca RAID Subsystem"; $os_text['areca'] = "Areca RAID Subsystem";
$os_text['netmanplus'] = "NetMan Plus";
$os_text['akcp'] = "AKCP SensorProbe";
$os_text['minkelsrms'] = "Minkels RMS";
if(!$config['graph_colours']['greens']) { if(!$config['graph_colours']['greens']) {
$config['graph_colours']['greens'] = array('B6D14B','91B13C','6D912D','48721E','24520F','003300'); $config['graph_colours']['greens'] = array('B6D14B','91B13C','6D912D','48721E','24520F','003300');
@@ -115,6 +119,7 @@ if(isset($_SERVER['HTTPS'])) {
$observer_link = mysql_pconnect($config['db_host'], $config['db_user'], $config['db_pass']); $observer_link = mysql_pconnect($config['db_host'], $config['db_user'], $config['db_pass']);
if (!$observer_link) { if (!$observer_link) {
echo "<h2>Observer MySQL Error</h2>"; echo "<h2>Observer MySQL Error</h2>";
echo mysql_error();
die; die;
} }
$observer_db = mysql_select_db($config['db_name'], $observer_link); $observer_db = mysql_select_db($config['db_name'], $observer_link);