removed snmp query from webui, changed and added echo if file is missing

This commit is contained in:
crcro
2016-09-20 22:01:29 +03:00
parent 7d7621fd3e
commit 780d8b2139
5 changed files with 15 additions and 11 deletions

View File

@@ -31,5 +31,8 @@ $unit_text = 'Percent';
$ups_nut = rrd_name($device['hostname'], array('app', 'ups-nut', $app['app_id']));
if (rrdtool_check_rrd_exists($ups_nut)) {
$rrd_filename = $ups_nut;
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -31,5 +31,8 @@ $unit_text = 'Percent';
$ups_nut = rrd_name($device['hostname'], array('app', 'ups-nut', $app['app_id']));
if (rrdtool_check_rrd_exists($ups_nut)) {
$rrd_filename = $ups_nut;
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -32,5 +32,8 @@ $unit_text = 'Minutes';
$ups_nut = rrd_name($device['hostname'], array('app', 'ups-nut', $app['app_id']));
if (rrdtool_check_rrd_exists($ups_nut)) {
$rrd_filename = $ups_nut;
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -48,7 +48,7 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
$i++;
}
} else {
echo "file missing: ".$rrd_filename;
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_v3_multiline_float.inc.php';

View File

@@ -22,17 +22,12 @@
global $config;
//NET-SNMP-EXTEND-MIB::nsExtendOutLine.\"ups-nut\"
$ups_model = snmp_get($device, '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.4', '-Oqv');
$ups_serial = snmp_get($device, '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.5', '-Oqv');
$ups_details = $ups_model.' (SN:'.$ups_serial.')';
$graphs = array(
'ups-nut_remaining' => 'Remaining time: '.$ups_details,
'ups-nut_load' => 'Load: '.$ups_details,
'ups-nut_voltage_battery' => 'Battery voltage: '.$ups_details,
'ups-nut_charge' => 'Charge: '.$ups_details,
'ups-nut_voltage_input' => 'Input voltage: '.$ups_details,
'ups-nut_remaining' => 'Remaining time: ',
'ups-nut_load' => 'Load: ',
'ups-nut_voltage_battery' => 'Battery voltage: ',
'ups-nut_charge' => 'Charge: ',
'ups-nut_voltage_input' => 'Input voltage: ',
);
foreach ($graphs as $key => $text) {