Search in sources :

Example 56 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class VdsManager method moveVmsToUnknown.

private void moveVmsToUnknown(List<VmDynamic> vms) {
    if (vms.isEmpty()) {
        return;
    }
    List<Guid> vmIds = vms.stream().map(VmDynamic::getId).collect(Collectors.toList());
    vmIds.forEach(resourceManager::removeAsyncRunningVm);
    getVmDynamicDao().updateVmsToUnknown(vmIds);
    vmIds.forEach(vmId -> {
        // log VM transition to unknown status
        AuditLogable logable = new AuditLogableImpl();
        logable.setVmId(vmId);
        logable.setVmName(vmStaticDao.get(vmId).getName());
        auditLogDirector.log(logable, AuditLogType.VM_SET_TO_UNKNOWN_STATUS);
    });
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) Guid(org.ovirt.engine.core.compat.Guid) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 57 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class PmHealthCheckManager method addAlert.

private void addAlert(VDS host, AuditLogType auditMessage) {
    AuditLogable alert = new AuditLogableImpl();
    alert.setVdsId(host.getId());
    alert.setVdsName(host.getName());
    alert.setClusterId(host.getClusterId());
    alert.setClusterName(host.getClusterName());
    auditLogDirector.log(alert, auditMessage);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 58 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class AffinityRulesEnforcementManager method wakeup.

@PostConstruct
protected void wakeup() {
    auditLogDirector.log(new AuditLogableImpl(), AuditLogType.AFFINITY_RULES_ENFORCEMENT_MANAGER_START);
    scheduleJobs(getRegularInterval(), getInitialInterval());
}
Also used : AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) PostConstruct(javax.annotation.PostConstruct)

Example 59 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class VdsBrokerCommand method logToAudit.

@Override
protected void logToAudit() {
    if (isPolicyResetMessage(getReturnStatus().message)) {
        return;
    }
    AuditLogable logable = new AuditLogableImpl();
    logable.setVdsId(vds.getId());
    logable.setVdsName(vds.getName());
    logable.addCustomValue("CommandName", getCommandName());
    logable.addCustomValue("message", getReturnStatus().message);
    auditLogDirector.log(logable, AuditLogType.VDS_BROKER_COMMAND_FAILURE);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 60 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class MultipathHealthHandler method createAuditLogableForHost.

private AuditLogable createAuditLogableForHost(VDS vds) {
    AuditLogable logable = new AuditLogableImpl();
    logable.setVdsId(vds.getId());
    logable.setVdsName(vds.getName());
    return logable;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Aggregations

AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)88 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)85 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)8 AuditLogType (org.ovirt.engine.core.common.AuditLogType)6 Guid (org.ovirt.engine.core.compat.Guid)5 EngineException (org.ovirt.engine.core.common.errors.EngineException)4 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 AnsibleCommandBuilder (org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder)3 AnsibleReturnValue (org.ovirt.engine.core.common.utils.ansible.AnsibleReturnValue)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)2 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)2 Event (org.ovirt.engine.core.common.eventqueue.Event)2