![](https://secure.gravatar.com/avatar/06aa7c7b7c1aceeb9f755fe9380d301a.jpg?s=120&d=mm&r=g)
ok, that got me moving forward DELETE FROM vminfo WHERE vm_source IS NULL
thanks
Peter Hine Senior Technical Support Engineer (Servers) FCoA ITS peter.hine@familycourt.gov.au
From: "Adam Armstrong" adama@memetic.org To: "" observium@observium.org Date: 03/02/2016 10:57 Subject: Re: [Observium] duplicate entries in vminfo table . [SEC=UNCLASSIFIED] Sent by: "observium" observium-bounces@observium.org
DELETE FROM `vminfo` WHERE `vm_type` = NULL;
Might work :D
If not, just truncate the table. TRUNCATE `vminfo`;
adam. On 02/02/2016 23:48:11, peter.hine@familycourt.gov.au peter.hine@familycourt.gov.au wrote:
vCE 0.16.1.7533
going to the VMs tab of a vmWare server shows duplicate entries.
hunting this down in the code shows the following in html/pages/device/vm.inc.php
foreach (dbFetchRows("SELECT * FROM vminfo WHERE device_id = ? ORDER BY vm_name", array($device['device_id'])) as $vm) { print_vm_row($vm, $device); }
so running it on the command line echo 'SELECT * FROM vminfo WHERE device_id = '586' ORDER BY vm_name' | mysql --user=observium --password=not_my_pass observium
reveals the entries to be duplicated in the table.
they all seem to have the last field as a difference. there must be something missing in the code for adding the entries to not find the first entries and update them.
" 2586 586 vmware cbr-desktop E: tools not running 3072 2 powered off 4239aa20-542a-f088-dedf-afb508da6a9c NULL 2757 586 vmware cbr-desktop E: tools not running 3072 2 powered off 4239aa20-542a-f088-dedf-afb508da6a9c vmware-snmp "
either NULL or vmware-snmp.
Can someone in the Team give me a sql to remove the bad rows ?
thanks
Peter Hine Senior Technical Support Engineer (Servers) FCoA ITS peter.hine@familycourt.gov.au
********************************************************************** The information contained in this e-mail (including any attachments) is for the exclusive use of the addressee. If you are not the intended recipient please notify the sender immediately and delete this e-mail. It is noted that legal privilege is not waived because you have read this e-mail. **********************************************************************
_______________________________________________ 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