About 59 results: "mysql_query repo:MelFlynn/observium"
Page 1 of 3
Filter Results
Sources
Languages
Filter Results
Try Search On


adva.inc.php in observium https://bitbucket.org/MelFlynn/observium | 89 lines | PHP
  1.     {
  2.       if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_chassis' AND temperature_host = '$id'"),0) == '0')
  3.         $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_chassis', '$descr_chassis',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_chassis')";
  4.         mysql_query($query);
  5.         echo("+");
  6.       } elseif (mysql_result(mysql_query("SELECT `temperature_descr` FROM temperature WHERE `temperature_host` = '$id' AND `temperature_oid` = '$oid_chassis'"), 0) != $descr_chassis) {
  7.         echo("U");
  8.         mysql_query("UPDATE temperature SET `temperature_descr` = '$descr_chassis' WHERE `temperature_host` = '$id' AND `temperature_oid` = '$oid_chassis'");
  9.     {
  10.       if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_stm16' AND temperature_host = '$id'"),0) == '0')
  11.        $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_stm16', '$descr_stm16',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_stm16')";
  12.        mysql_query($query);
  13.        echo("+");
  14.       } elseif (mysql_result(mysql_query("SELECT `temperature_descr` FROM temperature WHERE `temperature_host` = '$id' AND `temperature_oid` = '$oid_stm16'"), 0) != $descr_stm16) {
  15.         echo("U");








jt.php in observium https://bitbucket.org/MelFlynn/observium | 241 lines | PHP
  1. 
                        
  2. $sql = mysql_query("SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' " . $uptimesql);
  3. 
                        
  4. $sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'");
  5. 
                        
  6. $sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'");
  7. 
                        
  8. $sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id");
  9. {
  10.   $sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'");
  11. $sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog,devices WHERE syslog.device_id = devices.device_id ORDER BY seq DESC LIMIT 20";
  12. $query = mysql_query($sql);
  13.   $sql  = "select * from ports as I, devices as D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
  14.   $query = mysql_query($sql);
  15.   $sql  = "select * from ports as I, devices as D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
  16.   $query = mysql_query($sql);

discovery-protocols.inc.php in observium https://bitbucket.org/MelFlynn/observium | 171 lines | PHP
  1.     {
  2.       $interface = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '".$key."'"));
  3.         $fdp = $fdp_if_array[$entry_key];
  4.         $remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$fdp['snFdpCacheDeviceId']."' OR `hostname`='".$fdp['snFdpCacheDeviceId']."'"), 0);
  5.           $if = $fdp['snFdpCacheDevicePort'];
  6.           $remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if') AND `device_id` = '".$remote_device_id."'"),0);
  7.       }
  8.       $interface = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '".$ifIndex."'"));
  9.         $lldp = $lldp_instance[$entry_instance];
  10.         $remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$lldp['lldpRemSysName']."' OR `hostname`='".$lldp['lldpRemSysName']."'"), 0);
  11.           $if = $lldp['lldpRemPortDesc']; $id = $lldp['lldpRemPortId'];
  12.           $remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if' OR `ifDescr`= '$id' OR `ifName`='$id') AND `device_id` = '".$remote_device_id."'"),0);
  13. $sql = "SELECT * FROM `links` AS L, `ports` AS I WHERE L.local_interface_id = I.interface_id AND I.device_id = '".$device['device_id']."'";
  14. if ($query = mysql_query($sql))
  15.       echo("-");
  16.       mysql_query("DELETE FROM `links` WHERE id = '" . $test['id'] . "'");









Back to Top