_______________________________________________Hi,
got some time (and finally fed up with the eventlog getting spammed) and dig into this issue. Problem is that the database has sensor_mib/sensor_object set to empty string and we get NULL from the device. When we then compare the two with float_cmp() it returns -1 and we update the db.
The fix is either to set the fields in db to null or use this patch:
root@observium:/opt/observium# svn di includes/functions.inc.php
Index: includes/functions.inc.php
===================================================================
--- includes/functions.inc.php (revision 9652)
+++ includes/functions.inc.php (working copy)
@@ -3902,6 +3902,8 @@
if ($a === $b)
{
$compare = 0; // Variables same
+ }else if(empty($a) && empty($b) && strlen($a) == strlen($b)){
+ $compare = 0; // Both are empty and same length - could be NULL compared to empty string
}
}
if ($compare === FALSE)What the root couse is (why the db has empty string) I have no idea. I have removed and added the device and it still did the same thing. The other equallogic devices have NULL instead of empty string.
/niklas
Den 2018-12-13 kl. 09:20, skrev Niklas Larsson via observium:
Hi,
replaced a Dell EqualLogic member and since then I get logs of sensor updates every time discovery is running.
I can not see any changes though, snipped from attached output:
Discover sensor: [class: temperature, device: eql.example.com, oid: .1.3.6.1.4.1.12740.2.1.6.1.3.1.1071562282.2, index: 1.1071562282.2, type: equallogic, descr: Backplane sensor 0, scale: 1, limits: (1, 2, 45, 50), CURRENT: 24, ,
SQL[SELECT COUNT(`sensor_id`) FROM `sensors`
WHERE `poller_type`= 'snmp' AND `sensor_class` = 'temperature' AND `device_id` = '38' AND `sensor_type` = 'equallogic' AND `sensor_index` = '1.1071562282.2']
ROWS[1]
SQL RUNTIME[0.00074983s]
SQL[SELECT * FROM `sensors` WHERE `sensor_class` = 'temperature' AND `device_id` = '38' AND `sensor_type` = 'equallogic' AND `sensor_index` = '1.1071562282.2']
ROWS[1]
SQL RUNTIME[0.00094700s]
Compare float numbers: "50" with "50", epsilon: "0.1", comparision: "0 < 0.1", numbers: SAME
Compare float numbers: "45" with "45", epsilon: "0.1", comparision: "0 < 0.1", numbers: SAME
Compare float numbers: "1" with "1", epsilon: "0.1", comparision: "0 < 0.1", numbers: SAME
Compare float numbers: "2" with "2", epsilon: "0.1", comparision: "0 < 0.1", numbers: SAME
Compare float numbers: "1" with "1", epsilon: "1.0E-5", comparision: "0 < 1.0E-5", numbers: SAME
Compare float numbers: "0" with "0", epsilon: "1.0E-5", comparision: "0 < 1.0E-5", numbers: SAME
SQL[SELECT `attrib_value` FROM `entity_attribs` WHERE `entity_type` = 'sensor' AND `entity_id` = '5230' AND `attrib_type` = 'sensor_addition']
ROWS[0]
SQL RUNTIME[0.00034690s]
SQL[UPDATE `sensors` set `sensor_mib` ='',`sensor_object` ='' WHERE `sensor_id` = '5230']
ROWS[0]
SQL RUNTIME[0.00050497s]
U
SQL[INSERT INTO `eventlog` (`device_id`,`entity_id`,`entity_type`,`timestamp`,`severity`,`message`) VALUES ('38','5230','sensor',NOW(),'6','Sensor updated: temperature equallogic 1.1071562282.2 Backplane sensor 0')]
ROWS[1]
SQL RUNTIME[0.00040412s]
What can I do?
/niklas
_______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium