$printer_supply = dbFetchRow("SELECT * FROM `printersupplies` WHERE `device_id` = ? AND `supply_mib` = ? AND `supply_index` = ?", array($device['device_id'], 'jetdirect', $index)); $marker_descr = "Printed " . nicecase($entry['prtMarkerCounterUnit']); list($hrDeviceIndex, $prtMarkerIndex) = explode('.', $index); $options = array('measured_class' => 'printersupply', 'measured_entity' => $printer_supply['supply_id'], 'sensor_unit' => $entry['prtMarkerCounterUnit']); // Lifetime counter (should be always single) $descr = "Total {$marker_descr}"; $oid_name = 'prtMarkerLifeCount'; $oid = '.1.3.6.1.2.1.43.10.2.1.4.' . $index; $value = $entry[$oid_name]; if (isset($entry[$oid_name])) { // CLEANME. Compatibility, remove in r8500, but not before CE 0.16.8 // Rename olf rrd filename and old ds name $new_rrd = 'sensor-counter-Printer-MIB-prtMarkerLifeCount-' . $index; $renamed = rename_rrd($device, 'pagecount', $new_rrd); if ($renamed) { rrdtool_rename_ds($device, $new_rrd, 'pagecount', 'sensor'); } discover_sensor($valid['sensor'], 'counter', $device, $oid, $index, $mib . '-' . $oid_name, $descr, 1, $value, $options); } // PowerOn counter $descr = "PowerOn {$marker_descr}"; if ($prt_supplies[$index]['prtMarkerSuppliesDescription']) { $descr .= ' - ' . snmp_hexstring($prt_supplies[$index]['prtMarkerSuppliesDescription']); } $oid_name = 'prtMarkerPowerOnCount'; $oid = '.1.3.6.1.2.1.43.10.2.1.5.' . $index; $value = $entry[$oid_name]; discover_sensor($valid['sensor'], 'counter', $device, $oid, $index, $mib . '-' . $oid_name, $descr, 1, $value, $options); // prtMarkerStatus // FIXME, binary statuses currently unsupported }
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage update * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $netscaler_devices = dbFetchRows("SELECT * FROM `devices` WHERE `os` = 'netscaler';"); if (count($netscaler_devices)) { echo 'Updating RRD ds names for Netscaler HTTP graphs: '; $ds_list = array('spdyv2TotStreams:COUNTER:600:U:100000000000', 'spdyv3TotStreams:COUNTER:600:U:100000000000', 'TotRequestsRate:GAUGE:600:U:100000000000', 'TotResponsesRate:GAUGE:600:U:100000000000'); foreach ($netscaler_devices as $device) { $oldname = substr($newname, 0, 18); $status = rrdtool_rename_ds($device, 'nsHttpStatsGroup.rrd', "TotResposesRate", "TotResponsesRate"); $status = rrdtool_rename_ds($device, 'nsHttpStatsGroup.rrd', "spdy2TotStreams", "spdyTotStreams"); foreach ($ds_list as $ds) { $status_b = rrdtool_add_ds($device, 'nsHttpStatsGroup.rrd', $ds); } echo '.'; } } unset($status, $netscaler_devices, $ds_rename); // EOF
/** * Observium * * This file is part of Observium. * * @package observium * @subpackage update * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $netscaler_devices = dbFetchRows("SELECT * FROM `devices` WHERE `os` = 'netscaler';"); $ds_rename = array('ErrRetransmitGiveUp', 'TotClientConnOpened', 'TotClientConnClosed', 'CurClientConnClosin', 'CurServerConnEstabl', 'CurClientConnOpenin', 'CurClientConnEstabl', 'CurServerConnClosin', 'TotServerConnOpened', 'TotServerConnClosed', 'CurServerConnOpenin', 'TotZomCltConnFlushe', 'TotZomSvrConnFlushe', 'TotZomAcHalfCloseCl', 'TotZomAcHalfCloseSv', 'TotZomHalfOpenCltCo', 'TotZomHalfOpenSvrCo', 'TotZomPsHalfCloseCl', 'TotZomPsHalfCloseSr', 'ErrCookiePktSeqReje', 'ErrCookiePktSigReje', 'ErrCookiePktSeqDrop', 'ErrCookiePktMssReje', 'ErrSynDroppedConges', 'ErrFastRetransmissi', 'ErrFirstRetransmiss', 'ErrSecondRetransmis', 'ErrThirdRetransmiss', 'ErrForthRetransmiss', 'ErrFifthRetransmiss', 'ErrSixthRetransmiss', 'ErrSeventhRetransmi', 'ErrPartialRetrasmit'); if (count($netscaler_devices)) { echo ' Converting RRD ds names for Netscaler TCP graphs: '; foreach ($netscaler_devices as $device) { foreach ($ds_rename as $newname) { $oldname = substr($newname, 0, 18); $status = rrdtool_rename_ds($device, 'netscaler-stats-tcp.rrd', $oldname, $newname); // rename 18chars -> 19chars if ($newname == 'ErrRetransmitGiveUp' && $status === FALSE) { // break loop if DS already correct break; } } if ($status) { echo '.'; } } } unset($status, $netscaler_devices, $ds_rename); // EOF
* Observium * * This file is part of Observium. * * @package observium * @subpackage update * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $cbqos_ports = dbFetchRows("SELECT `device_id`,`policy_index`,`object_index` FROM `ports_cbqos`;"); $ds_rename = array('PrePolicyPkt', 'PrePolicyByte', 'PostPolicyByte', 'DropPkt', 'DropByte', 'NoBufDropPkt'); if (count($cbqos_ports)) { echo 'Converting RRD ds names for CBQoS graphs: '; foreach ($cbqos_ports as $cbqos) { $device = device_by_id_cache($cbqos['device_id']); foreach ($ds_rename as $newname) { $oldname = $newname . '64'; $index = $cbqos['policy_index'] . '-' . $cbqos['object_index']; $status = rrdtool_rename_ds($device, "cbqos-{$index}", $oldname, $newname); if ($newname == 'PrePolicyPkt' && $status === FALSE) { // break loop if DS already correct break; } } if ($status) { echo '.'; } } } unset($status, $cbqos_ports, $cbqos, $ds_rename); // EOF
if (stristr($supply['supply_descr'], 'magenta') !== FALSE) { $old_rrd = "drum-m.rrd"; } else { if (stristr($supply['supply_descr'], 'magenta') !== FALSE) { $old_rrd = "drum-y.rrd"; } else { if (stristr($supply['supply_descr'], 'black') !== FALSE) { $old_rrd = "drum-k.rrd"; } else { $old_rrd = "drum.rrd"; } } } } if (rename_rrd($device, $old_rrd, $supply_rrd)) { rrdtool_rename_ds($device, $supply_rrd, 'drum', 'level'); } } else { if (stristr($supply['supply_descr'], 'transfer') !== FALSE) { $old_rrd = 'transferroller.rrd'; rename_rrd($device, $old_rrd, $supply_rrd); } } break; case 'wastetoner': $old_rrd = 'wastebox.rrd'; rename_rrd($device, $old_rrd, $supply_rrd); break; case 'fuser': $old_rrd = 'fuser.rrd'; rename_rrd($device, $old_rrd, $supply_rrd);