Search in sources :

Example 71 with AuditLogableImpl

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

the class FenceVdsVDSCommand method alertActionSkippedAlreadyInStatus.

/**
 * Alerts when power management stop was skipped because host is already down.
 */
protected void alertActionSkippedAlreadyInStatus() {
    AuditLogable auditLogable = new AuditLogableImpl();
    auditLogable.addCustomValue("HostName", getTargetVds().getName());
    auditLogable.addCustomValue("AgentStatus", getParameters().getAction().getValue());
    auditLogable.addCustomValue("Operation", getParameters().getAction().toString());
    auditLogDirector.log(auditLogable, AuditLogType.VDS_ALREADY_IN_REQUESTED_STATUS);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 72 with AuditLogableImpl

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

the class FenceVdsVDSCommand method alertPowerManagementStatusFailed.

/**
 * Alerts if power management status failed.
 *
 * @param reason
 *            The reason.
 */
protected void alertPowerManagementStatusFailed(String reason) {
    AuditLogable alert = new AuditLogableImpl();
    alert.setVdsId(getParameters().getTargetVdsID());
    alert.setVdsName(getTargetVds().getName());
    alert.addCustomValue("Reason", reason);
    auditLogDirector.log(alert, AuditLogType.VDS_ALERT_FENCE_TEST_FAILED);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 73 with AuditLogableImpl

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

the class ExternalNetworkManager method deallocateIfExternal.

/**
 * Deallocate the vNIC from the external network, if it's attached to a network and the network is indeed an
 * external network (otherwise, nothing is done).
 */
public void deallocateIfExternal() {
    if (getNetwork() != null && getNetwork().isExternal()) {
        Provider<?> provider = providerDao.get(getNetwork().getProvidedBy().getProviderId());
        NetworkProviderProxy providerProxy = providerProxyFactory.create(provider);
        try {
            providerProxy.deallocate(nic);
        } catch (EngineException e) {
            AuditLogable removePortFailureEvent = new AuditLogableImpl();
            removePortFailureEvent.addCustomValue("NicName", nic.getName());
            removePortFailureEvent.addCustomValue("NicId", nic.getId().toString());
            removePortFailureEvent.addCustomValue("ProviderName", provider.getName());
            auditLogDirector.log(removePortFailureEvent, AuditLogType.REMOVE_PORT_FROM_EXTERNAL_PROVIDER_FAILED);
        }
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) EngineException(org.ovirt.engine.core.common.errors.EngineException) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) NetworkProviderProxy(org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy)

Example 74 with AuditLogableImpl

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

the class ImportVmCommandBase method createExternalMacsAuditLog.

private AuditLogable createExternalMacsAuditLog(VM vm, Set<String> externalMacs) {
    AuditLogable logable = new AuditLogableImpl();
    logable.setVmId(vm.getId());
    logable.setVmName(vm.getName());
    logable.addCustomValue("MACAddr", externalMacs.stream().collect(Collectors.joining(", ")));
    return logable;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 75 with AuditLogableImpl

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

the class GetTemplatesFromExportDomainQuery method auditLogOvfLoadError.

private void auditLogOvfLoadError(String machineName, String errorMessage) {
    AuditLogable logable = new AuditLogableImpl();
    logable.addCustomValue("Template", machineName).addCustomValue("ErrorMessage", errorMessage);
    auditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE);
}
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