Search in sources :

Example 11 with AuditLogableImpl

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

the class UpdateVmCommand method logHotSetActionEvent.

/**
 * add audit log msg for failed hot set in case error was in CDA
 * otherwise internal command will audit log the result
 */
private void logHotSetActionEvent(ActionReturnValue setActionResult, AuditLogType logType) {
    if (!setActionResult.isValid()) {
        AuditLogable logable = new AuditLogableImpl();
        logable.setVmId(getVmId());
        logable.setVmName(getVmName());
        List<String> validationMessages = backend.getErrorsTranslator().translateErrorText(setActionResult.getValidationMessages());
        logable.addCustomValue(HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE, StringUtils.join(validationMessages, ","));
        auditLogDirector.log(logable, logType);
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 12 with AuditLogableImpl

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

the class FenceAgentExecutor method createAuditLogObject.

private AuditLogable createAuditLogObject(FenceActionType action, FenceAgent agent, VDS proxyHost) {
    AuditLogable alb = new AuditLogableImpl();
    alb.addCustomValue("Action", action.name().toLowerCase());
    alb.addCustomValue("Host", fencedHost.getName() == null ? fencedHost.getId().toString() : fencedHost.getName());
    alb.addCustomValue("AgentType", agent.getType());
    alb.addCustomValue("AgentIp", agent.getIp());
    alb.addCustomValue("ProxyHost", proxyHost.getName());
    alb.setVdsId(fencedHost.getId());
    return alb;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 13 with AuditLogableImpl

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

the class MacPoolUsingRanges method initialize.

void initialize(boolean engineStartup, List<String> macsForMacPool) {
    log.info("Initializing {}", this);
    this.macsStorage = createMacsStorage(this.rangesBoundaries);
    log.debug("Initializing {} with macs: {}", this, macsForMacPool);
    List<String> notAddedMacs = addMacs(macsForMacPool);
    if (!notAddedMacs.isEmpty()) {
        if (engineStartup) {
            String auditLogMessage = "Following MACs violates duplicity restriction, and was pushed into MAC pool without respect to it:" + notAddedMacs;
            auditLogDirector.log(new AuditLogableImpl(), AuditLogType.MAC_ADDRESS_VIOLATES_NO_DUPLICATES_SETTING, auditLogMessage);
            forceAddMacs(notAddedMacs);
        } else {
            throw new EngineException(EngineError.MAC_POOL_INITIALIZATION_FAILED, "Unable to initialize MAC pool due to existing duplicates");
        }
    }
    log.info("Finished initializing {}. Available MACs in pool: {}", this, macsStorage.getAvailableMacsCount());
}
Also used : EngineException(org.ovirt.engine.core.common.errors.EngineException) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 14 with AuditLogableImpl

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

the class PowerSavingBalancePolicyUnit method logAction.

private void logAction(VDS vds, AuditLogType type) {
    AuditLogable loggable = new AuditLogableImpl();
    loggable.addCustomValue("Host", vds.getName());
    loggable.setVdsName(vds.getName());
    loggable.setVdsId(vds.getId());
    loggable.setClusterId(vds.getClusterId());
    loggable.setClusterName(vds.getClusterName());
    Injector.get(AuditLogDirector.class).log(loggable, type);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) AuditLogDirector(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)

Example 15 with AuditLogableImpl

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

the class DataCenterCompatibilityChecker method logAlert.

private void logAlert(Version version, StoragePool storagePool) {
    AuditLogable auditLog = new AuditLogableImpl();
    auditLog.setStoragePoolId(storagePool.getId());
    auditLog.setStoragePoolName(storagePool.getName());
    auditLog.addCustomValue("engineVersion", version.toString());
    auditLog.addCustomValue("dcVersion", storagePool.getCompatibilityVersion().toString());
    auditLogDirector.log(auditLog, AuditLogType.STORAGE_POOL_LOWER_THAN_ENGINE_HIGHEST_CLUSTER_LEVEL);
}
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